armsql

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: MIT Imports: 15 Imported by: 18

README

Azure SQL Database Module for Go

PkgGoDev

The armsql module provides operations for working with Azure SQL Database.

Source code

Getting started

Prerequisites

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure SQL Database module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure SQL Database. 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.

Clients

Azure SQL Database modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential.

client := armsql.NewInstanceFailoverGroupsClient(<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{
    Host: arm.AzureChina,
}
client := armsql.NewInstanceFailoverGroupsClient(<subscription ID>, cred, &options)

More sample code

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the SQL Database 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 AdministratorListResult

type AdministratorListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ServerAzureADAdministrator `json:"value,omitempty" azure:"ro"`
}

AdministratorListResult - A list of active directory administrators.

func (AdministratorListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AdministratorListResult.

type AdministratorName

type AdministratorName string
const (
	AdministratorNameActiveDirectory AdministratorName = "ActiveDirectory"
)

func PossibleAdministratorNameValues

func PossibleAdministratorNameValues() []AdministratorName

PossibleAdministratorNameValues returns the possible values for the AdministratorName const type.

func (AdministratorName) ToPtr

ToPtr returns a *AdministratorName pointing to the current value.

type AdministratorProperties

type AdministratorProperties struct {
	// REQUIRED; Type of the sever administrator.
	AdministratorType *AdministratorType `json:"administratorType,omitempty"`

	// REQUIRED; Login name of the server administrator.
	Login *string `json:"login,omitempty"`

	// REQUIRED; SID (object ID) of the server administrator.
	Sid *string `json:"sid,omitempty"`

	// Tenant ID of the administrator.
	TenantID *string `json:"tenantId,omitempty"`

	// READ-ONLY; Azure Active Directory only Authentication enabled.
	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty" azure:"ro"`
}

AdministratorProperties - Properties of a active directory administrator.

type AdministratorType

type AdministratorType string

AdministratorType - Type of the sever administrator.

const (
	AdministratorTypeActiveDirectory AdministratorType = "ActiveDirectory"
)

func PossibleAdministratorTypeValues

func PossibleAdministratorTypeValues() []AdministratorType

PossibleAdministratorTypeValues returns the possible values for the AdministratorType const type.

func (AdministratorType) ToPtr

ToPtr returns a *AdministratorType pointing to the current value.

type Advisor

type Advisor struct {
	// Resource properties.
	Properties *AdvisorProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource kind.
	Kind *string `json:"kind,omitempty" azure:"ro"`

	// READ-ONLY; Resource location.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

Advisor - Database, Server or Elastic Pool Advisor.

func (Advisor) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Advisor.

type AdvisorProperties

type AdvisorProperties struct {
	// REQUIRED; Gets the auto-execute status (whether to let the system execute the recommendations) of this advisor. Possible
	// values are 'Enabled' and 'Disabled'
	AutoExecuteStatus *AutoExecuteStatus `json:"autoExecuteStatus,omitempty"`

	// READ-ONLY; Gets the status of availability of this advisor to customers. Possible values are 'GA', 'PublicPreview', 'LimitedPublicPreview'
	// and 'PrivatePreview'.
	AdvisorStatus *AdvisorStatus `json:"advisorStatus,omitempty" azure:"ro"`

	// READ-ONLY; Gets the resource from which current value of auto-execute status is inherited. Auto-execute status can be set
	// on (and inherited from) different levels in the resource hierarchy. Possible values are
	// 'Subscription', 'Server', 'ElasticPool', 'Database' and 'Default' (when status is not explicitly set on any level).
	AutoExecuteStatusInheritedFrom *AutoExecuteStatusInheritedFrom `json:"autoExecuteStatusInheritedFrom,omitempty" azure:"ro"`

	// READ-ONLY; Gets the time when the current resource was analyzed for recommendations by this advisor.
	LastChecked *time.Time `json:"lastChecked,omitempty" azure:"ro"`

	// READ-ONLY; Gets that status of recommendations for this advisor and reason for not having any recommendations. Possible
	// values include, but are not limited to, 'Ok' (Recommendations available),LowActivity (not
	// enough workload to analyze), 'DbSeemsTuned' (Database is doing well), etc.
	RecommendationsStatus *string `json:"recommendationsStatus,omitempty" azure:"ro"`

	// READ-ONLY; Gets the recommended actions for this advisor.
	RecommendedActions []*RecommendedAction `json:"recommendedActions,omitempty" azure:"ro"`
}

AdvisorProperties - Properties for a Database, Server or Elastic Pool Advisor.

func (AdvisorProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AdvisorProperties.

func (*AdvisorProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type AdvisorProperties.

type AdvisorStatus

type AdvisorStatus string

AdvisorStatus - Gets the status of availability of this advisor to customers. Possible values are 'GA', 'PublicPreview', 'LimitedPublicPreview' and 'PrivatePreview'.

const (
	AdvisorStatusGA                   AdvisorStatus = "GA"
	AdvisorStatusPublicPreview        AdvisorStatus = "PublicPreview"
	AdvisorStatusLimitedPublicPreview AdvisorStatus = "LimitedPublicPreview"
	AdvisorStatusPrivatePreview       AdvisorStatus = "PrivatePreview"
)

func PossibleAdvisorStatusValues

func PossibleAdvisorStatusValues() []AdvisorStatus

PossibleAdvisorStatusValues returns the possible values for the AdvisorStatus const type.

func (AdvisorStatus) ToPtr

func (c AdvisorStatus) ToPtr() *AdvisorStatus

ToPtr returns a *AdvisorStatus pointing to the current value.

type AgentClient added in v0.3.0

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

AgentClient contains the methods for the SQLAgent group. Don't use this type directly, use NewAgentClient() instead.

func NewAgentClient added in v0.3.0

func NewAgentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *AgentClient

NewAgentClient creates a new instance of AgentClient with the specified values. subscriptionID - The 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 (*AgentClient) CreateOrUpdate added in v0.3.0

func (client *AgentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters AgentConfiguration, options *AgentClientCreateOrUpdateOptions) (AgentClientCreateOrUpdateResponse, error)

CreateOrUpdate - Puts new sql agent configuration to instance. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - AgentClientCreateOrUpdateOptions contains the optional parameters for the AgentClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationPut.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewAgentClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.AgentConfiguration{
			Properties: &armsql.AgentConfigurationProperties{
				State: armsql.SQLAgentConfigurationPropertiesState("Enabled").ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.AgentClientCreateOrUpdateResult)
}
Output:

func (*AgentClient) Get added in v0.3.0

func (client *AgentClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, options *AgentClientGetOptions) (AgentClientGetResponse, error)

Get - Gets current instance sql agent configuration. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - AgentClientGetOptions contains the optional parameters for the AgentClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewAgentClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.AgentClientGetResult)
}
Output:

type AgentClientCreateOrUpdateOptions added in v0.3.0

type AgentClientCreateOrUpdateOptions struct {
}

AgentClientCreateOrUpdateOptions contains the optional parameters for the AgentClient.CreateOrUpdate method.

type AgentClientCreateOrUpdateResponse added in v0.3.0

type AgentClientCreateOrUpdateResponse struct {
	AgentClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

AgentClientCreateOrUpdateResponse contains the response from method AgentClient.CreateOrUpdate.

type AgentClientCreateOrUpdateResult added in v0.3.0

type AgentClientCreateOrUpdateResult struct {
	AgentConfiguration
}

AgentClientCreateOrUpdateResult contains the result from method AgentClient.CreateOrUpdate.

type AgentClientGetOptions added in v0.3.0

type AgentClientGetOptions struct {
}

AgentClientGetOptions contains the optional parameters for the AgentClient.Get method.

type AgentClientGetResponse added in v0.3.0

type AgentClientGetResponse struct {
	AgentClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

AgentClientGetResponse contains the response from method AgentClient.Get.

type AgentClientGetResult added in v0.3.0

type AgentClientGetResult struct {
	AgentConfiguration
}

AgentClientGetResult contains the result from method AgentClient.Get.

type AgentConfiguration added in v0.3.0

type AgentConfiguration struct {
	// Resource properties.
	Properties *AgentConfigurationProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

AgentConfiguration - A recoverable managed database resource.

type AgentConfigurationProperties added in v0.3.0

type AgentConfigurationProperties struct {
	// The state of Sql Agent.
	State *SQLAgentConfigurationPropertiesState `json:"state,omitempty"`
}

AgentConfigurationProperties - Sql agent configuration properties.

type AggregationFunctionType

type AggregationFunctionType string
const (
	AggregationFunctionTypeAvg   AggregationFunctionType = "avg"
	AggregationFunctionTypeMax   AggregationFunctionType = "max"
	AggregationFunctionTypeMin   AggregationFunctionType = "min"
	AggregationFunctionTypeStdev AggregationFunctionType = "stdev"
	AggregationFunctionTypeSum   AggregationFunctionType = "sum"
)

func PossibleAggregationFunctionTypeValues

func PossibleAggregationFunctionTypeValues() []AggregationFunctionType

PossibleAggregationFunctionTypeValues returns the possible values for the AggregationFunctionType const type.

func (AggregationFunctionType) ToPtr

ToPtr returns a *AggregationFunctionType pointing to the current value.

type AuthenticationName

type AuthenticationName string
const (
	AuthenticationNameDefault AuthenticationName = "Default"
)

func PossibleAuthenticationNameValues

func PossibleAuthenticationNameValues() []AuthenticationName

PossibleAuthenticationNameValues returns the possible values for the AuthenticationName const type.

func (AuthenticationName) ToPtr

ToPtr returns a *AuthenticationName pointing to the current value.

type AutoExecuteStatus

type AutoExecuteStatus string

AutoExecuteStatus - Gets the auto-execute status (whether to let the system execute the recommendations) of this advisor. Possible values are 'Enabled' and 'Disabled'

const (
	AutoExecuteStatusEnabled  AutoExecuteStatus = "Enabled"
	AutoExecuteStatusDisabled AutoExecuteStatus = "Disabled"
	AutoExecuteStatusDefault  AutoExecuteStatus = "Default"
)

func PossibleAutoExecuteStatusValues

func PossibleAutoExecuteStatusValues() []AutoExecuteStatus

PossibleAutoExecuteStatusValues returns the possible values for the AutoExecuteStatus const type.

func (AutoExecuteStatus) ToPtr

ToPtr returns a *AutoExecuteStatus pointing to the current value.

type AutoExecuteStatusInheritedFrom

type AutoExecuteStatusInheritedFrom string

AutoExecuteStatusInheritedFrom - Gets the resource from which current value of auto-execute status is inherited. Auto-execute status can be set on (and inherited from) different levels in the resource hierarchy. Possible values are 'Subscription', 'Server', 'ElasticPool', 'Database' and 'Default' (when status is not explicitly set on any level).

const (
	AutoExecuteStatusInheritedFromDefault      AutoExecuteStatusInheritedFrom = "Default"
	AutoExecuteStatusInheritedFromSubscription AutoExecuteStatusInheritedFrom = "Subscription"
	AutoExecuteStatusInheritedFromServer       AutoExecuteStatusInheritedFrom = "Server"
	AutoExecuteStatusInheritedFromElasticPool  AutoExecuteStatusInheritedFrom = "ElasticPool"
	AutoExecuteStatusInheritedFromDatabase     AutoExecuteStatusInheritedFrom = "Database"
)

func PossibleAutoExecuteStatusInheritedFromValues

func PossibleAutoExecuteStatusInheritedFromValues() []AutoExecuteStatusInheritedFrom

PossibleAutoExecuteStatusInheritedFromValues returns the possible values for the AutoExecuteStatusInheritedFrom const type.

func (AutoExecuteStatusInheritedFrom) ToPtr

ToPtr returns a *AutoExecuteStatusInheritedFrom pointing to the current value.

type AutoPauseDelayTimeRange

type AutoPauseDelayTimeRange struct {
	// READ-ONLY; Default value is no value is provided
	Default *int32 `json:"default,omitempty" azure:"ro"`

	// READ-ONLY; Value that is used to not pause (infinite delay before pause)
	DoNotPauseValue *int32 `json:"doNotPauseValue,omitempty" azure:"ro"`

	// READ-ONLY; Maximum value
	MaxValue *int32 `json:"maxValue,omitempty" azure:"ro"`

	// READ-ONLY; Minimum value
	MinValue *int32 `json:"minValue,omitempty" azure:"ro"`

	// READ-ONLY; Step value for discrete values between the minimum value and the maximum value.
	StepSize *int32 `json:"stepSize,omitempty" azure:"ro"`

	// READ-ONLY; Unit of time that delay is expressed in
	Unit *PauseDelayTimeUnit `json:"unit,omitempty" azure:"ro"`
}

AutoPauseDelayTimeRange - Supported auto pause delay time range

type AutomaticTuningDisabledReason

type AutomaticTuningDisabledReason string

AutomaticTuningDisabledReason - Reason description if desired and actual state are different.

const (
	AutomaticTuningDisabledReasonDefault             AutomaticTuningDisabledReason = "Default"
	AutomaticTuningDisabledReasonDisabled            AutomaticTuningDisabledReason = "Disabled"
	AutomaticTuningDisabledReasonAutoConfigured      AutomaticTuningDisabledReason = "AutoConfigured"
	AutomaticTuningDisabledReasonInheritedFromServer AutomaticTuningDisabledReason = "InheritedFromServer"
	AutomaticTuningDisabledReasonQueryStoreOff       AutomaticTuningDisabledReason = "QueryStoreOff"
	AutomaticTuningDisabledReasonQueryStoreReadOnly  AutomaticTuningDisabledReason = "QueryStoreReadOnly"
	AutomaticTuningDisabledReasonNotSupported        AutomaticTuningDisabledReason = "NotSupported"
)

func PossibleAutomaticTuningDisabledReasonValues

func PossibleAutomaticTuningDisabledReasonValues() []AutomaticTuningDisabledReason

PossibleAutomaticTuningDisabledReasonValues returns the possible values for the AutomaticTuningDisabledReason const type.

func (AutomaticTuningDisabledReason) ToPtr

ToPtr returns a *AutomaticTuningDisabledReason pointing to the current value.

type AutomaticTuningMode

type AutomaticTuningMode string

AutomaticTuningMode - Automatic tuning desired state.

const (
	AutomaticTuningModeInherit     AutomaticTuningMode = "Inherit"
	AutomaticTuningModeCustom      AutomaticTuningMode = "Custom"
	AutomaticTuningModeAuto        AutomaticTuningMode = "Auto"
	AutomaticTuningModeUnspecified AutomaticTuningMode = "Unspecified"
)

func PossibleAutomaticTuningModeValues

func PossibleAutomaticTuningModeValues() []AutomaticTuningMode

PossibleAutomaticTuningModeValues returns the possible values for the AutomaticTuningMode const type.

func (AutomaticTuningMode) ToPtr

ToPtr returns a *AutomaticTuningMode pointing to the current value.

type AutomaticTuningOptionModeActual

type AutomaticTuningOptionModeActual string

AutomaticTuningOptionModeActual - Automatic tuning option actual state.

const (
	AutomaticTuningOptionModeActualOff AutomaticTuningOptionModeActual = "Off"
	AutomaticTuningOptionModeActualOn  AutomaticTuningOptionModeActual = "On"
)

func PossibleAutomaticTuningOptionModeActualValues

func PossibleAutomaticTuningOptionModeActualValues() []AutomaticTuningOptionModeActual

PossibleAutomaticTuningOptionModeActualValues returns the possible values for the AutomaticTuningOptionModeActual const type.

func (AutomaticTuningOptionModeActual) ToPtr

ToPtr returns a *AutomaticTuningOptionModeActual pointing to the current value.

type AutomaticTuningOptionModeDesired

type AutomaticTuningOptionModeDesired string

AutomaticTuningOptionModeDesired - Automatic tuning option desired state.

const (
	AutomaticTuningOptionModeDesiredOff     AutomaticTuningOptionModeDesired = "Off"
	AutomaticTuningOptionModeDesiredOn      AutomaticTuningOptionModeDesired = "On"
	AutomaticTuningOptionModeDesiredDefault AutomaticTuningOptionModeDesired = "Default"
)

func PossibleAutomaticTuningOptionModeDesiredValues

func PossibleAutomaticTuningOptionModeDesiredValues() []AutomaticTuningOptionModeDesired

PossibleAutomaticTuningOptionModeDesiredValues returns the possible values for the AutomaticTuningOptionModeDesired const type.

func (AutomaticTuningOptionModeDesired) ToPtr

ToPtr returns a *AutomaticTuningOptionModeDesired pointing to the current value.

type AutomaticTuningOptions

type AutomaticTuningOptions struct {
	// Automatic tuning option desired state.
	DesiredState *AutomaticTuningOptionModeDesired `json:"desiredState,omitempty"`

	// READ-ONLY; Automatic tuning option actual state.
	ActualState *AutomaticTuningOptionModeActual `json:"actualState,omitempty" azure:"ro"`

	// READ-ONLY; Reason code if desired and actual state are different.
	ReasonCode *int32 `json:"reasonCode,omitempty" azure:"ro"`

	// READ-ONLY; Reason description if desired and actual state are different.
	ReasonDesc *AutomaticTuningDisabledReason `json:"reasonDesc,omitempty" azure:"ro"`
}

AutomaticTuningOptions - Automatic tuning properties for individual advisors.

type AutomaticTuningServerMode

type AutomaticTuningServerMode string

AutomaticTuningServerMode - Automatic tuning desired state.

const (
	AutomaticTuningServerModeCustom      AutomaticTuningServerMode = "Custom"
	AutomaticTuningServerModeAuto        AutomaticTuningServerMode = "Auto"
	AutomaticTuningServerModeUnspecified AutomaticTuningServerMode = "Unspecified"
)

func PossibleAutomaticTuningServerModeValues

func PossibleAutomaticTuningServerModeValues() []AutomaticTuningServerMode

PossibleAutomaticTuningServerModeValues returns the possible values for the AutomaticTuningServerMode const type.

func (AutomaticTuningServerMode) ToPtr

ToPtr returns a *AutomaticTuningServerMode pointing to the current value.

type AutomaticTuningServerOptions

type AutomaticTuningServerOptions struct {
	// Automatic tuning option desired state.
	DesiredState *AutomaticTuningOptionModeDesired `json:"desiredState,omitempty"`

	// READ-ONLY; Automatic tuning option actual state.
	ActualState *AutomaticTuningOptionModeActual `json:"actualState,omitempty" azure:"ro"`

	// READ-ONLY; Reason code if desired and actual state are different.
	ReasonCode *int32 `json:"reasonCode,omitempty" azure:"ro"`

	// READ-ONLY; Reason description if desired and actual state are different.
	ReasonDesc *AutomaticTuningServerReason `json:"reasonDesc,omitempty" azure:"ro"`
}

AutomaticTuningServerOptions - Automatic tuning properties for individual advisors.

type AutomaticTuningServerProperties

type AutomaticTuningServerProperties struct {
	// Automatic tuning desired state.
	DesiredState *AutomaticTuningServerMode `json:"desiredState,omitempty"`

	// Automatic tuning options definition.
	Options map[string]*AutomaticTuningServerOptions `json:"options,omitempty"`

	// READ-ONLY; Automatic tuning actual state.
	ActualState *AutomaticTuningServerMode `json:"actualState,omitempty" azure:"ro"`
}

AutomaticTuningServerProperties - Server-level Automatic Tuning properties.

func (AutomaticTuningServerProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AutomaticTuningServerProperties.

type AutomaticTuningServerReason

type AutomaticTuningServerReason string

AutomaticTuningServerReason - Reason description if desired and actual state are different.

const (
	AutomaticTuningServerReasonDefault        AutomaticTuningServerReason = "Default"
	AutomaticTuningServerReasonDisabled       AutomaticTuningServerReason = "Disabled"
	AutomaticTuningServerReasonAutoConfigured AutomaticTuningServerReason = "AutoConfigured"
)

func PossibleAutomaticTuningServerReasonValues

func PossibleAutomaticTuningServerReasonValues() []AutomaticTuningServerReason

PossibleAutomaticTuningServerReasonValues returns the possible values for the AutomaticTuningServerReason const type.

func (AutomaticTuningServerReason) ToPtr

ToPtr returns a *AutomaticTuningServerReason pointing to the current value.

type AzureADOnlyAuthListResult

type AzureADOnlyAuthListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ServerAzureADOnlyAuthentication `json:"value,omitempty" azure:"ro"`
}

AzureADOnlyAuthListResult - A list of active directory only authentications.

func (AzureADOnlyAuthListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AzureADOnlyAuthListResult.

type AzureADOnlyAuthProperties

type AzureADOnlyAuthProperties struct {
	// REQUIRED; Azure Active Directory only Authentication enabled.
	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`
}

AzureADOnlyAuthProperties - Properties of a active directory only authentication.

type BackupShortTermRetentionPoliciesClient

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

BackupShortTermRetentionPoliciesClient contains the methods for the BackupShortTermRetentionPolicies group. Don't use this type directly, use NewBackupShortTermRetentionPoliciesClient() instead.

func NewBackupShortTermRetentionPoliciesClient

func NewBackupShortTermRetentionPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *BackupShortTermRetentionPoliciesClient

NewBackupShortTermRetentionPoliciesClient creates a new instance of BackupShortTermRetentionPoliciesClient with the specified values. subscriptionID - The 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 (*BackupShortTermRetentionPoliciesClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Updates a database's short term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. policyName - The policy name. Should always be "default". parameters - The short term retention policy info. options - BackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/UpdateShortTermRetentionPolicy.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewBackupShortTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.ShortTermRetentionPolicyName("default"),
		armsql.BackupShortTermRetentionPolicy{
			Properties: &armsql.BackupShortTermRetentionPolicyProperties{
				DiffBackupIntervalInHours: armsql.DiffBackupIntervalInHours(24).ToPtr(),
				RetentionDays:             to.Int32Ptr(7),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.BackupShortTermRetentionPoliciesClientCreateOrUpdateResult)
}
Output:

func (*BackupShortTermRetentionPoliciesClient) BeginUpdate

BeginUpdate - Updates a database's short term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. policyName - The policy name. Should always be "default". parameters - The short term retention policy info. options - BackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.BeginUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/UpdateShortTermRetentionPolicy.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewBackupShortTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.ShortTermRetentionPolicyName("default"),
		armsql.BackupShortTermRetentionPolicy{
			Properties: &armsql.BackupShortTermRetentionPolicyProperties{
				DiffBackupIntervalInHours: armsql.DiffBackupIntervalInHours(24).ToPtr(),
				RetentionDays:             to.Int32Ptr(7),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.BackupShortTermRetentionPoliciesClientUpdateResult)
}
Output:

func (*BackupShortTermRetentionPoliciesClient) Get

Get - Gets a database's short term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. policyName - The policy name. Should always be "default". options - BackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetShortTermRetentionPolicy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewBackupShortTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.ShortTermRetentionPolicyName("default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.BackupShortTermRetentionPoliciesClientGetResult)
}
Output:

func (*BackupShortTermRetentionPoliciesClient) ListByDatabase

ListByDatabase - Gets a database's short term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - BackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListShortTermRetentionPoliciesByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewBackupShortTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type BackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions added in v0.3.0

type BackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct {
}

BackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate method.

type BackupShortTermRetentionPoliciesClientBeginUpdateOptions added in v0.3.0

type BackupShortTermRetentionPoliciesClientBeginUpdateOptions struct {
}

BackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.BeginUpdate method.

type BackupShortTermRetentionPoliciesClientCreateOrUpdatePoller added in v0.3.0

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

BackupShortTermRetentionPoliciesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*BackupShortTermRetentionPoliciesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*BackupShortTermRetentionPoliciesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final BackupShortTermRetentionPoliciesClientCreateOrUpdateResponse will be returned.

func (*BackupShortTermRetentionPoliciesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*BackupShortTermRetentionPoliciesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type BackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse added in v0.3.0

type BackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *BackupShortTermRetentionPoliciesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

BackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse contains the response from method BackupShortTermRetentionPoliciesClient.CreateOrUpdate.

func (BackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*BackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a BackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type BackupShortTermRetentionPoliciesClientCreateOrUpdateResponse added in v0.3.0

type BackupShortTermRetentionPoliciesClientCreateOrUpdateResponse struct {
	BackupShortTermRetentionPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

BackupShortTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method BackupShortTermRetentionPoliciesClient.CreateOrUpdate.

type BackupShortTermRetentionPoliciesClientCreateOrUpdateResult added in v0.3.0

type BackupShortTermRetentionPoliciesClientCreateOrUpdateResult struct {
	BackupShortTermRetentionPolicy
}

BackupShortTermRetentionPoliciesClientCreateOrUpdateResult contains the result from method BackupShortTermRetentionPoliciesClient.CreateOrUpdate.

type BackupShortTermRetentionPoliciesClientGetOptions added in v0.3.0

type BackupShortTermRetentionPoliciesClientGetOptions struct {
}

BackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.Get method.

type BackupShortTermRetentionPoliciesClientGetResponse added in v0.3.0

type BackupShortTermRetentionPoliciesClientGetResponse struct {
	BackupShortTermRetentionPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

BackupShortTermRetentionPoliciesClientGetResponse contains the response from method BackupShortTermRetentionPoliciesClient.Get.

type BackupShortTermRetentionPoliciesClientGetResult added in v0.3.0

type BackupShortTermRetentionPoliciesClientGetResult struct {
	BackupShortTermRetentionPolicy
}

BackupShortTermRetentionPoliciesClientGetResult contains the result from method BackupShortTermRetentionPoliciesClient.Get.

type BackupShortTermRetentionPoliciesClientListByDatabaseOptions added in v0.3.0

type BackupShortTermRetentionPoliciesClientListByDatabaseOptions struct {
}

BackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.ListByDatabase method.

type BackupShortTermRetentionPoliciesClientListByDatabasePager added in v0.3.0

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

BackupShortTermRetentionPoliciesClientListByDatabasePager provides operations for iterating over paged responses.

func (*BackupShortTermRetentionPoliciesClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*BackupShortTermRetentionPoliciesClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*BackupShortTermRetentionPoliciesClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current BackupShortTermRetentionPoliciesClientListByDatabaseResponse page.

type BackupShortTermRetentionPoliciesClientListByDatabaseResponse added in v0.3.0

type BackupShortTermRetentionPoliciesClientListByDatabaseResponse struct {
	BackupShortTermRetentionPoliciesClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

BackupShortTermRetentionPoliciesClientListByDatabaseResponse contains the response from method BackupShortTermRetentionPoliciesClient.ListByDatabase.

type BackupShortTermRetentionPoliciesClientListByDatabaseResult added in v0.3.0

type BackupShortTermRetentionPoliciesClientListByDatabaseResult struct {
	BackupShortTermRetentionPolicyListResult
}

BackupShortTermRetentionPoliciesClientListByDatabaseResult contains the result from method BackupShortTermRetentionPoliciesClient.ListByDatabase.

type BackupShortTermRetentionPoliciesClientUpdatePoller added in v0.3.0

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

BackupShortTermRetentionPoliciesClientUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*BackupShortTermRetentionPoliciesClientUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*BackupShortTermRetentionPoliciesClientUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final BackupShortTermRetentionPoliciesClientUpdateResponse will be returned.

func (*BackupShortTermRetentionPoliciesClientUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*BackupShortTermRetentionPoliciesClientUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type BackupShortTermRetentionPoliciesClientUpdatePollerResponse added in v0.3.0

type BackupShortTermRetentionPoliciesClientUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *BackupShortTermRetentionPoliciesClientUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

BackupShortTermRetentionPoliciesClientUpdatePollerResponse contains the response from method BackupShortTermRetentionPoliciesClient.Update.

func (BackupShortTermRetentionPoliciesClientUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*BackupShortTermRetentionPoliciesClientUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a BackupShortTermRetentionPoliciesClientUpdatePollerResponse from the provided client and resume token.

type BackupShortTermRetentionPoliciesClientUpdateResponse added in v0.3.0

type BackupShortTermRetentionPoliciesClientUpdateResponse struct {
	BackupShortTermRetentionPoliciesClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

BackupShortTermRetentionPoliciesClientUpdateResponse contains the response from method BackupShortTermRetentionPoliciesClient.Update.

type BackupShortTermRetentionPoliciesClientUpdateResult added in v0.3.0

type BackupShortTermRetentionPoliciesClientUpdateResult struct {
	BackupShortTermRetentionPolicy
}

BackupShortTermRetentionPoliciesClientUpdateResult contains the result from method BackupShortTermRetentionPoliciesClient.Update.

type BackupShortTermRetentionPolicy

type BackupShortTermRetentionPolicy struct {
	// Resource properties.
	Properties *BackupShortTermRetentionPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

BackupShortTermRetentionPolicy - A short term retention policy.

func (BackupShortTermRetentionPolicy) MarshalJSON

func (b BackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackupShortTermRetentionPolicy.

type BackupShortTermRetentionPolicyListResult

type BackupShortTermRetentionPolicyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*BackupShortTermRetentionPolicy `json:"value,omitempty" azure:"ro"`
}

BackupShortTermRetentionPolicyListResult - A list of short term retention policies.

func (BackupShortTermRetentionPolicyListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type BackupShortTermRetentionPolicyListResult.

type BackupShortTermRetentionPolicyProperties

type BackupShortTermRetentionPolicyProperties struct {
	// The differential backup interval in hours. This is how many interval hours between each differential backup will be supported.
	// This is only applicable to live databases but not dropped databases.
	DiffBackupIntervalInHours *DiffBackupIntervalInHours `json:"diffBackupIntervalInHours,omitempty"`

	// The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
	RetentionDays *int32 `json:"retentionDays,omitempty"`
}

BackupShortTermRetentionPolicyProperties - Properties of a short term retention policy

type BackupStorageRedundancy

type BackupStorageRedundancy string

BackupStorageRedundancy - The storage account type used to store backups for this database.

const (
	BackupStorageRedundancyGeo     BackupStorageRedundancy = "Geo"
	BackupStorageRedundancyGeoZone BackupStorageRedundancy = "GeoZone"
	BackupStorageRedundancyLocal   BackupStorageRedundancy = "Local"
	BackupStorageRedundancyZone    BackupStorageRedundancy = "Zone"
)

func PossibleBackupStorageRedundancyValues

func PossibleBackupStorageRedundancyValues() []BackupStorageRedundancy

PossibleBackupStorageRedundancyValues returns the possible values for the BackupStorageRedundancy const type.

func (BackupStorageRedundancy) ToPtr

ToPtr returns a *BackupStorageRedundancy pointing to the current value.

type BaseLongTermRetentionPolicyProperties

type BaseLongTermRetentionPolicyProperties struct {
	// The monthly retention policy for an LTR backup in an ISO 8601 format.
	MonthlyRetention *string `json:"monthlyRetention,omitempty"`

	// The week of year to take the yearly backup in an ISO 8601 format.
	WeekOfYear *int32 `json:"weekOfYear,omitempty"`

	// The weekly retention policy for an LTR backup in an ISO 8601 format.
	WeeklyRetention *string `json:"weeklyRetention,omitempty"`

	// The yearly retention policy for an LTR backup in an ISO 8601 format.
	YearlyRetention *string `json:"yearlyRetention,omitempty"`
}

BaseLongTermRetentionPolicyProperties - Properties of a long term retention policy

type BlobAuditingPolicyState

type BlobAuditingPolicyState string

BlobAuditingPolicyState - Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.

const (
	BlobAuditingPolicyStateEnabled  BlobAuditingPolicyState = "Enabled"
	BlobAuditingPolicyStateDisabled BlobAuditingPolicyState = "Disabled"
)

func PossibleBlobAuditingPolicyStateValues

func PossibleBlobAuditingPolicyStateValues() []BlobAuditingPolicyState

PossibleBlobAuditingPolicyStateValues returns the possible values for the BlobAuditingPolicyState const type.

func (BlobAuditingPolicyState) ToPtr

ToPtr returns a *BlobAuditingPolicyState pointing to the current value.

type CapabilitiesClient

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

CapabilitiesClient contains the methods for the Capabilities group. Don't use this type directly, use NewCapabilitiesClient() instead.

func NewCapabilitiesClient

func NewCapabilitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *CapabilitiesClient

NewCapabilitiesClient creates a new instance of CapabilitiesClient with the specified values. subscriptionID - The 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 (*CapabilitiesClient) ListByLocation

ListByLocation - Gets the subscription capabilities available for the specified location. If the operation fails it returns an *azcore.ResponseError type. locationName - The location name whose capabilities are retrieved. options - CapabilitiesClientListByLocationOptions contains the optional parameters for the CapabilitiesClient.ListByLocation method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LocationCapabilityListByLocation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewCapabilitiesClient("<subscription-id>", cred, nil)
	res, err := client.ListByLocation(ctx,
		"<location-name>",
		&armsql.CapabilitiesClientListByLocationOptions{Include: nil})
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.CapabilitiesClientListByLocationResult)
}
Output:

type CapabilitiesClientListByLocationOptions added in v0.3.0

type CapabilitiesClientListByLocationOptions struct {
	// If specified, restricts the response to only include the selected item.
	Include *CapabilityGroup
}

CapabilitiesClientListByLocationOptions contains the optional parameters for the CapabilitiesClient.ListByLocation method.

type CapabilitiesClientListByLocationResponse added in v0.3.0

type CapabilitiesClientListByLocationResponse struct {
	CapabilitiesClientListByLocationResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

CapabilitiesClientListByLocationResponse contains the response from method CapabilitiesClient.ListByLocation.

type CapabilitiesClientListByLocationResult added in v0.3.0

type CapabilitiesClientListByLocationResult struct {
	LocationCapabilities
}

CapabilitiesClientListByLocationResult contains the result from method CapabilitiesClient.ListByLocation.

type CapabilityGroup

type CapabilityGroup string
const (
	CapabilityGroupSupportedEditions                CapabilityGroup = "supportedEditions"
	CapabilityGroupSupportedElasticPoolEditions     CapabilityGroup = "supportedElasticPoolEditions"
	CapabilityGroupSupportedInstancePoolEditions    CapabilityGroup = "supportedInstancePoolEditions"
	CapabilityGroupSupportedManagedInstanceEditions CapabilityGroup = "supportedManagedInstanceEditions"
	CapabilityGroupSupportedManagedInstanceVersions CapabilityGroup = "supportedManagedInstanceVersions"
)

func PossibleCapabilityGroupValues

func PossibleCapabilityGroupValues() []CapabilityGroup

PossibleCapabilityGroupValues returns the possible values for the CapabilityGroup const type.

func (CapabilityGroup) ToPtr

func (c CapabilityGroup) ToPtr() *CapabilityGroup

ToPtr returns a *CapabilityGroup pointing to the current value.

type CapabilityStatus

type CapabilityStatus string

CapabilityStatus - The status of the capability.

const (
	CapabilityStatusVisible   CapabilityStatus = "Visible"
	CapabilityStatusAvailable CapabilityStatus = "Available"
	CapabilityStatusDefault   CapabilityStatus = "Default"
	CapabilityStatusDisabled  CapabilityStatus = "Disabled"
)

func PossibleCapabilityStatusValues

func PossibleCapabilityStatusValues() []CapabilityStatus

PossibleCapabilityStatusValues returns the possible values for the CapabilityStatus const type.

func (CapabilityStatus) ToPtr

ToPtr returns a *CapabilityStatus pointing to the current value.

type CatalogCollationType

type CatalogCollationType string

CatalogCollationType - Collation of the metadata catalog.

const (
	CatalogCollationTypeDATABASEDEFAULT         CatalogCollationType = "DATABASE_DEFAULT"
	CatalogCollationTypeSQLLatin1GeneralCP1CIAS CatalogCollationType = "SQL_Latin1_General_CP1_CI_AS"
)

func PossibleCatalogCollationTypeValues

func PossibleCatalogCollationTypeValues() []CatalogCollationType

PossibleCatalogCollationTypeValues returns the possible values for the CatalogCollationType const type.

func (CatalogCollationType) ToPtr

ToPtr returns a *CatalogCollationType pointing to the current value.

type CheckNameAvailabilityReason

type CheckNameAvailabilityReason string

CheckNameAvailabilityReason - The reason code explaining why the name is unavailable. Will be undefined if the name is available.

const (
	CheckNameAvailabilityReasonInvalid       CheckNameAvailabilityReason = "Invalid"
	CheckNameAvailabilityReasonAlreadyExists CheckNameAvailabilityReason = "AlreadyExists"
)

func PossibleCheckNameAvailabilityReasonValues

func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason

PossibleCheckNameAvailabilityReasonValues returns the possible values for the CheckNameAvailabilityReason const type.

func (CheckNameAvailabilityReason) ToPtr

ToPtr returns a *CheckNameAvailabilityReason pointing to the current value.

type CheckNameAvailabilityRequest

type CheckNameAvailabilityRequest struct {
	// REQUIRED
	Name *string `json:"name,omitempty"`

	// REQUIRED
	Type *string `json:"type,omitempty"`
}

CheckNameAvailabilityRequest - A request to check whether the specified name for a resource is available.

type CheckNameAvailabilityResponse

type CheckNameAvailabilityResponse struct {
	// READ-ONLY; True if the name is available, otherwise false.
	Available *bool `json:"available,omitempty" azure:"ro"`

	// READ-ONLY; A message explaining why the name is unavailable. Will be undefined if the name is available.
	Message *string `json:"message,omitempty" azure:"ro"`

	// READ-ONLY; The name whose availability was checked.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The reason code explaining why the name is unavailable. Will be undefined if the name is available.
	Reason *CheckNameAvailabilityReason `json:"reason,omitempty" azure:"ro"`
}

CheckNameAvailabilityResponse - The result of a name availability check.

type ColumnDataType

type ColumnDataType string

ColumnDataType - The column data type.

const (
	ColumnDataTypeBigint           ColumnDataType = "bigint"
	ColumnDataTypeBinary           ColumnDataType = "binary"
	ColumnDataTypeBit              ColumnDataType = "bit"
	ColumnDataTypeChar             ColumnDataType = "char"
	ColumnDataTypeDate             ColumnDataType = "date"
	ColumnDataTypeDatetime         ColumnDataType = "datetime"
	ColumnDataTypeDatetime2        ColumnDataType = "datetime2"
	ColumnDataTypeDatetimeoffset   ColumnDataType = "datetimeoffset"
	ColumnDataTypeDecimal          ColumnDataType = "decimal"
	ColumnDataTypeFloat            ColumnDataType = "float"
	ColumnDataTypeGeography        ColumnDataType = "geography"
	ColumnDataTypeGeometry         ColumnDataType = "geometry"
	ColumnDataTypeHierarchyid      ColumnDataType = "hierarchyid"
	ColumnDataTypeImage            ColumnDataType = "image"
	ColumnDataTypeInt              ColumnDataType = "int"
	ColumnDataTypeMoney            ColumnDataType = "money"
	ColumnDataTypeNchar            ColumnDataType = "nchar"
	ColumnDataTypeNtext            ColumnDataType = "ntext"
	ColumnDataTypeNumeric          ColumnDataType = "numeric"
	ColumnDataTypeNvarchar         ColumnDataType = "nvarchar"
	ColumnDataTypeReal             ColumnDataType = "real"
	ColumnDataTypeSQLVariant       ColumnDataType = "sql_variant"
	ColumnDataTypeSmalldatetime    ColumnDataType = "smalldatetime"
	ColumnDataTypeSmallint         ColumnDataType = "smallint"
	ColumnDataTypeSmallmoney       ColumnDataType = "smallmoney"
	ColumnDataTypeSysname          ColumnDataType = "sysname"
	ColumnDataTypeText             ColumnDataType = "text"
	ColumnDataTypeTime             ColumnDataType = "time"
	ColumnDataTypeTimestamp        ColumnDataType = "timestamp"
	ColumnDataTypeTinyint          ColumnDataType = "tinyint"
	ColumnDataTypeUniqueidentifier ColumnDataType = "uniqueidentifier"
	ColumnDataTypeVarbinary        ColumnDataType = "varbinary"
	ColumnDataTypeVarchar          ColumnDataType = "varchar"
	ColumnDataTypeXML              ColumnDataType = "xml"
)

func PossibleColumnDataTypeValues

func PossibleColumnDataTypeValues() []ColumnDataType

PossibleColumnDataTypeValues returns the possible values for the ColumnDataType const type.

func (ColumnDataType) ToPtr

func (c ColumnDataType) ToPtr() *ColumnDataType

ToPtr returns a *ColumnDataType pointing to the current value.

type CompleteDatabaseRestoreDefinition

type CompleteDatabaseRestoreDefinition struct {
	// REQUIRED; The last backup name to apply
	LastBackupName *string `json:"lastBackupName,omitempty"`
}

CompleteDatabaseRestoreDefinition - Contains the information necessary to perform a complete database restore operation.

type ConnectionPolicyName

type ConnectionPolicyName string
const (
	ConnectionPolicyNameDefault ConnectionPolicyName = "default"
)

func PossibleConnectionPolicyNameValues

func PossibleConnectionPolicyNameValues() []ConnectionPolicyName

PossibleConnectionPolicyNameValues returns the possible values for the ConnectionPolicyName const type.

func (ConnectionPolicyName) ToPtr

ToPtr returns a *ConnectionPolicyName pointing to the current value.

type CopyLongTermRetentionBackupParameters

type CopyLongTermRetentionBackupParameters struct {
	// Resource properties.
	Properties *CopyLongTermRetentionBackupParametersProperties `json:"properties,omitempty"`
}

CopyLongTermRetentionBackupParameters - Contains the information necessary to perform long term retention backup copy operation.

type CopyLongTermRetentionBackupParametersProperties

type CopyLongTermRetentionBackupParametersProperties struct {
	// The storage redundancy type of the copied backup
	TargetBackupStorageRedundancy *BackupStorageRedundancy `json:"targetBackupStorageRedundancy,omitempty"`

	// The name of the database owns the copied backup.
	TargetDatabaseName *string `json:"targetDatabaseName,omitempty"`

	// The resource group that owns the target server
	TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`

	// The fully qualified domain name of the target server
	TargetServerFullyQualifiedDomainName *string `json:"targetServerFullyQualifiedDomainName,omitempty"`

	// The resource Id of the target server that owns the database
	TargetServerResourceID *string `json:"targetServerResourceId,omitempty"`

	// The subscription that owns the target server
	TargetSubscriptionID *string `json:"targetSubscriptionId,omitempty"`
}

CopyLongTermRetentionBackupParametersProperties - Contains the properties to perform long term retention backup copy operation.

type CreateDatabaseRestorePointDefinition

type CreateDatabaseRestorePointDefinition struct {
	// REQUIRED; The restore point label to apply
	RestorePointLabel *string `json:"restorePointLabel,omitempty"`
}

CreateDatabaseRestorePointDefinition - Contains the information necessary to perform a create database restore point operation.

type CreateMode

type CreateMode string

CreateMode - Specifies the mode of database creation. Default: regular database creation. Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database. Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database. PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified. Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore. Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time. RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID. Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.

const (
	CreateModeCopy                           CreateMode = "Copy"
	CreateModeDefault                        CreateMode = "Default"
	CreateModeOnlineSecondary                CreateMode = "OnlineSecondary"
	CreateModePointInTimeRestore             CreateMode = "PointInTimeRestore"
	CreateModeRecovery                       CreateMode = "Recovery"
	CreateModeRestore                        CreateMode = "Restore"
	CreateModeRestoreExternalBackup          CreateMode = "RestoreExternalBackup"
	CreateModeRestoreExternalBackupSecondary CreateMode = "RestoreExternalBackupSecondary"
	CreateModeRestoreLongTermRetentionBackup CreateMode = "RestoreLongTermRetentionBackup"
	CreateModeSecondary                      CreateMode = "Secondary"
)

func PossibleCreateModeValues

func PossibleCreateModeValues() []CreateMode

PossibleCreateModeValues returns the possible values for the CreateMode const type.

func (CreateMode) ToPtr

func (c CreateMode) ToPtr() *CreateMode

ToPtr returns a *CreateMode pointing to the current value.

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.

func (CreatedByType) ToPtr

func (c CreatedByType) ToPtr() *CreatedByType

ToPtr returns a *CreatedByType pointing to the current value.

type DNSRefreshConfigurationProperties

type DNSRefreshConfigurationProperties struct {
	// READ-ONLY; The status of the DNS refresh operation.
	Status *DNSRefreshConfigurationPropertiesStatus `json:"status,omitempty" azure:"ro"`
}

DNSRefreshConfigurationProperties - DNS refresh configuration properties.

type DNSRefreshConfigurationPropertiesStatus

type DNSRefreshConfigurationPropertiesStatus string

DNSRefreshConfigurationPropertiesStatus - The status of the DNS refresh operation.

const (
	DNSRefreshConfigurationPropertiesStatusFailed    DNSRefreshConfigurationPropertiesStatus = "Failed"
	DNSRefreshConfigurationPropertiesStatusSucceeded DNSRefreshConfigurationPropertiesStatus = "Succeeded"
)

func PossibleDNSRefreshConfigurationPropertiesStatusValues

func PossibleDNSRefreshConfigurationPropertiesStatusValues() []DNSRefreshConfigurationPropertiesStatus

PossibleDNSRefreshConfigurationPropertiesStatusValues returns the possible values for the DNSRefreshConfigurationPropertiesStatus const type.

func (DNSRefreshConfigurationPropertiesStatus) ToPtr

ToPtr returns a *DNSRefreshConfigurationPropertiesStatus pointing to the current value.

type DataMaskingFunction

type DataMaskingFunction string

DataMaskingFunction - The masking function that is used for the data masking rule.

const (
	DataMaskingFunctionDefault DataMaskingFunction = "Default"
	DataMaskingFunctionCCN     DataMaskingFunction = "CCN"
	DataMaskingFunctionEmail   DataMaskingFunction = "Email"
	DataMaskingFunctionNumber  DataMaskingFunction = "Number"
	DataMaskingFunctionSSN     DataMaskingFunction = "SSN"
	DataMaskingFunctionText    DataMaskingFunction = "Text"
)

func PossibleDataMaskingFunctionValues

func PossibleDataMaskingFunctionValues() []DataMaskingFunction

PossibleDataMaskingFunctionValues returns the possible values for the DataMaskingFunction const type.

func (DataMaskingFunction) ToPtr

ToPtr returns a *DataMaskingFunction pointing to the current value.

type DataMaskingPoliciesClient

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

DataMaskingPoliciesClient contains the methods for the DataMaskingPolicies group. Don't use this type directly, use NewDataMaskingPoliciesClient() instead.

func NewDataMaskingPoliciesClient

func NewDataMaskingPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DataMaskingPoliciesClient

NewDataMaskingPoliciesClient creates a new instance of DataMaskingPoliciesClient with the specified values. subscriptionID - The 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 (*DataMaskingPoliciesClient) CreateOrUpdate

func (client *DataMaskingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DataMaskingPolicy, options *DataMaskingPoliciesClientCreateOrUpdateOptions) (DataMaskingPoliciesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates a database data masking policy If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. parameters - Parameters for creating or updating a data masking policy. options - DataMaskingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingPoliciesClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDataMaskingPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.DataMaskingPolicy{
			Properties: &armsql.DataMaskingPolicyProperties{
				DataMaskingState: armsql.DataMaskingStateEnabled.ToPtr(),
				ExemptPrincipals: to.StringPtr("<exempt-principals>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DataMaskingPoliciesClientCreateOrUpdateResult)
}
Output:

func (*DataMaskingPoliciesClient) Get

func (client *DataMaskingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DataMaskingPoliciesClientGetOptions) (DataMaskingPoliciesClientGetResponse, error)

Get - Gets a database data masking policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DataMaskingPoliciesClientGetOptions contains the optional parameters for the DataMaskingPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDataMaskingPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DataMaskingPoliciesClientGetResult)
}
Output:

type DataMaskingPoliciesClientCreateOrUpdateOptions added in v0.3.0

type DataMaskingPoliciesClientCreateOrUpdateOptions struct {
}

DataMaskingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingPoliciesClient.CreateOrUpdate method.

type DataMaskingPoliciesClientCreateOrUpdateResponse added in v0.3.0

type DataMaskingPoliciesClientCreateOrUpdateResponse struct {
	DataMaskingPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DataMaskingPoliciesClientCreateOrUpdateResponse contains the response from method DataMaskingPoliciesClient.CreateOrUpdate.

type DataMaskingPoliciesClientCreateOrUpdateResult added in v0.3.0

type DataMaskingPoliciesClientCreateOrUpdateResult struct {
	DataMaskingPolicy
}

DataMaskingPoliciesClientCreateOrUpdateResult contains the result from method DataMaskingPoliciesClient.CreateOrUpdate.

type DataMaskingPoliciesClientGetOptions added in v0.3.0

type DataMaskingPoliciesClientGetOptions struct {
}

DataMaskingPoliciesClientGetOptions contains the optional parameters for the DataMaskingPoliciesClient.Get method.

type DataMaskingPoliciesClientGetResponse added in v0.3.0

type DataMaskingPoliciesClientGetResponse struct {
	DataMaskingPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DataMaskingPoliciesClientGetResponse contains the response from method DataMaskingPoliciesClient.Get.

type DataMaskingPoliciesClientGetResult added in v0.3.0

type DataMaskingPoliciesClientGetResult struct {
	DataMaskingPolicy
}

DataMaskingPoliciesClientGetResult contains the result from method DataMaskingPoliciesClient.Get.

type DataMaskingPolicy

type DataMaskingPolicy struct {
	// The properties of the data masking policy.
	Properties *DataMaskingPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The kind of data masking policy. Metadata, used for Azure portal.
	Kind *string `json:"kind,omitempty" azure:"ro"`

	// READ-ONLY; The location of the data masking policy.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DataMaskingPolicy - Represents a database data masking policy.

type DataMaskingPolicyProperties

type DataMaskingPolicyProperties struct {
	// REQUIRED; The state of the data masking policy.
	DataMaskingState *DataMaskingState `json:"dataMaskingState,omitempty"`

	// The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking
	// policy does not apply. The specified users receive data results without masking
	// for all of the database queries.
	ExemptPrincipals *string `json:"exemptPrincipals,omitempty"`

	// READ-ONLY; The list of the application principals. This is a legacy parameter and is no longer used.
	ApplicationPrincipals *string `json:"applicationPrincipals,omitempty" azure:"ro"`

	// READ-ONLY; The masking level. This is a legacy parameter and is no longer used.
	MaskingLevel *string `json:"maskingLevel,omitempty" azure:"ro"`
}

DataMaskingPolicyProperties - The properties of a database data masking policy.

type DataMaskingRule

type DataMaskingRule struct {
	// The properties of the resource.
	Properties *DataMaskingRuleProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The kind of Data Masking Rule. Metadata, used for Azure portal.
	Kind *string `json:"kind,omitempty" azure:"ro"`

	// READ-ONLY; The location of the data masking rule.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DataMaskingRule - Represents a database data masking rule.

type DataMaskingRuleListResult

type DataMaskingRuleListResult struct {
	// The list of database data masking rules.
	Value []*DataMaskingRule `json:"value,omitempty"`
}

DataMaskingRuleListResult - The response to a list data masking rules request.

func (DataMaskingRuleListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DataMaskingRuleListResult.

type DataMaskingRuleProperties

type DataMaskingRuleProperties struct {
	// REQUIRED; The column name on which the data masking rule is applied.
	ColumnName *string `json:"columnName,omitempty"`

	// REQUIRED; The masking function that is used for the data masking rule.
	MaskingFunction *DataMaskingFunction `json:"maskingFunction,omitempty"`

	// REQUIRED; The schema name on which the data masking rule is applied.
	SchemaName *string `json:"schemaName,omitempty"`

	// REQUIRED; The table name on which the data masking rule is applied.
	TableName *string `json:"tableName,omitempty"`

	// The alias name. This is a legacy parameter and is no longer used.
	AliasName *string `json:"aliasName,omitempty"`

	// The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will
	// be ignored.
	NumberFrom *string `json:"numberFrom,omitempty"`

	// The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter
	// will be ignored.
	NumberTo *string `json:"numberTo,omitempty"`

	// If maskingFunction is set to Text, the number of characters to show unmasked in the beginning of the string. Otherwise,
	// this parameter will be ignored.
	PrefixSize *string `json:"prefixSize,omitempty"`

	// If maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter
	// will be ignored.
	ReplacementString *string `json:"replacementString,omitempty"`

	// The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction,
	// and specify ruleState as disabled. However, if the rule doesn't
	// already exist, the rule will be created with ruleState set to enabled, regardless of the provided value of ruleState.
	RuleState *DataMaskingRuleState `json:"ruleState,omitempty"`

	// If maskingFunction is set to Text, the number of characters to show unmasked at the end of the string. Otherwise, this
	// parameter will be ignored.
	SuffixSize *string `json:"suffixSize,omitempty"`

	// READ-ONLY; The rule Id.
	ID *string `json:"id,omitempty" azure:"ro"`
}

DataMaskingRuleProperties - The properties of a database data masking rule.

type DataMaskingRuleState

type DataMaskingRuleState string

DataMaskingRuleState - The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. However, if the rule doesn't already exist, the rule will be created with ruleState set to enabled, regardless of the provided value of ruleState.

const (
	DataMaskingRuleStateDisabled DataMaskingRuleState = "Disabled"
	DataMaskingRuleStateEnabled  DataMaskingRuleState = "Enabled"
)

func PossibleDataMaskingRuleStateValues

func PossibleDataMaskingRuleStateValues() []DataMaskingRuleState

PossibleDataMaskingRuleStateValues returns the possible values for the DataMaskingRuleState const type.

func (DataMaskingRuleState) ToPtr

ToPtr returns a *DataMaskingRuleState pointing to the current value.

type DataMaskingRulesClient

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

DataMaskingRulesClient contains the methods for the DataMaskingRules group. Don't use this type directly, use NewDataMaskingRulesClient() instead.

func NewDataMaskingRulesClient

func NewDataMaskingRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DataMaskingRulesClient

NewDataMaskingRulesClient creates a new instance of DataMaskingRulesClient with the specified values. subscriptionID - The 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 (*DataMaskingRulesClient) CreateOrUpdate

func (client *DataMaskingRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingRuleName string, parameters DataMaskingRule, options *DataMaskingRulesClientCreateOrUpdateOptions) (DataMaskingRulesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates a database data masking rule. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. dataMaskingRuleName - The name of the data masking rule. parameters - The required parameters for creating or updating a data masking rule. options - DataMaskingRulesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingRulesClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateDefaultMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDataMaskingRulesClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<data-masking-rule-name>",
		armsql.DataMaskingRule{
			Properties: &armsql.DataMaskingRuleProperties{
				AliasName:       to.StringPtr("<alias-name>"),
				ColumnName:      to.StringPtr("<column-name>"),
				MaskingFunction: armsql.DataMaskingFunctionDefault.ToPtr(),
				RuleState:       armsql.DataMaskingRuleStateEnabled.ToPtr(),
				SchemaName:      to.StringPtr("<schema-name>"),
				TableName:       to.StringPtr("<table-name>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DataMaskingRulesClientCreateOrUpdateResult)
}
Output:

func (*DataMaskingRulesClient) ListByDatabase

func (client *DataMaskingRulesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DataMaskingRulesClientListByDatabaseOptions) (DataMaskingRulesClientListByDatabaseResponse, error)

ListByDatabase - Gets a list of database data masking rules. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DataMaskingRulesClientListByDatabaseOptions contains the optional parameters for the DataMaskingRulesClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDataMaskingRulesClient("<subscription-id>", cred, nil)
	res, err := client.ListByDatabase(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DataMaskingRulesClientListByDatabaseResult)
}
Output:

type DataMaskingRulesClientCreateOrUpdateOptions added in v0.3.0

type DataMaskingRulesClientCreateOrUpdateOptions struct {
}

DataMaskingRulesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingRulesClient.CreateOrUpdate method.

type DataMaskingRulesClientCreateOrUpdateResponse added in v0.3.0

type DataMaskingRulesClientCreateOrUpdateResponse struct {
	DataMaskingRulesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DataMaskingRulesClientCreateOrUpdateResponse contains the response from method DataMaskingRulesClient.CreateOrUpdate.

type DataMaskingRulesClientCreateOrUpdateResult added in v0.3.0

type DataMaskingRulesClientCreateOrUpdateResult struct {
	DataMaskingRule
}

DataMaskingRulesClientCreateOrUpdateResult contains the result from method DataMaskingRulesClient.CreateOrUpdate.

type DataMaskingRulesClientListByDatabaseOptions added in v0.3.0

type DataMaskingRulesClientListByDatabaseOptions struct {
}

DataMaskingRulesClientListByDatabaseOptions contains the optional parameters for the DataMaskingRulesClient.ListByDatabase method.

type DataMaskingRulesClientListByDatabaseResponse added in v0.3.0

type DataMaskingRulesClientListByDatabaseResponse struct {
	DataMaskingRulesClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DataMaskingRulesClientListByDatabaseResponse contains the response from method DataMaskingRulesClient.ListByDatabase.

type DataMaskingRulesClientListByDatabaseResult added in v0.3.0

type DataMaskingRulesClientListByDatabaseResult struct {
	DataMaskingRuleListResult
}

DataMaskingRulesClientListByDatabaseResult contains the result from method DataMaskingRulesClient.ListByDatabase.

type DataMaskingState

type DataMaskingState string

DataMaskingState - The state of the data masking policy.

const (
	DataMaskingStateDisabled DataMaskingState = "Disabled"
	DataMaskingStateEnabled  DataMaskingState = "Enabled"
)

func PossibleDataMaskingStateValues

func PossibleDataMaskingStateValues() []DataMaskingState

PossibleDataMaskingStateValues returns the possible values for the DataMaskingState const type.

func (DataMaskingState) ToPtr

ToPtr returns a *DataMaskingState pointing to the current value.

type DataWarehouseUserActivities

type DataWarehouseUserActivities struct {
	// Resource properties.
	Properties *DataWarehouseUserActivitiesProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DataWarehouseUserActivities - User activities of a data warehouse

type DataWarehouseUserActivitiesClient

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

DataWarehouseUserActivitiesClient contains the methods for the DataWarehouseUserActivities group. Don't use this type directly, use NewDataWarehouseUserActivitiesClient() instead.

func NewDataWarehouseUserActivitiesClient

func NewDataWarehouseUserActivitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DataWarehouseUserActivitiesClient

NewDataWarehouseUserActivitiesClient creates a new instance of DataWarehouseUserActivitiesClient with the specified values. subscriptionID - The 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 (*DataWarehouseUserActivitiesClient) Get

func (client *DataWarehouseUserActivitiesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataWarehouseUserActivityName DataWarehouseUserActivityName, options *DataWarehouseUserActivitiesClientGetOptions) (DataWarehouseUserActivitiesClientGetResponse, error)

Get - Gets the user activities of a data warehouse which includes running and suspended queries If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. dataWarehouseUserActivityName - The activity name of the data warehouse. options - DataWarehouseUserActivitiesClientGetOptions contains the optional parameters for the DataWarehouseUserActivitiesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetDataWarehouseUserActivities.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDataWarehouseUserActivitiesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.DataWarehouseUserActivityName("current"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DataWarehouseUserActivitiesClientGetResult)
}
Output:

func (*DataWarehouseUserActivitiesClient) ListByDatabase

ListByDatabase - List the user activities of a data warehouse which includes running and suspended queries If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DataWarehouseUserActivitiesClientListByDatabaseOptions contains the optional parameters for the DataWarehouseUserActivitiesClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListDataWarehouseUserActivities.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDataWarehouseUserActivitiesClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type DataWarehouseUserActivitiesClientGetOptions added in v0.3.0

type DataWarehouseUserActivitiesClientGetOptions struct {
}

DataWarehouseUserActivitiesClientGetOptions contains the optional parameters for the DataWarehouseUserActivitiesClient.Get method.

type DataWarehouseUserActivitiesClientGetResponse added in v0.3.0

type DataWarehouseUserActivitiesClientGetResponse struct {
	DataWarehouseUserActivitiesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DataWarehouseUserActivitiesClientGetResponse contains the response from method DataWarehouseUserActivitiesClient.Get.

type DataWarehouseUserActivitiesClientGetResult added in v0.3.0

type DataWarehouseUserActivitiesClientGetResult struct {
	DataWarehouseUserActivities
}

DataWarehouseUserActivitiesClientGetResult contains the result from method DataWarehouseUserActivitiesClient.Get.

type DataWarehouseUserActivitiesClientListByDatabaseOptions added in v0.3.0

type DataWarehouseUserActivitiesClientListByDatabaseOptions struct {
}

DataWarehouseUserActivitiesClientListByDatabaseOptions contains the optional parameters for the DataWarehouseUserActivitiesClient.ListByDatabase method.

type DataWarehouseUserActivitiesClientListByDatabasePager added in v0.3.0

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

DataWarehouseUserActivitiesClientListByDatabasePager provides operations for iterating over paged responses.

func (*DataWarehouseUserActivitiesClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DataWarehouseUserActivitiesClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DataWarehouseUserActivitiesClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current DataWarehouseUserActivitiesClientListByDatabaseResponse page.

type DataWarehouseUserActivitiesClientListByDatabaseResponse added in v0.3.0

type DataWarehouseUserActivitiesClientListByDatabaseResponse struct {
	DataWarehouseUserActivitiesClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DataWarehouseUserActivitiesClientListByDatabaseResponse contains the response from method DataWarehouseUserActivitiesClient.ListByDatabase.

type DataWarehouseUserActivitiesClientListByDatabaseResult added in v0.3.0

type DataWarehouseUserActivitiesClientListByDatabaseResult struct {
	DataWarehouseUserActivitiesListResult
}

DataWarehouseUserActivitiesClientListByDatabaseResult contains the result from method DataWarehouseUserActivitiesClient.ListByDatabase.

type DataWarehouseUserActivitiesListResult

type DataWarehouseUserActivitiesListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*DataWarehouseUserActivities `json:"value,omitempty" azure:"ro"`
}

DataWarehouseUserActivitiesListResult - User activities of a data warehouse

func (DataWarehouseUserActivitiesListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DataWarehouseUserActivitiesListResult.

type DataWarehouseUserActivitiesProperties

type DataWarehouseUserActivitiesProperties struct {
	// READ-ONLY; Count of running and suspended queries.
	ActiveQueriesCount *int32 `json:"activeQueriesCount,omitempty" azure:"ro"`
}

DataWarehouseUserActivitiesProperties - User activities of a data warehouse. This currently includes the count of running or suspended queries. For more information, please view the sys.dmpdwexec_requests dynamic management view (DMV).

type DataWarehouseUserActivityName

type DataWarehouseUserActivityName string
const (
	DataWarehouseUserActivityNameCurrent DataWarehouseUserActivityName = "current"
)

func PossibleDataWarehouseUserActivityNameValues

func PossibleDataWarehouseUserActivityNameValues() []DataWarehouseUserActivityName

PossibleDataWarehouseUserActivityNameValues returns the possible values for the DataWarehouseUserActivityName const type.

func (DataWarehouseUserActivityName) ToPtr

ToPtr returns a *DataWarehouseUserActivityName pointing to the current value.

type Database

type Database struct {
	// REQUIRED; Resource location.
	Location *string `json:"location,omitempty"`

	// The Azure Active Directory identity of the database.
	Identity *DatabaseIdentity `json:"identity,omitempty"`

	// Resource properties.
	Properties *DatabaseProperties `json:"properties,omitempty"`

	// The database SKU.
	// The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family,
	// and capacity) that are available to your subscription in an Azure region,
	// use the Capabilities_ListByLocation REST API or one of the following commands:
	// az sql db list-editions -l <location> -o table
	// `
	// Get-AzSqlServerServiceObjective -Location <location>
	// `
	SKU *SKU `json:"sku,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Kind of database. This is metadata used for the Azure portal experience.
	Kind *string `json:"kind,omitempty" azure:"ro"`

	// READ-ONLY; Resource that manages the database.
	ManagedBy *string `json:"managedBy,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

Database - A database resource.

func (Database) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Database.

type DatabaseAdvisorsClient

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

DatabaseAdvisorsClient contains the methods for the DatabaseAdvisors group. Don't use this type directly, use NewDatabaseAdvisorsClient() instead.

func NewDatabaseAdvisorsClient

func NewDatabaseAdvisorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DatabaseAdvisorsClient

NewDatabaseAdvisorsClient creates a new instance of DatabaseAdvisorsClient with the specified values. subscriptionID - The 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 (*DatabaseAdvisorsClient) Get

func (client *DatabaseAdvisorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, options *DatabaseAdvisorsClientGetOptions) (DatabaseAdvisorsClientGetResponse, error)

Get - Gets a database advisor. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. advisorName - The name of the Database Advisor. options - DatabaseAdvisorsClientGetOptions contains the optional parameters for the DatabaseAdvisorsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseAdvisorsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<advisor-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseAdvisorsClientGetResult)
}
Output:

func (*DatabaseAdvisorsClient) ListByDatabase

func (client *DatabaseAdvisorsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabaseAdvisorsClientListByDatabaseOptions) (DatabaseAdvisorsClientListByDatabaseResponse, error)

ListByDatabase - Gets a list of database advisors. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DatabaseAdvisorsClientListByDatabaseOptions contains the optional parameters for the DatabaseAdvisorsClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseAdvisorsClient("<subscription-id>", cred, nil)
	res, err := client.ListByDatabase(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		&armsql.DatabaseAdvisorsClientListByDatabaseOptions{Expand: nil})
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseAdvisorsClientListByDatabaseResult)
}
Output:

func (*DatabaseAdvisorsClient) Update

func (client *DatabaseAdvisorsClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, parameters Advisor, options *DatabaseAdvisorsClientUpdateOptions) (DatabaseAdvisorsClientUpdateResponse, error)

Update - Updates a database advisor. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. advisorName - The name of the Database Advisor. parameters - The requested advisor resource state. options - DatabaseAdvisorsClientUpdateOptions contains the optional parameters for the DatabaseAdvisorsClient.Update method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseAdvisorsClient("<subscription-id>", cred, nil)
	res, err := client.Update(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<advisor-name>",
		armsql.Advisor{
			Properties: &armsql.AdvisorProperties{
				AutoExecuteStatus: armsql.AutoExecuteStatusDisabled.ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseAdvisorsClientUpdateResult)
}
Output:

type DatabaseAdvisorsClientGetOptions added in v0.3.0

type DatabaseAdvisorsClientGetOptions struct {
}

DatabaseAdvisorsClientGetOptions contains the optional parameters for the DatabaseAdvisorsClient.Get method.

type DatabaseAdvisorsClientGetResponse added in v0.3.0

type DatabaseAdvisorsClientGetResponse struct {
	DatabaseAdvisorsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseAdvisorsClientGetResponse contains the response from method DatabaseAdvisorsClient.Get.

type DatabaseAdvisorsClientGetResult added in v0.3.0

type DatabaseAdvisorsClientGetResult struct {
	Advisor
}

DatabaseAdvisorsClientGetResult contains the result from method DatabaseAdvisorsClient.Get.

type DatabaseAdvisorsClientListByDatabaseOptions added in v0.3.0

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

DatabaseAdvisorsClientListByDatabaseOptions contains the optional parameters for the DatabaseAdvisorsClient.ListByDatabase method.

type DatabaseAdvisorsClientListByDatabaseResponse added in v0.3.0

type DatabaseAdvisorsClientListByDatabaseResponse struct {
	DatabaseAdvisorsClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseAdvisorsClientListByDatabaseResponse contains the response from method DatabaseAdvisorsClient.ListByDatabase.

type DatabaseAdvisorsClientListByDatabaseResult added in v0.3.0

type DatabaseAdvisorsClientListByDatabaseResult struct {
	// Array of Advisor
	AdvisorArray []*Advisor
}

DatabaseAdvisorsClientListByDatabaseResult contains the result from method DatabaseAdvisorsClient.ListByDatabase.

type DatabaseAdvisorsClientUpdateOptions added in v0.3.0

type DatabaseAdvisorsClientUpdateOptions struct {
}

DatabaseAdvisorsClientUpdateOptions contains the optional parameters for the DatabaseAdvisorsClient.Update method.

type DatabaseAdvisorsClientUpdateResponse added in v0.3.0

type DatabaseAdvisorsClientUpdateResponse struct {
	DatabaseAdvisorsClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseAdvisorsClientUpdateResponse contains the response from method DatabaseAdvisorsClient.Update.

type DatabaseAdvisorsClientUpdateResult added in v0.3.0

type DatabaseAdvisorsClientUpdateResult struct {
	Advisor
}

DatabaseAdvisorsClientUpdateResult contains the result from method DatabaseAdvisorsClient.Update.

type DatabaseAutomaticTuning

type DatabaseAutomaticTuning struct {
	// Resource properties.
	Properties *DatabaseAutomaticTuningProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DatabaseAutomaticTuning - Database-level Automatic Tuning.

func (DatabaseAutomaticTuning) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseAutomaticTuning.

type DatabaseAutomaticTuningClient

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

DatabaseAutomaticTuningClient contains the methods for the DatabaseAutomaticTuning group. Don't use this type directly, use NewDatabaseAutomaticTuningClient() instead.

func NewDatabaseAutomaticTuningClient

func NewDatabaseAutomaticTuningClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DatabaseAutomaticTuningClient

NewDatabaseAutomaticTuningClient creates a new instance of DatabaseAutomaticTuningClient with the specified values. subscriptionID - The 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 (*DatabaseAutomaticTuningClient) Get

Get - Gets a database's automatic tuning. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DatabaseAutomaticTuningClientGetOptions contains the optional parameters for the DatabaseAutomaticTuningClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseAutomaticTuningClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseAutomaticTuningClientGetResult)
}
Output:

func (*DatabaseAutomaticTuningClient) Update

Update - Update automatic tuning properties for target database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. parameters - The requested automatic tuning resource state. options - DatabaseAutomaticTuningClientUpdateOptions contains the optional parameters for the DatabaseAutomaticTuningClient.Update method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningUpdateMax.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseAutomaticTuningClient("<subscription-id>", cred, nil)
	res, err := client.Update(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.DatabaseAutomaticTuning{
			Properties: &armsql.DatabaseAutomaticTuningProperties{
				DesiredState: armsql.AutomaticTuningModeAuto.ToPtr(),
				Options: map[string]*armsql.AutomaticTuningOptions{
					"createIndex": {
						DesiredState: armsql.AutomaticTuningOptionModeDesiredOff.ToPtr(),
					},
					"dropIndex": {
						DesiredState: armsql.AutomaticTuningOptionModeDesiredOn.ToPtr(),
					},
					"forceLastGoodPlan": {
						DesiredState: armsql.AutomaticTuningOptionModeDesiredDefault.ToPtr(),
					},
				},
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseAutomaticTuningClientUpdateResult)
}
Output:

type DatabaseAutomaticTuningClientGetOptions added in v0.3.0

type DatabaseAutomaticTuningClientGetOptions struct {
}

DatabaseAutomaticTuningClientGetOptions contains the optional parameters for the DatabaseAutomaticTuningClient.Get method.

type DatabaseAutomaticTuningClientGetResponse added in v0.3.0

type DatabaseAutomaticTuningClientGetResponse struct {
	DatabaseAutomaticTuningClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseAutomaticTuningClientGetResponse contains the response from method DatabaseAutomaticTuningClient.Get.

type DatabaseAutomaticTuningClientGetResult added in v0.3.0

type DatabaseAutomaticTuningClientGetResult struct {
	DatabaseAutomaticTuning
}

DatabaseAutomaticTuningClientGetResult contains the result from method DatabaseAutomaticTuningClient.Get.

type DatabaseAutomaticTuningClientUpdateOptions added in v0.3.0

type DatabaseAutomaticTuningClientUpdateOptions struct {
}

DatabaseAutomaticTuningClientUpdateOptions contains the optional parameters for the DatabaseAutomaticTuningClient.Update method.

type DatabaseAutomaticTuningClientUpdateResponse added in v0.3.0

type DatabaseAutomaticTuningClientUpdateResponse struct {
	DatabaseAutomaticTuningClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseAutomaticTuningClientUpdateResponse contains the response from method DatabaseAutomaticTuningClient.Update.

type DatabaseAutomaticTuningClientUpdateResult added in v0.3.0

type DatabaseAutomaticTuningClientUpdateResult struct {
	DatabaseAutomaticTuning
}

DatabaseAutomaticTuningClientUpdateResult contains the result from method DatabaseAutomaticTuningClient.Update.

type DatabaseAutomaticTuningProperties

type DatabaseAutomaticTuningProperties struct {
	// Automatic tuning desired state.
	DesiredState *AutomaticTuningMode `json:"desiredState,omitempty"`

	// Automatic tuning options definition.
	Options map[string]*AutomaticTuningOptions `json:"options,omitempty"`

	// READ-ONLY; Automatic tuning actual state.
	ActualState *AutomaticTuningMode `json:"actualState,omitempty" azure:"ro"`
}

DatabaseAutomaticTuningProperties - Database-level Automatic Tuning properties.

func (DatabaseAutomaticTuningProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseAutomaticTuningProperties.

type DatabaseBlobAuditingPoliciesClient

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

DatabaseBlobAuditingPoliciesClient contains the methods for the DatabaseBlobAuditingPolicies group. Don't use this type directly, use NewDatabaseBlobAuditingPoliciesClient() instead.

func NewDatabaseBlobAuditingPoliciesClient

func NewDatabaseBlobAuditingPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DatabaseBlobAuditingPoliciesClient

NewDatabaseBlobAuditingPoliciesClient creates a new instance of DatabaseBlobAuditingPoliciesClient with the specified values. subscriptionID - The 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 (*DatabaseBlobAuditingPoliciesClient) CreateOrUpdate

CreateOrUpdate - Creates or updates a database's blob auditing policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. parameters - The database blob auditing policy. options - DatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAzureMonitorAuditingCreateMin.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseBlobAuditingPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.DatabaseBlobAuditingPolicy{
			Properties: &armsql.DatabaseBlobAuditingPolicyProperties{
				IsAzureMonitorTargetEnabled: to.BoolPtr(true),
				State:                       armsql.BlobAuditingPolicyStateEnabled.ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseBlobAuditingPoliciesClientCreateOrUpdateResult)
}
Output:

func (*DatabaseBlobAuditingPoliciesClient) Get

Get - Gets a database's blob auditing policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DatabaseBlobAuditingPoliciesClientGetOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseBlobAuditingGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseBlobAuditingPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseBlobAuditingPoliciesClientGetResult)
}
Output:

func (*DatabaseBlobAuditingPoliciesClient) ListByDatabase

ListByDatabase - Lists auditing settings of a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAuditingSettingsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseBlobAuditingPoliciesClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type DatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions added in v0.3.0

type DatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions struct {
}

DatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.CreateOrUpdate method.

type DatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse added in v0.3.0

type DatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse struct {
	DatabaseBlobAuditingPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse contains the response from method DatabaseBlobAuditingPoliciesClient.CreateOrUpdate.

type DatabaseBlobAuditingPoliciesClientCreateOrUpdateResult added in v0.3.0

type DatabaseBlobAuditingPoliciesClientCreateOrUpdateResult struct {
	DatabaseBlobAuditingPolicy
}

DatabaseBlobAuditingPoliciesClientCreateOrUpdateResult contains the result from method DatabaseBlobAuditingPoliciesClient.CreateOrUpdate.

type DatabaseBlobAuditingPoliciesClientGetOptions added in v0.3.0

type DatabaseBlobAuditingPoliciesClientGetOptions struct {
}

DatabaseBlobAuditingPoliciesClientGetOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.Get method.

type DatabaseBlobAuditingPoliciesClientGetResponse added in v0.3.0

type DatabaseBlobAuditingPoliciesClientGetResponse struct {
	DatabaseBlobAuditingPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseBlobAuditingPoliciesClientGetResponse contains the response from method DatabaseBlobAuditingPoliciesClient.Get.

type DatabaseBlobAuditingPoliciesClientGetResult added in v0.3.0

type DatabaseBlobAuditingPoliciesClientGetResult struct {
	DatabaseBlobAuditingPolicy
}

DatabaseBlobAuditingPoliciesClientGetResult contains the result from method DatabaseBlobAuditingPoliciesClient.Get.

type DatabaseBlobAuditingPoliciesClientListByDatabaseOptions added in v0.3.0

type DatabaseBlobAuditingPoliciesClientListByDatabaseOptions struct {
}

DatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.ListByDatabase method.

type DatabaseBlobAuditingPoliciesClientListByDatabasePager added in v0.3.0

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

DatabaseBlobAuditingPoliciesClientListByDatabasePager provides operations for iterating over paged responses.

func (*DatabaseBlobAuditingPoliciesClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DatabaseBlobAuditingPoliciesClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DatabaseBlobAuditingPoliciesClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current DatabaseBlobAuditingPoliciesClientListByDatabaseResponse page.

type DatabaseBlobAuditingPoliciesClientListByDatabaseResponse added in v0.3.0

type DatabaseBlobAuditingPoliciesClientListByDatabaseResponse struct {
	DatabaseBlobAuditingPoliciesClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseBlobAuditingPoliciesClientListByDatabaseResponse contains the response from method DatabaseBlobAuditingPoliciesClient.ListByDatabase.

type DatabaseBlobAuditingPoliciesClientListByDatabaseResult added in v0.3.0

type DatabaseBlobAuditingPoliciesClientListByDatabaseResult struct {
	DatabaseBlobAuditingPolicyListResult
}

DatabaseBlobAuditingPoliciesClientListByDatabaseResult contains the result from method DatabaseBlobAuditingPoliciesClient.ListByDatabase.

type DatabaseBlobAuditingPolicy

type DatabaseBlobAuditingPolicy struct {
	// Resource properties.
	Properties *DatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource kind.
	Kind *string `json:"kind,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DatabaseBlobAuditingPolicy - A database blob auditing policy.

type DatabaseBlobAuditingPolicyListResult

type DatabaseBlobAuditingPolicyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*DatabaseBlobAuditingPolicy `json:"value,omitempty" azure:"ro"`
}

DatabaseBlobAuditingPolicyListResult - A list of database auditing settings.

func (DatabaseBlobAuditingPolicyListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseBlobAuditingPolicyListResult.

type DatabaseBlobAuditingPolicyProperties

type DatabaseBlobAuditingPolicyProperties struct {
	// REQUIRED; Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
	State *BlobAuditingPolicyState `json:"state,omitempty"`

	// Specifies the Actions-Groups and Actions to audit.
	// The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures
	// executed against the database, as well as successful and failed logins:
	// BATCHCOMPLETEDGROUP, SUCCESSFULDATABASEAUTHENTICATIONGROUP, FAILEDDATABASEAUTHENTICATIONGROUP.
	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
	// The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary
	// groups could lead to very large quantities of audit records):
	// APPLICATIONROLECHANGEPASSWORDGROUP BACKUPRESTOREGROUP DATABASELOGOUTGROUP DATABASEOBJECTCHANGEGROUP DATABASEOBJECTOWNERSHIPCHANGEGROUP
	// DATABASEOBJECTPERMISSIONCHANGEGROUP DATABASEOPERATIONGROUP
	// DATABASEPERMISSIONCHANGEGROUP DATABASEPRINCIPALCHANGEGROUP DATABASEPRINCIPALIMPERSONATIONGROUP DATABASEROLEMEMBERCHANGEGROUP
	// FAILEDDATABASEAUTHENTICATIONGROUP SCHEMAOBJECTACCESSGROUP SCHEMAOBJECT
	// CHANGEGROUP SCHEMAOBJECTOWNERSHIPCHANGEGROUP SCHEMAOBJECTPERMISSIONCHANGEGROUP SUCCESSFULDATABASEAUTHENTICATIONGROUP USERCHANGEPASSWORDGROUP
	// BATCHSTARTEDGROUP BATCHCOMPLETED_GROUP
	// These are groups that cover all sql statements and stored procedures executed against the database, and should not be used
	// in combination with other groups as this will result in duplicate audit logs.
	// For more information, see Database-Level Audit Action Groups
	// [https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups].
	// For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server
	// auditing policy). The supported actions to audit are: SELECT UPDATE INSERT DELETE
	// EXECUTE RECEIVE REFERENCES
	// The general form for defining an action to be audited is: {action} ON {object} BY {principal}
	// Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or
	// schema. For the latter cases, the forms DATABASE::{dbname} and SCHEMA::{schema
	// name} are used, respectively.
	// For example: SELECT on dbo.myTable by public SELECT on DATABASE::myDatabase by public SELECT on SCHEMA::mySchema by public
	// For more information, see Database-Level Audit Actions
	// [https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions]
	AuditActionsAndGroups []*string `json:"auditActionsAndGroups,omitempty"`

	// Specifies whether audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify 'State'
	// as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on
	// the database should be also created. Note that for server level audit you
	// should use the 'master' database as {databaseName}.
	// Diagnostic Settings URI format: PUT
	// https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
	// For more information, see Diagnostic Settings REST API [https://go.microsoft.com/fwlink/?linkid=2033207]or Diagnostic Settings
	// PowerShell [https://go.microsoft.com/fwlink/?linkid=2033043]
	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`

	// Specifies whether storageAccountAccessKey value is the storage's secondary key.
	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`

	// Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. The default
	// minimum value is 1000 (1 second). The maximum is 2,147,483,647.
	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`

	// Specifies the number of days to keep in the audit logs in the storage account.
	RetentionDays *int32 `json:"retentionDays,omitempty"`

	// Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, not
	// specifying the storageAccountAccessKey will use SQL server system-assigned
	// managed identity to access the storage. Prerequisites for using managed identity authentication:
	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server
	// identity. For more information, see Auditing to storage using Managed
	// Identity authentication [https://go.microsoft.com/fwlink/?linkid=2114355]
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`

	// Specifies the blob storage subscription Id.
	StorageAccountSubscriptionID *string `json:"storageAccountSubscriptionId,omitempty"`

	// Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint
	// or isAzureMonitorTargetEnabled is required.
	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
}

DatabaseBlobAuditingPolicyProperties - Properties of a database blob auditing policy.

func (DatabaseBlobAuditingPolicyProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseBlobAuditingPolicyProperties.

type DatabaseColumn

type DatabaseColumn struct {
	// Resource properties.
	Properties *DatabaseColumnProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DatabaseColumn - A database column resource.

type DatabaseColumnListResult

type DatabaseColumnListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*DatabaseColumn `json:"value,omitempty" azure:"ro"`
}

DatabaseColumnListResult - A list of database columns.

func (DatabaseColumnListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseColumnListResult.

type DatabaseColumnProperties

type DatabaseColumnProperties struct {
	// The column data type.
	ColumnType *ColumnDataType `json:"columnType,omitempty"`

	// Whether or not the column is computed.
	IsComputed *bool `json:"isComputed,omitempty"`

	// Whether or not the column belongs to a memory optimized table.
	MemoryOptimized *bool `json:"memoryOptimized,omitempty"`

	// The table temporal type.
	TemporalType *TableTemporalType `json:"temporalType,omitempty"`
}

DatabaseColumnProperties - Database column properties.

type DatabaseColumnsClient

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

DatabaseColumnsClient contains the methods for the DatabaseColumns group. Don't use this type directly, use NewDatabaseColumnsClient() instead.

func NewDatabaseColumnsClient

func NewDatabaseColumnsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DatabaseColumnsClient

NewDatabaseColumnsClient creates a new instance of DatabaseColumnsClient with the specified values. subscriptionID - The 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 (*DatabaseColumnsClient) Get

func (client *DatabaseColumnsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, options *DatabaseColumnsClientGetOptions) (DatabaseColumnsClientGetResponse, error)

Get - Get database column If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. columnName - The name of the column. options - DatabaseColumnsClientGetOptions contains the optional parameters for the DatabaseColumnsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseColumnsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		"<column-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseColumnsClientGetResult)
}
Output:

func (*DatabaseColumnsClient) ListByDatabase

func (client *DatabaseColumnsClient) ListByDatabase(resourceGroupName string, serverName string, databaseName string, options *DatabaseColumnsClientListByDatabaseOptions) *DatabaseColumnsClientListByDatabasePager

ListByDatabase - List database columns If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the DatabaseColumnsClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMax.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseColumnsClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		&armsql.DatabaseColumnsClientListByDatabaseOptions{Schema: []string{
			"dbo"},
			Table: []string{
				"customer",
				"address"},
			Column: []string{
				"username"},
			OrderBy: []string{
				"schema asc",
				"table",
				"column desc"},
			Skiptoken: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*DatabaseColumnsClient) ListByTable

func (client *DatabaseColumnsClient) ListByTable(resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, options *DatabaseColumnsClientListByTableOptions) *DatabaseColumnsClientListByTablePager

ListByTable - List database columns If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. options - DatabaseColumnsClientListByTableOptions contains the optional parameters for the DatabaseColumnsClient.ListByTable method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnListByTable.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseColumnsClient("<subscription-id>", cred, nil)
	pager := client.ListByTable("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		&armsql.DatabaseColumnsClientListByTableOptions{Filter: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type DatabaseColumnsClientGetOptions added in v0.3.0

type DatabaseColumnsClientGetOptions struct {
}

DatabaseColumnsClientGetOptions contains the optional parameters for the DatabaseColumnsClient.Get method.

type DatabaseColumnsClientGetResponse added in v0.3.0

type DatabaseColumnsClientGetResponse struct {
	DatabaseColumnsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseColumnsClientGetResponse contains the response from method DatabaseColumnsClient.Get.

type DatabaseColumnsClientGetResult added in v0.3.0

type DatabaseColumnsClientGetResult struct {
	DatabaseColumn
}

DatabaseColumnsClientGetResult contains the result from method DatabaseColumnsClient.Get.

type DatabaseColumnsClientListByDatabaseOptions added in v0.3.0

type DatabaseColumnsClientListByDatabaseOptions struct {
	Column  []string
	OrderBy []string
	Schema  []string
	// An opaque token that identifies a starting point in the collection.
	Skiptoken *string
	Table     []string
}

DatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the DatabaseColumnsClient.ListByDatabase method.

type DatabaseColumnsClientListByDatabasePager added in v0.3.0

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

DatabaseColumnsClientListByDatabasePager provides operations for iterating over paged responses.

func (*DatabaseColumnsClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DatabaseColumnsClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DatabaseColumnsClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current DatabaseColumnsClientListByDatabaseResponse page.

type DatabaseColumnsClientListByDatabaseResponse added in v0.3.0

type DatabaseColumnsClientListByDatabaseResponse struct {
	DatabaseColumnsClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseColumnsClientListByDatabaseResponse contains the response from method DatabaseColumnsClient.ListByDatabase.

type DatabaseColumnsClientListByDatabaseResult added in v0.3.0

type DatabaseColumnsClientListByDatabaseResult struct {
	DatabaseColumnListResult
}

DatabaseColumnsClientListByDatabaseResult contains the result from method DatabaseColumnsClient.ListByDatabase.

type DatabaseColumnsClientListByTableOptions added in v0.3.0

type DatabaseColumnsClientListByTableOptions struct {
	// An OData filter expression that filters elements in the collection.
	Filter *string
}

DatabaseColumnsClientListByTableOptions contains the optional parameters for the DatabaseColumnsClient.ListByTable method.

type DatabaseColumnsClientListByTablePager added in v0.3.0

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

DatabaseColumnsClientListByTablePager provides operations for iterating over paged responses.

func (*DatabaseColumnsClientListByTablePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DatabaseColumnsClientListByTablePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DatabaseColumnsClientListByTablePager) PageResponse added in v0.3.0

PageResponse returns the current DatabaseColumnsClientListByTableResponse page.

type DatabaseColumnsClientListByTableResponse added in v0.3.0

type DatabaseColumnsClientListByTableResponse struct {
	DatabaseColumnsClientListByTableResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseColumnsClientListByTableResponse contains the response from method DatabaseColumnsClient.ListByTable.

type DatabaseColumnsClientListByTableResult added in v0.3.0

type DatabaseColumnsClientListByTableResult struct {
	DatabaseColumnListResult
}

DatabaseColumnsClientListByTableResult contains the result from method DatabaseColumnsClient.ListByTable.

type DatabaseExtensions

type DatabaseExtensions struct {
	// Resource properties.
	Properties *DatabaseExtensionsProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DatabaseExtensions - An export managed database operation result resource.

type DatabaseExtensionsClient

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

DatabaseExtensionsClient contains the methods for the DatabaseExtensions group. Don't use this type directly, use NewDatabaseExtensionsClient() instead.

func NewDatabaseExtensionsClient

func NewDatabaseExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DatabaseExtensionsClient

NewDatabaseExtensionsClient creates a new instance of DatabaseExtensionsClient with the specified values. subscriptionID - The 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 (*DatabaseExtensionsClient) BeginCreateOrUpdate

func (client *DatabaseExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, extensionName string, parameters DatabaseExtensions, options *DatabaseExtensionsClientBeginCreateOrUpdateOptions) (DatabaseExtensionsClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Perform a database extension operation, like polybase import If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. parameters - The database import request parameters. options - DatabaseExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabaseExtensionsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CreateOrUpdateDatabaseExtensions.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseExtensionsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<extension-name>",
		armsql.DatabaseExtensions{
			Properties: &armsql.DatabaseExtensionsProperties{
				OperationMode:  armsql.OperationMode("PolybaseImport").ToPtr(),
				StorageKey:     to.StringPtr("<storage-key>"),
				StorageKeyType: armsql.StorageKeyType("StorageAccessKey").ToPtr(),
				StorageURI:     to.StringPtr("<storage-uri>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseExtensionsClientCreateOrUpdateResult)
}
Output:

func (*DatabaseExtensionsClient) Get

func (client *DatabaseExtensionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, extensionName string, options *DatabaseExtensionsClientGetOptions) (DatabaseExtensionsClientGetResponse, error)

Get - Gets a database extension. This will return resource not found as it is not supported. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DatabaseExtensionsClientGetOptions contains the optional parameters for the DatabaseExtensionsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseExtensions.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseExtensionsClient("<subscription-id>", cred, nil)
	_, err = client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<extension-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*DatabaseExtensionsClient) ListByDatabase

func (client *DatabaseExtensionsClient) ListByDatabase(resourceGroupName string, serverName string, databaseName string, options *DatabaseExtensionsClientListByDatabaseOptions) *DatabaseExtensionsClientListByDatabasePager

ListByDatabase - List database extension. This will return an empty list as it is not supported. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DatabaseExtensionsClientListByDatabaseOptions contains the optional parameters for the DatabaseExtensionsClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseExtensions.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseExtensionsClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type DatabaseExtensionsClientBeginCreateOrUpdateOptions added in v0.3.0

type DatabaseExtensionsClientBeginCreateOrUpdateOptions struct {
}

DatabaseExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabaseExtensionsClient.BeginCreateOrUpdate method.

type DatabaseExtensionsClientCreateOrUpdatePoller added in v0.3.0

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

DatabaseExtensionsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*DatabaseExtensionsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*DatabaseExtensionsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final DatabaseExtensionsClientCreateOrUpdateResponse will be returned.

func (*DatabaseExtensionsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*DatabaseExtensionsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type DatabaseExtensionsClientCreateOrUpdatePollerResponse added in v0.3.0

type DatabaseExtensionsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *DatabaseExtensionsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseExtensionsClientCreateOrUpdatePollerResponse contains the response from method DatabaseExtensionsClient.CreateOrUpdate.

func (DatabaseExtensionsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*DatabaseExtensionsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a DatabaseExtensionsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type DatabaseExtensionsClientCreateOrUpdateResponse added in v0.3.0

type DatabaseExtensionsClientCreateOrUpdateResponse struct {
	DatabaseExtensionsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseExtensionsClientCreateOrUpdateResponse contains the response from method DatabaseExtensionsClient.CreateOrUpdate.

type DatabaseExtensionsClientCreateOrUpdateResult added in v0.3.0

type DatabaseExtensionsClientCreateOrUpdateResult struct {
	ImportExportExtensionsOperationResult
}

DatabaseExtensionsClientCreateOrUpdateResult contains the result from method DatabaseExtensionsClient.CreateOrUpdate.

type DatabaseExtensionsClientGetOptions added in v0.3.0

type DatabaseExtensionsClientGetOptions struct {
}

DatabaseExtensionsClientGetOptions contains the optional parameters for the DatabaseExtensionsClient.Get method.

type DatabaseExtensionsClientGetResponse added in v0.3.0

type DatabaseExtensionsClientGetResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseExtensionsClientGetResponse contains the response from method DatabaseExtensionsClient.Get.

type DatabaseExtensionsClientListByDatabaseOptions added in v0.3.0

type DatabaseExtensionsClientListByDatabaseOptions struct {
}

DatabaseExtensionsClientListByDatabaseOptions contains the optional parameters for the DatabaseExtensionsClient.ListByDatabase method.

type DatabaseExtensionsClientListByDatabasePager added in v0.3.0

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

DatabaseExtensionsClientListByDatabasePager provides operations for iterating over paged responses.

func (*DatabaseExtensionsClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DatabaseExtensionsClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DatabaseExtensionsClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current DatabaseExtensionsClientListByDatabaseResponse page.

type DatabaseExtensionsClientListByDatabaseResponse added in v0.3.0

type DatabaseExtensionsClientListByDatabaseResponse struct {
	DatabaseExtensionsClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseExtensionsClientListByDatabaseResponse contains the response from method DatabaseExtensionsClient.ListByDatabase.

type DatabaseExtensionsClientListByDatabaseResult added in v0.3.0

type DatabaseExtensionsClientListByDatabaseResult struct {
	ImportExportExtensionsOperationListResult
}

DatabaseExtensionsClientListByDatabaseResult contains the result from method DatabaseExtensionsClient.ListByDatabase.

type DatabaseExtensionsProperties

type DatabaseExtensionsProperties struct {
	// REQUIRED; Operation Mode.
	OperationMode *OperationMode `json:"operationMode,omitempty"`

	// REQUIRED; Storage key.
	StorageKey *string `json:"storageKey,omitempty"`

	// REQUIRED; Storage key type.
	StorageKeyType *StorageKeyType `json:"storageKeyType,omitempty"`

	// REQUIRED; Storage Uri.
	StorageURI *string `json:"storageUri,omitempty"`
}

DatabaseExtensionsProperties - Contains the database information after successful export.

type DatabaseIdentity added in v0.3.0

type DatabaseIdentity struct {
	// Resources delegated to the database - Internal Use Only
	DelegatedResources map[string]*Delegation `json:"delegatedResources,omitempty"`

	// The identity type
	Type *DatabaseIdentityType `json:"type,omitempty"`

	// The resource ids of the user assigned identities to use
	UserAssignedIdentities map[string]*DatabaseUserIdentity `json:"userAssignedIdentities,omitempty"`

	// READ-ONLY; The Azure Active Directory tenant id.
	TenantID *string `json:"tenantId,omitempty" azure:"ro"`
}

DatabaseIdentity - Azure Active Directory identity configuration for a resource.

func (DatabaseIdentity) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type DatabaseIdentity.

type DatabaseIdentityType added in v0.3.0

type DatabaseIdentityType string

DatabaseIdentityType - The identity type

const (
	DatabaseIdentityTypeNone         DatabaseIdentityType = "None"
	DatabaseIdentityTypeUserAssigned DatabaseIdentityType = "UserAssigned"
)

func PossibleDatabaseIdentityTypeValues added in v0.3.0

func PossibleDatabaseIdentityTypeValues() []DatabaseIdentityType

PossibleDatabaseIdentityTypeValues returns the possible values for the DatabaseIdentityType const type.

func (DatabaseIdentityType) ToPtr added in v0.3.0

ToPtr returns a *DatabaseIdentityType pointing to the current value.

type DatabaseLicenseType

type DatabaseLicenseType string

DatabaseLicenseType - The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license and are eligible for the Azure Hybrid Benefit.

const (
	DatabaseLicenseTypeBasePrice       DatabaseLicenseType = "BasePrice"
	DatabaseLicenseTypeLicenseIncluded DatabaseLicenseType = "LicenseIncluded"
)

func PossibleDatabaseLicenseTypeValues

func PossibleDatabaseLicenseTypeValues() []DatabaseLicenseType

PossibleDatabaseLicenseTypeValues returns the possible values for the DatabaseLicenseType const type.

func (DatabaseLicenseType) ToPtr

ToPtr returns a *DatabaseLicenseType pointing to the current value.

type DatabaseListResult

type DatabaseListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*Database `json:"value,omitempty" azure:"ro"`
}

DatabaseListResult - A list of databases.

func (DatabaseListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseListResult.

type DatabaseOperation

type DatabaseOperation struct {
	// Resource properties.
	Properties *DatabaseOperationProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DatabaseOperation - A database operation.

type DatabaseOperationListResult

type DatabaseOperationListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*DatabaseOperation `json:"value,omitempty" azure:"ro"`
}

DatabaseOperationListResult - The response to a list database operations request

func (DatabaseOperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseOperationListResult.

type DatabaseOperationProperties

type DatabaseOperationProperties struct {
	// READ-ONLY; The name of the database the operation is being performed on.
	DatabaseName *string `json:"databaseName,omitempty" azure:"ro"`

	// READ-ONLY; The operation description.
	Description *string `json:"description,omitempty" azure:"ro"`

	// READ-ONLY; The operation error code.
	ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"`

	// READ-ONLY; The operation error description.
	ErrorDescription *string `json:"errorDescription,omitempty" azure:"ro"`

	// READ-ONLY; The operation error severity.
	ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"`

	// READ-ONLY; The estimated completion time of the operation.
	EstimatedCompletionTime *time.Time `json:"estimatedCompletionTime,omitempty" azure:"ro"`

	// READ-ONLY; Whether the operation can be cancelled.
	IsCancellable *bool `json:"isCancellable,omitempty" azure:"ro"`

	// READ-ONLY; Whether or not the error is a user error.
	IsUserError *bool `json:"isUserError,omitempty" azure:"ro"`

	// READ-ONLY; The name of operation.
	Operation *string `json:"operation,omitempty" azure:"ro"`

	// READ-ONLY; The friendly name of operation.
	OperationFriendlyName *string `json:"operationFriendlyName,omitempty" azure:"ro"`

	// READ-ONLY; The percentage of the operation completed.
	PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"`

	// READ-ONLY; The name of the server.
	ServerName *string `json:"serverName,omitempty" azure:"ro"`

	// READ-ONLY; The operation start time.
	StartTime *time.Time `json:"startTime,omitempty" azure:"ro"`

	// READ-ONLY; The operation state.
	State *ManagementOperationState `json:"state,omitempty" azure:"ro"`
}

DatabaseOperationProperties - The properties of a database operation.

func (DatabaseOperationProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseOperationProperties.

func (*DatabaseOperationProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseOperationProperties.

type DatabaseOperationsClient

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

DatabaseOperationsClient contains the methods for the DatabaseOperations group. Don't use this type directly, use NewDatabaseOperationsClient() instead.

func NewDatabaseOperationsClient

func NewDatabaseOperationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DatabaseOperationsClient

NewDatabaseOperationsClient creates a new instance of DatabaseOperationsClient with the specified values. subscriptionID - The 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 (*DatabaseOperationsClient) Cancel

func (client *DatabaseOperationsClient) Cancel(ctx context.Context, resourceGroupName string, serverName string, databaseName string, operationID string, options *DatabaseOperationsClientCancelOptions) (DatabaseOperationsClientCancelResponse, error)

Cancel - Cancels the asynchronous operation on the database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. operationID - The operation identifier. options - DatabaseOperationsClientCancelOptions contains the optional parameters for the DatabaseOperationsClient.Cancel method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CancelDatabaseOperation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseOperationsClient("<subscription-id>", cred, nil)
	_, err = client.Cancel(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<operation-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*DatabaseOperationsClient) ListByDatabase

func (client *DatabaseOperationsClient) ListByDatabase(resourceGroupName string, serverName string, databaseName string, options *DatabaseOperationsClientListByDatabaseOptions) *DatabaseOperationsClientListByDatabasePager

ListByDatabase - Gets a list of operations performed on the database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DatabaseOperationsClientListByDatabaseOptions contains the optional parameters for the DatabaseOperationsClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseOperationsClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type DatabaseOperationsClientCancelOptions added in v0.3.0

type DatabaseOperationsClientCancelOptions struct {
}

DatabaseOperationsClientCancelOptions contains the optional parameters for the DatabaseOperationsClient.Cancel method.

type DatabaseOperationsClientCancelResponse added in v0.3.0

type DatabaseOperationsClientCancelResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseOperationsClientCancelResponse contains the response from method DatabaseOperationsClient.Cancel.

type DatabaseOperationsClientListByDatabaseOptions added in v0.3.0

type DatabaseOperationsClientListByDatabaseOptions struct {
}

DatabaseOperationsClientListByDatabaseOptions contains the optional parameters for the DatabaseOperationsClient.ListByDatabase method.

type DatabaseOperationsClientListByDatabasePager added in v0.3.0

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

DatabaseOperationsClientListByDatabasePager provides operations for iterating over paged responses.

func (*DatabaseOperationsClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DatabaseOperationsClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DatabaseOperationsClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current DatabaseOperationsClientListByDatabaseResponse page.

type DatabaseOperationsClientListByDatabaseResponse added in v0.3.0

type DatabaseOperationsClientListByDatabaseResponse struct {
	DatabaseOperationsClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseOperationsClientListByDatabaseResponse contains the response from method DatabaseOperationsClient.ListByDatabase.

type DatabaseOperationsClientListByDatabaseResult added in v0.3.0

type DatabaseOperationsClientListByDatabaseResult struct {
	DatabaseOperationListResult
}

DatabaseOperationsClientListByDatabaseResult contains the result from method DatabaseOperationsClient.ListByDatabase.

type DatabaseProperties

type DatabaseProperties struct {
	// Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
	AutoPauseDelay *int32 `json:"autoPauseDelay,omitempty"`

	// Collation of the metadata catalog.
	CatalogCollation *CatalogCollationType `json:"catalogCollation,omitempty"`

	// The collation of the database.
	Collation *string `json:"collation,omitempty"`

	// Specifies the mode of database creation.
	// Default: regular database creation.
	// Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the
	// source database.
	// Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the
	// resource ID of the existing primary database.
	// PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must
	// be specified as the resource ID of the existing database, and
	// restorePointInTime must be specified.
	// Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable
	// database resource ID to restore.
	// Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId
	// is the database's original resource ID, then sourceDatabaseDeletionDate
	// must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate
	// is ignored. restorePointInTime may also be specified to restore from an
	// earlier point in time.
	// RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId
	// must be specified as the recovery point resource ID.
	// Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.
	CreateMode *CreateMode `json:"createMode,omitempty"`

	// The resource identifier of the elastic pool containing this database.
	ElasticPoolID *string `json:"elasticPoolId,omitempty"`

	// The Client id used for cross tenant per database CMK scenario
	FederatedClientID *string `json:"federatedClientId,omitempty"`

	// The number of secondary replicas associated with the database that are used to provide high availability.
	HighAvailabilityReplicaCount *int32 `json:"highAvailabilityReplicaCount,omitempty"`

	// Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the
	// value of this property cannot be changed after the database has been created.
	IsLedgerOn *bool `json:"isLedgerOn,omitempty"`

	// The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license
	// and are eligible for the Azure Hybrid Benefit.
	LicenseType *DatabaseLicenseType `json:"licenseType,omitempty"`

	// The resource identifier of the long term retention backup associated with create operation of this database.
	LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"`

	// Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates
	// will occur.
	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`

	// The max size of the database expressed in bytes.
	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`

	// Minimal capacity that database will always have allocated, if not paused
	MinCapacity *float64 `json:"minCapacity,omitempty"`

	// The Primary Delegated Identity Client id used for per database CMK - for internal use only
	PrimaryDelegatedIdentityClientID *string `json:"primaryDelegatedIdentityClientId,omitempty"`

	// The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection
	// string may be routed to a readonly secondary replica in the same region.
	ReadScale *DatabaseReadScale `json:"readScale,omitempty"`

	// The resource identifier of the recoverable database associated with create operation of this database.
	RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"`

	// The resource identifier of the recovery point associated with create operation of this database.
	RecoveryServicesRecoveryPointID *string `json:"recoveryServicesRecoveryPointId,omitempty"`

	// The storage account type to be used to store backups for this database.
	RequestedBackupStorageRedundancy *BackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"`

	// The resource identifier of the restorable dropped database associated with create operation of this database.
	RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"`

	// Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
	RestorePointInTime *time.Time `json:"restorePointInTime,omitempty"`

	// The name of the sample schema to apply when creating this database.
	SampleName *SampleName `json:"sampleName,omitempty"`

	// The secondary type of the database if it is a secondary. Valid values are Geo and Named.
	SecondaryType *SecondaryType `json:"secondaryType,omitempty"`

	// Specifies the time that the database was deleted.
	SourceDatabaseDeletionDate *time.Time `json:"sourceDatabaseDeletionDate,omitempty"`

	// The resource identifier of the source database associated with create operation of this database.
	SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"`

	// Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple
	// availability zones.
	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`

	// READ-ONLY; The creation date of the database (ISO8601 format).
	CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"`

	// READ-ONLY; The storage account type used to store backups for this database.
	CurrentBackupStorageRedundancy *BackupStorageRedundancy `json:"currentBackupStorageRedundancy,omitempty" azure:"ro"`

	// READ-ONLY; The name and tier of the SKU.
	CurrentSKU *SKU `json:"currentSku,omitempty" azure:"ro"`

	// READ-ONLY; The current service level objective name of the database.
	CurrentServiceObjectiveName *string `json:"currentServiceObjectiveName,omitempty" azure:"ro"`

	// READ-ONLY; The ID of the database.
	DatabaseID *string `json:"databaseId,omitempty" azure:"ro"`

	// READ-ONLY; The default secondary region for this database.
	DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty" azure:"ro"`

	// READ-ONLY; This records the earliest start date and time that restore is available for this database (ISO8601 format).
	EarliestRestoreDate *time.Time `json:"earliestRestoreDate,omitempty" azure:"ro"`

	// READ-ONLY; Failover Group resource identifier that this database belongs to.
	FailoverGroupID *string `json:"failoverGroupId,omitempty" azure:"ro"`

	// READ-ONLY; Infra encryption is enabled for this database.
	IsInfraEncryptionEnabled *bool `json:"isInfraEncryptionEnabled,omitempty" azure:"ro"`

	// READ-ONLY; The max log size for this database.
	MaxLogSizeBytes *int64 `json:"maxLogSizeBytes,omitempty" azure:"ro"`

	// READ-ONLY; The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.
	PausedDate *time.Time `json:"pausedDate,omitempty" azure:"ro"`

	// READ-ONLY; The requested service level objective name of the database.
	RequestedServiceObjectiveName *string `json:"requestedServiceObjectiveName,omitempty" azure:"ro"`

	// READ-ONLY; The date when database was resumed by user action or database login (ISO8601 format). Null if the database is
	// paused.
	ResumedDate *time.Time `json:"resumedDate,omitempty" azure:"ro"`

	// READ-ONLY; The status of the database.
	Status *DatabaseStatus `json:"status,omitempty" azure:"ro"`
}

DatabaseProperties - The database's properties.

func (DatabaseProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseProperties.

func (*DatabaseProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseProperties.

type DatabaseReadScale

type DatabaseReadScale string

DatabaseReadScale - The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region.

const (
	DatabaseReadScaleDisabled DatabaseReadScale = "Disabled"
	DatabaseReadScaleEnabled  DatabaseReadScale = "Enabled"
)

func PossibleDatabaseReadScaleValues

func PossibleDatabaseReadScaleValues() []DatabaseReadScale

PossibleDatabaseReadScaleValues returns the possible values for the DatabaseReadScale const type.

func (DatabaseReadScale) ToPtr

ToPtr returns a *DatabaseReadScale pointing to the current value.

type DatabaseRecommendedActionsClient

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

DatabaseRecommendedActionsClient contains the methods for the DatabaseRecommendedActions group. Don't use this type directly, use NewDatabaseRecommendedActionsClient() instead.

func NewDatabaseRecommendedActionsClient

func NewDatabaseRecommendedActionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DatabaseRecommendedActionsClient

NewDatabaseRecommendedActionsClient creates a new instance of DatabaseRecommendedActionsClient with the specified values. subscriptionID - The 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 (*DatabaseRecommendedActionsClient) Get

func (client *DatabaseRecommendedActionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, recommendedActionName string, options *DatabaseRecommendedActionsClientGetOptions) (DatabaseRecommendedActionsClientGetResponse, error)

Get - Gets a database recommended action. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. advisorName - The name of the Database Advisor. recommendedActionName - The name of Database Recommended Action. options - DatabaseRecommendedActionsClientGetOptions contains the optional parameters for the DatabaseRecommendedActionsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseRecommendedActionsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<advisor-name>",
		"<recommended-action-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseRecommendedActionsClientGetResult)
}
Output:

func (*DatabaseRecommendedActionsClient) ListByDatabaseAdvisor

ListByDatabaseAdvisor - Gets list of Database Recommended Actions. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. advisorName - The name of the Database Advisor. options - DatabaseRecommendedActionsClientListByDatabaseAdvisorOptions contains the optional parameters for the DatabaseRecommendedActionsClient.ListByDatabaseAdvisor method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseRecommendedActionsClient("<subscription-id>", cred, nil)
	res, err := client.ListByDatabaseAdvisor(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<advisor-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseRecommendedActionsClientListByDatabaseAdvisorResult)
}
Output:

func (*DatabaseRecommendedActionsClient) Update

func (client *DatabaseRecommendedActionsClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, recommendedActionName string, parameters RecommendedAction, options *DatabaseRecommendedActionsClientUpdateOptions) (DatabaseRecommendedActionsClientUpdateResponse, error)

Update - Updates a database recommended action. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. advisorName - The name of the Database Advisor. recommendedActionName - The name of Database Recommended Action. parameters - The requested recommended action resource state. options - DatabaseRecommendedActionsClientUpdateOptions contains the optional parameters for the DatabaseRecommendedActionsClient.Update method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseRecommendedActionsClient("<subscription-id>", cred, nil)
	res, err := client.Update(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<advisor-name>",
		"<recommended-action-name>",
		armsql.RecommendedAction{
			Properties: &armsql.RecommendedActionProperties{
				State: &armsql.RecommendedActionStateInfo{
					CurrentValue: armsql.RecommendedActionCurrentState("Pending").ToPtr(),
				},
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseRecommendedActionsClientUpdateResult)
}
Output:

type DatabaseRecommendedActionsClientGetOptions added in v0.3.0

type DatabaseRecommendedActionsClientGetOptions struct {
}

DatabaseRecommendedActionsClientGetOptions contains the optional parameters for the DatabaseRecommendedActionsClient.Get method.

type DatabaseRecommendedActionsClientGetResponse added in v0.3.0

type DatabaseRecommendedActionsClientGetResponse struct {
	DatabaseRecommendedActionsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseRecommendedActionsClientGetResponse contains the response from method DatabaseRecommendedActionsClient.Get.

type DatabaseRecommendedActionsClientGetResult added in v0.3.0

type DatabaseRecommendedActionsClientGetResult struct {
	RecommendedAction
}

DatabaseRecommendedActionsClientGetResult contains the result from method DatabaseRecommendedActionsClient.Get.

type DatabaseRecommendedActionsClientListByDatabaseAdvisorOptions added in v0.3.0

type DatabaseRecommendedActionsClientListByDatabaseAdvisorOptions struct {
}

DatabaseRecommendedActionsClientListByDatabaseAdvisorOptions contains the optional parameters for the DatabaseRecommendedActionsClient.ListByDatabaseAdvisor method.

type DatabaseRecommendedActionsClientListByDatabaseAdvisorResponse added in v0.3.0

type DatabaseRecommendedActionsClientListByDatabaseAdvisorResponse struct {
	DatabaseRecommendedActionsClientListByDatabaseAdvisorResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseRecommendedActionsClientListByDatabaseAdvisorResponse contains the response from method DatabaseRecommendedActionsClient.ListByDatabaseAdvisor.

type DatabaseRecommendedActionsClientListByDatabaseAdvisorResult added in v0.3.0

type DatabaseRecommendedActionsClientListByDatabaseAdvisorResult struct {
	// Array of RecommendedAction
	RecommendedActionArray []*RecommendedAction
}

DatabaseRecommendedActionsClientListByDatabaseAdvisorResult contains the result from method DatabaseRecommendedActionsClient.ListByDatabaseAdvisor.

type DatabaseRecommendedActionsClientUpdateOptions added in v0.3.0

type DatabaseRecommendedActionsClientUpdateOptions struct {
}

DatabaseRecommendedActionsClientUpdateOptions contains the optional parameters for the DatabaseRecommendedActionsClient.Update method.

type DatabaseRecommendedActionsClientUpdateResponse added in v0.3.0

type DatabaseRecommendedActionsClientUpdateResponse struct {
	DatabaseRecommendedActionsClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseRecommendedActionsClientUpdateResponse contains the response from method DatabaseRecommendedActionsClient.Update.

type DatabaseRecommendedActionsClientUpdateResult added in v0.3.0

type DatabaseRecommendedActionsClientUpdateResult struct {
	RecommendedAction
}

DatabaseRecommendedActionsClientUpdateResult contains the result from method DatabaseRecommendedActionsClient.Update.

type DatabaseSchema

type DatabaseSchema struct {
	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DatabaseSchema - A database schema resource.

type DatabaseSchemaListResult

type DatabaseSchemaListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*DatabaseSchema `json:"value,omitempty" azure:"ro"`
}

DatabaseSchemaListResult - A list of database schemas.

func (DatabaseSchemaListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseSchemaListResult.

type DatabaseSchemasClient

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

DatabaseSchemasClient contains the methods for the DatabaseSchemas group. Don't use this type directly, use NewDatabaseSchemasClient() instead.

func NewDatabaseSchemasClient

func NewDatabaseSchemasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DatabaseSchemasClient

NewDatabaseSchemasClient creates a new instance of DatabaseSchemasClient with the specified values. subscriptionID - The 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 (*DatabaseSchemasClient) Get

func (client *DatabaseSchemasClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, options *DatabaseSchemasClientGetOptions) (DatabaseSchemasClientGetResponse, error)

Get - Get database schema If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. schemaName - The name of the schema. options - DatabaseSchemasClientGetOptions contains the optional parameters for the DatabaseSchemasClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseSchemasClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<schema-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseSchemasClientGetResult)
}
Output:

func (*DatabaseSchemasClient) ListByDatabase

func (client *DatabaseSchemasClient) ListByDatabase(resourceGroupName string, serverName string, databaseName string, options *DatabaseSchemasClientListByDatabaseOptions) *DatabaseSchemasClientListByDatabasePager

ListByDatabase - List database schemas If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the DatabaseSchemasClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseSchemasClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		&armsql.DatabaseSchemasClientListByDatabaseOptions{Filter: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type DatabaseSchemasClientGetOptions added in v0.3.0

type DatabaseSchemasClientGetOptions struct {
}

DatabaseSchemasClientGetOptions contains the optional parameters for the DatabaseSchemasClient.Get method.

type DatabaseSchemasClientGetResponse added in v0.3.0

type DatabaseSchemasClientGetResponse struct {
	DatabaseSchemasClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseSchemasClientGetResponse contains the response from method DatabaseSchemasClient.Get.

type DatabaseSchemasClientGetResult added in v0.3.0

type DatabaseSchemasClientGetResult struct {
	DatabaseSchema
}

DatabaseSchemasClientGetResult contains the result from method DatabaseSchemasClient.Get.

type DatabaseSchemasClientListByDatabaseOptions added in v0.3.0

type DatabaseSchemasClientListByDatabaseOptions struct {
	// An OData filter expression that filters elements in the collection.
	Filter *string
}

DatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the DatabaseSchemasClient.ListByDatabase method.

type DatabaseSchemasClientListByDatabasePager added in v0.3.0

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

DatabaseSchemasClientListByDatabasePager provides operations for iterating over paged responses.

func (*DatabaseSchemasClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DatabaseSchemasClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DatabaseSchemasClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current DatabaseSchemasClientListByDatabaseResponse page.

type DatabaseSchemasClientListByDatabaseResponse added in v0.3.0

type DatabaseSchemasClientListByDatabaseResponse struct {
	DatabaseSchemasClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseSchemasClientListByDatabaseResponse contains the response from method DatabaseSchemasClient.ListByDatabase.

type DatabaseSchemasClientListByDatabaseResult added in v0.3.0

type DatabaseSchemasClientListByDatabaseResult struct {
	DatabaseSchemaListResult
}

DatabaseSchemasClientListByDatabaseResult contains the result from method DatabaseSchemasClient.ListByDatabase.

type DatabaseSecurityAlertListResult

type DatabaseSecurityAlertListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*DatabaseSecurityAlertPolicy `json:"value,omitempty" azure:"ro"`
}

DatabaseSecurityAlertListResult - A list of the database's security alert policies.

func (DatabaseSecurityAlertListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseSecurityAlertListResult.

type DatabaseSecurityAlertPoliciesClient

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

DatabaseSecurityAlertPoliciesClient contains the methods for the DatabaseSecurityAlertPolicies group. Don't use this type directly, use NewDatabaseSecurityAlertPoliciesClient() instead.

func NewDatabaseSecurityAlertPoliciesClient

func NewDatabaseSecurityAlertPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DatabaseSecurityAlertPoliciesClient

NewDatabaseSecurityAlertPoliciesClient creates a new instance of DatabaseSecurityAlertPoliciesClient with the specified values. subscriptionID - The 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 (*DatabaseSecurityAlertPoliciesClient) CreateOrUpdate

CreateOrUpdate - Creates or updates a database's security alert policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database for which the security alert policy is defined. securityAlertPolicyName - The name of the security alert policy. parameters - The database security alert policy. options - DatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertCreateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseSecurityAlertPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.SecurityAlertPolicyName("Default"),
		armsql.DatabaseSecurityAlertPolicy{
			Properties: &armsql.SecurityAlertsPolicyProperties{
				DisabledAlerts: []*string{
					to.StringPtr("Sql_Injection"),
					to.StringPtr("Usage_Anomaly")},
				EmailAccountAdmins: to.BoolPtr(true),
				EmailAddresses: []*string{
					to.StringPtr("test@microsoft.com"),
					to.StringPtr("user@microsoft.com")},
				RetentionDays:           to.Int32Ptr(6),
				State:                   armsql.SecurityAlertsPolicyStateEnabled.ToPtr(),
				StorageAccountAccessKey: to.StringPtr("<storage-account-access-key>"),
				StorageEndpoint:         to.StringPtr("<storage-endpoint>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseSecurityAlertPoliciesClientCreateOrUpdateResult)
}
Output:

func (*DatabaseSecurityAlertPoliciesClient) Get

Get - Gets a database's security alert policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database for which the security alert policy is defined. securityAlertPolicyName - The name of the security alert policy. options - DatabaseSecurityAlertPoliciesClientGetOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseSecurityAlertPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.SecurityAlertPolicyName("Default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseSecurityAlertPoliciesClientGetResult)
}
Output:

func (*DatabaseSecurityAlertPoliciesClient) ListByDatabase

ListByDatabase - Gets a list of database's security alert policies. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database for which the security alert policy is defined. options - DatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseSecurityAlertPoliciesClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type DatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions added in v0.3.0

type DatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions struct {
}

DatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.CreateOrUpdate method.

type DatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse added in v0.3.0

type DatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse struct {
	DatabaseSecurityAlertPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method DatabaseSecurityAlertPoliciesClient.CreateOrUpdate.

type DatabaseSecurityAlertPoliciesClientCreateOrUpdateResult added in v0.3.0

type DatabaseSecurityAlertPoliciesClientCreateOrUpdateResult struct {
	DatabaseSecurityAlertPolicy
}

DatabaseSecurityAlertPoliciesClientCreateOrUpdateResult contains the result from method DatabaseSecurityAlertPoliciesClient.CreateOrUpdate.

type DatabaseSecurityAlertPoliciesClientGetOptions added in v0.3.0

type DatabaseSecurityAlertPoliciesClientGetOptions struct {
}

DatabaseSecurityAlertPoliciesClientGetOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.Get method.

type DatabaseSecurityAlertPoliciesClientGetResponse added in v0.3.0

type DatabaseSecurityAlertPoliciesClientGetResponse struct {
	DatabaseSecurityAlertPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseSecurityAlertPoliciesClientGetResponse contains the response from method DatabaseSecurityAlertPoliciesClient.Get.

type DatabaseSecurityAlertPoliciesClientGetResult added in v0.3.0

type DatabaseSecurityAlertPoliciesClientGetResult struct {
	DatabaseSecurityAlertPolicy
}

DatabaseSecurityAlertPoliciesClientGetResult contains the result from method DatabaseSecurityAlertPoliciesClient.Get.

type DatabaseSecurityAlertPoliciesClientListByDatabaseOptions added in v0.3.0

type DatabaseSecurityAlertPoliciesClientListByDatabaseOptions struct {
}

DatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.ListByDatabase method.

type DatabaseSecurityAlertPoliciesClientListByDatabasePager added in v0.3.0

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

DatabaseSecurityAlertPoliciesClientListByDatabasePager provides operations for iterating over paged responses.

func (*DatabaseSecurityAlertPoliciesClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DatabaseSecurityAlertPoliciesClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DatabaseSecurityAlertPoliciesClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current DatabaseSecurityAlertPoliciesClientListByDatabaseResponse page.

type DatabaseSecurityAlertPoliciesClientListByDatabaseResponse added in v0.3.0

type DatabaseSecurityAlertPoliciesClientListByDatabaseResponse struct {
	DatabaseSecurityAlertPoliciesClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseSecurityAlertPoliciesClientListByDatabaseResponse contains the response from method DatabaseSecurityAlertPoliciesClient.ListByDatabase.

type DatabaseSecurityAlertPoliciesClientListByDatabaseResult added in v0.3.0

type DatabaseSecurityAlertPoliciesClientListByDatabaseResult struct {
	DatabaseSecurityAlertListResult
}

DatabaseSecurityAlertPoliciesClientListByDatabaseResult contains the result from method DatabaseSecurityAlertPoliciesClient.ListByDatabase.

type DatabaseSecurityAlertPolicy

type DatabaseSecurityAlertPolicy struct {
	// Resource properties.
	Properties *SecurityAlertsPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; SystemData of SecurityAlertPolicyResource.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DatabaseSecurityAlertPolicy - A database security alert policy.

type DatabaseState

type DatabaseState string
const (
	DatabaseStateAll     DatabaseState = "All"
	DatabaseStateDeleted DatabaseState = "Deleted"
	DatabaseStateLive    DatabaseState = "Live"
)

func PossibleDatabaseStateValues

func PossibleDatabaseStateValues() []DatabaseState

PossibleDatabaseStateValues returns the possible values for the DatabaseState const type.

func (DatabaseState) ToPtr

func (c DatabaseState) ToPtr() *DatabaseState

ToPtr returns a *DatabaseState pointing to the current value.

type DatabaseStatus

type DatabaseStatus string

DatabaseStatus - The status of the database.

const (
	DatabaseStatusAutoClosed                        DatabaseStatus = "AutoClosed"
	DatabaseStatusCopying                           DatabaseStatus = "Copying"
	DatabaseStatusCreating                          DatabaseStatus = "Creating"
	DatabaseStatusDisabled                          DatabaseStatus = "Disabled"
	DatabaseStatusEmergencyMode                     DatabaseStatus = "EmergencyMode"
	DatabaseStatusInaccessible                      DatabaseStatus = "Inaccessible"
	DatabaseStatusOffline                           DatabaseStatus = "Offline"
	DatabaseStatusOfflineChangingDwPerformanceTiers DatabaseStatus = "OfflineChangingDwPerformanceTiers"
	DatabaseStatusOfflineSecondary                  DatabaseStatus = "OfflineSecondary"
	DatabaseStatusOnline                            DatabaseStatus = "Online"
	DatabaseStatusOnlineChangingDwPerformanceTiers  DatabaseStatus = "OnlineChangingDwPerformanceTiers"
	DatabaseStatusPaused                            DatabaseStatus = "Paused"
	DatabaseStatusPausing                           DatabaseStatus = "Pausing"
	DatabaseStatusRecovering                        DatabaseStatus = "Recovering"
	DatabaseStatusRecoveryPending                   DatabaseStatus = "RecoveryPending"
	DatabaseStatusRestoring                         DatabaseStatus = "Restoring"
	DatabaseStatusResuming                          DatabaseStatus = "Resuming"
	DatabaseStatusScaling                           DatabaseStatus = "Scaling"
	DatabaseStatusShutdown                          DatabaseStatus = "Shutdown"
	DatabaseStatusStandby                           DatabaseStatus = "Standby"
	DatabaseStatusStarting                          DatabaseStatus = "Starting"
	DatabaseStatusStopped                           DatabaseStatus = "Stopped"
	DatabaseStatusStopping                          DatabaseStatus = "Stopping"
	DatabaseStatusSuspect                           DatabaseStatus = "Suspect"
)

func PossibleDatabaseStatusValues

func PossibleDatabaseStatusValues() []DatabaseStatus

PossibleDatabaseStatusValues returns the possible values for the DatabaseStatus const type.

func (DatabaseStatus) ToPtr

func (c DatabaseStatus) ToPtr() *DatabaseStatus

ToPtr returns a *DatabaseStatus pointing to the current value.

type DatabaseTable

type DatabaseTable struct {
	// Resource properties.
	Properties *DatabaseTableProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DatabaseTable - A database table resource.

type DatabaseTableListResult

type DatabaseTableListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*DatabaseTable `json:"value,omitempty" azure:"ro"`
}

DatabaseTableListResult - A list of database tables.

func (DatabaseTableListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseTableListResult.

type DatabaseTableProperties

type DatabaseTableProperties struct {
	// Whether or not the table is memory optimized.
	MemoryOptimized *bool `json:"memoryOptimized,omitempty"`

	// The table temporal type.
	TemporalType *TableTemporalType `json:"temporalType,omitempty"`
}

DatabaseTableProperties - Database table properties.

type DatabaseTablesClient

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

DatabaseTablesClient contains the methods for the DatabaseTables group. Don't use this type directly, use NewDatabaseTablesClient() instead.

func NewDatabaseTablesClient

func NewDatabaseTablesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DatabaseTablesClient

NewDatabaseTablesClient creates a new instance of DatabaseTablesClient with the specified values. subscriptionID - The 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 (*DatabaseTablesClient) Get

func (client *DatabaseTablesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, options *DatabaseTablesClientGetOptions) (DatabaseTablesClientGetResponse, error)

Get - Get database table If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. options - DatabaseTablesClientGetOptions contains the optional parameters for the DatabaseTablesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseTablesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseTablesClientGetResult)
}
Output:

func (*DatabaseTablesClient) ListBySchema

func (client *DatabaseTablesClient) ListBySchema(resourceGroupName string, serverName string, databaseName string, schemaName string, options *DatabaseTablesClientListBySchemaOptions) *DatabaseTablesClientListBySchemaPager

ListBySchema - List database tables If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. schemaName - The name of the schema. options - DatabaseTablesClientListBySchemaOptions contains the optional parameters for the DatabaseTablesClient.ListBySchema method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableListBySchema.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseTablesClient("<subscription-id>", cred, nil)
	pager := client.ListBySchema("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<schema-name>",
		&armsql.DatabaseTablesClientListBySchemaOptions{Filter: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type DatabaseTablesClientGetOptions added in v0.3.0

type DatabaseTablesClientGetOptions struct {
}

DatabaseTablesClientGetOptions contains the optional parameters for the DatabaseTablesClient.Get method.

type DatabaseTablesClientGetResponse added in v0.3.0

type DatabaseTablesClientGetResponse struct {
	DatabaseTablesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseTablesClientGetResponse contains the response from method DatabaseTablesClient.Get.

type DatabaseTablesClientGetResult added in v0.3.0

type DatabaseTablesClientGetResult struct {
	DatabaseTable
}

DatabaseTablesClientGetResult contains the result from method DatabaseTablesClient.Get.

type DatabaseTablesClientListBySchemaOptions added in v0.3.0

type DatabaseTablesClientListBySchemaOptions struct {
	// An OData filter expression that filters elements in the collection.
	Filter *string
}

DatabaseTablesClientListBySchemaOptions contains the optional parameters for the DatabaseTablesClient.ListBySchema method.

type DatabaseTablesClientListBySchemaPager added in v0.3.0

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

DatabaseTablesClientListBySchemaPager provides operations for iterating over paged responses.

func (*DatabaseTablesClientListBySchemaPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DatabaseTablesClientListBySchemaPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DatabaseTablesClientListBySchemaPager) PageResponse added in v0.3.0

PageResponse returns the current DatabaseTablesClientListBySchemaResponse page.

type DatabaseTablesClientListBySchemaResponse added in v0.3.0

type DatabaseTablesClientListBySchemaResponse struct {
	DatabaseTablesClientListBySchemaResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseTablesClientListBySchemaResponse contains the response from method DatabaseTablesClient.ListBySchema.

type DatabaseTablesClientListBySchemaResult added in v0.3.0

type DatabaseTablesClientListBySchemaResult struct {
	DatabaseTableListResult
}

DatabaseTablesClientListBySchemaResult contains the result from method DatabaseTablesClient.ListBySchema.

type DatabaseUpdate

type DatabaseUpdate struct {
	// Database identity
	Identity *DatabaseIdentity `json:"identity,omitempty"`

	// Resource properties.
	Properties *DatabaseProperties `json:"properties,omitempty"`

	// The name and tier of the SKU.
	SKU *SKU `json:"sku,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`
}

DatabaseUpdate - A database resource.

func (DatabaseUpdate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseUpdate.

type DatabaseUsage

type DatabaseUsage struct {
	// Resource properties.
	Properties *DatabaseUsageProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DatabaseUsage - Usage metric of a database.

type DatabaseUsageListResult

type DatabaseUsageListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*DatabaseUsage `json:"value,omitempty" azure:"ro"`
}

DatabaseUsageListResult - A list of database usage metrics.

func (DatabaseUsageListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DatabaseUsageListResult.

type DatabaseUsageProperties

type DatabaseUsageProperties struct {
	// READ-ONLY; Current value of the metric.
	CurrentValue *float64 `json:"currentValue,omitempty" azure:"ro"`

	// READ-ONLY; User-readable name of the metric.
	DisplayName *string `json:"displayName,omitempty" azure:"ro"`

	// READ-ONLY; Boundary value of the metric.
	Limit *float64 `json:"limit,omitempty" azure:"ro"`

	// READ-ONLY; Unit of the metric.
	Unit *string `json:"unit,omitempty" azure:"ro"`
}

DatabaseUsageProperties - Properties of a database usage.

type DatabaseUsagesClient

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

DatabaseUsagesClient contains the methods for the DatabaseUsages group. Don't use this type directly, use NewDatabaseUsagesClient() instead.

func NewDatabaseUsagesClient

func NewDatabaseUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DatabaseUsagesClient

NewDatabaseUsagesClient creates a new instance of DatabaseUsagesClient with the specified values. subscriptionID - The 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 (*DatabaseUsagesClient) ListByDatabase

func (client *DatabaseUsagesClient) ListByDatabase(resourceGroupName string, serverName string, databaseName string, options *DatabaseUsagesClientListByDatabaseOptions) *DatabaseUsagesClientListByDatabasePager

ListByDatabase - Gets database usages. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DatabaseUsagesClientListByDatabaseOptions contains the optional parameters for the DatabaseUsagesClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseUsages.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseUsagesClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type DatabaseUsagesClientListByDatabaseOptions added in v0.3.0

type DatabaseUsagesClientListByDatabaseOptions struct {
}

DatabaseUsagesClientListByDatabaseOptions contains the optional parameters for the DatabaseUsagesClient.ListByDatabase method.

type DatabaseUsagesClientListByDatabasePager added in v0.3.0

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

DatabaseUsagesClientListByDatabasePager provides operations for iterating over paged responses.

func (*DatabaseUsagesClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DatabaseUsagesClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DatabaseUsagesClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current DatabaseUsagesClientListByDatabaseResponse page.

type DatabaseUsagesClientListByDatabaseResponse added in v0.3.0

type DatabaseUsagesClientListByDatabaseResponse struct {
	DatabaseUsagesClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseUsagesClientListByDatabaseResponse contains the response from method DatabaseUsagesClient.ListByDatabase.

type DatabaseUsagesClientListByDatabaseResult added in v0.3.0

type DatabaseUsagesClientListByDatabaseResult struct {
	DatabaseUsageListResult
}

DatabaseUsagesClientListByDatabaseResult contains the result from method DatabaseUsagesClient.ListByDatabase.

type DatabaseUserIdentity added in v0.3.0

type DatabaseUserIdentity struct {
	// READ-ONLY; The Azure Active Directory client id.
	ClientID *string `json:"clientId,omitempty" azure:"ro"`

	// READ-ONLY; The Azure Active Directory principal id.
	PrincipalID *string `json:"principalId,omitempty" azure:"ro"`
}

DatabaseUserIdentity - Azure Active Directory identity configuration for a resource.

type DatabaseVulnerabilityAssessment

type DatabaseVulnerabilityAssessment struct {
	// Resource properties.
	Properties *DatabaseVulnerabilityAssessmentProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DatabaseVulnerabilityAssessment - A database vulnerability assessment.

type DatabaseVulnerabilityAssessmentListResult

type DatabaseVulnerabilityAssessmentListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*DatabaseVulnerabilityAssessment `json:"value,omitempty" azure:"ro"`
}

DatabaseVulnerabilityAssessmentListResult - A list of the database's vulnerability assessments.

func (DatabaseVulnerabilityAssessmentListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentListResult.

type DatabaseVulnerabilityAssessmentProperties

type DatabaseVulnerabilityAssessmentProperties struct {
	// The recurring scans settings
	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`

	// Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey'
	// isn't specified, storageAccountAccessKey is required.
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`

	// A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). It is required
	// if server level vulnerability assessment policy doesn't set
	StorageContainerPath *string `json:"storageContainerPath,omitempty"`

	// A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter.
	// If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is
	// required.
	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
}

DatabaseVulnerabilityAssessmentProperties - Properties of a database Vulnerability Assessment.

type DatabaseVulnerabilityAssessmentRuleBaseline

type DatabaseVulnerabilityAssessmentRuleBaseline struct {
	// Resource properties.
	Properties *DatabaseVulnerabilityAssessmentRuleBaselineProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DatabaseVulnerabilityAssessmentRuleBaseline - A database vulnerability assessment rule baseline.

type DatabaseVulnerabilityAssessmentRuleBaselineItem

type DatabaseVulnerabilityAssessmentRuleBaselineItem struct {
	// REQUIRED; The rule baseline result
	Result []*string `json:"result,omitempty"`
}

DatabaseVulnerabilityAssessmentRuleBaselineItem - Properties for an Azure SQL Database Vulnerability Assessment rule baseline's result.

func (DatabaseVulnerabilityAssessmentRuleBaselineItem) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentRuleBaselineItem.

type DatabaseVulnerabilityAssessmentRuleBaselineProperties

type DatabaseVulnerabilityAssessmentRuleBaselineProperties struct {
	// REQUIRED; The rule baseline result
	BaselineResults []*DatabaseVulnerabilityAssessmentRuleBaselineItem `json:"baselineResults,omitempty"`
}

DatabaseVulnerabilityAssessmentRuleBaselineProperties - Properties of a database Vulnerability Assessment rule baseline.

func (DatabaseVulnerabilityAssessmentRuleBaselineProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentRuleBaselineProperties.

type DatabaseVulnerabilityAssessmentRuleBaselinesClient

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

DatabaseVulnerabilityAssessmentRuleBaselinesClient contains the methods for the DatabaseVulnerabilityAssessmentRuleBaselines group. Don't use this type directly, use NewDatabaseVulnerabilityAssessmentRuleBaselinesClient() instead.

func NewDatabaseVulnerabilityAssessmentRuleBaselinesClient

func NewDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DatabaseVulnerabilityAssessmentRuleBaselinesClient

NewDatabaseVulnerabilityAssessmentRuleBaselinesClient creates a new instance of DatabaseVulnerabilityAssessmentRuleBaselinesClient with the specified values. subscriptionID - The 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 (*DatabaseVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdate

CreateOrUpdate - Creates or updates a database's vulnerability assessment rule baseline. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. ruleID - The vulnerability assessment rule ID. baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule). parameters - The requested rule baseline resource. options - DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineCreate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseVulnerabilityAssessmentRuleBaselinesClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		"<rule-id>",
		armsql.VulnerabilityAssessmentPolicyBaselineNameDefault,
		armsql.DatabaseVulnerabilityAssessmentRuleBaseline{
			Properties: &armsql.DatabaseVulnerabilityAssessmentRuleBaselineProperties{
				BaselineResults: []*armsql.DatabaseVulnerabilityAssessmentRuleBaselineItem{
					{
						Result: []*string{
							to.StringPtr("userA"),
							to.StringPtr("SELECT")},
					},
					{
						Result: []*string{
							to.StringPtr("userB"),
							to.StringPtr("SELECT")},
					},
					{
						Result: []*string{
							to.StringPtr("userC"),
							to.StringPtr("SELECT"),
							to.StringPtr("tableId_4")},
					}},
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResult)
}
Output:

func (*DatabaseVulnerabilityAssessmentRuleBaselinesClient) Delete

Delete - Removes the database's vulnerability assessment rule baseline. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. ruleID - The vulnerability assessment rule ID. baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule). options - DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseVulnerabilityAssessmentRuleBaselinesClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		"<rule-id>",
		armsql.VulnerabilityAssessmentPolicyBaselineNameDefault,
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*DatabaseVulnerabilityAssessmentRuleBaselinesClient) Get

Get - Gets a database's vulnerability assessment rule baseline. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. ruleID - The vulnerability assessment rule ID. baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule). options - DatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseVulnerabilityAssessmentRuleBaselinesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		"<rule-id>",
		armsql.VulnerabilityAssessmentPolicyBaselineNameMaster,
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResult)
}
Output:

type DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions added in v0.3.0

type DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions struct {
}

DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate method.

type DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse added in v0.3.0

type DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse struct {
	DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse contains the response from method DatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate.

type DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResult added in v0.3.0

type DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResult struct {
	DatabaseVulnerabilityAssessmentRuleBaseline
}

DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResult contains the result from method DatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate.

type DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions added in v0.3.0

type DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions struct {
}

DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete method.

type DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse added in v0.3.0

type DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse contains the response from method DatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete.

type DatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions added in v0.3.0

type DatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions struct {
}

DatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.Get method.

type DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse added in v0.3.0

type DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse struct {
	DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse contains the response from method DatabaseVulnerabilityAssessmentRuleBaselinesClient.Get.

type DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResult added in v0.3.0

type DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResult struct {
	DatabaseVulnerabilityAssessmentRuleBaseline
}

DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResult contains the result from method DatabaseVulnerabilityAssessmentRuleBaselinesClient.Get.

type DatabaseVulnerabilityAssessmentScanExportProperties

type DatabaseVulnerabilityAssessmentScanExportProperties struct {
	// READ-ONLY; Location of the exported report (e.g. https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx).
	ExportedReportLocation *string `json:"exportedReportLocation,omitempty" azure:"ro"`
}

DatabaseVulnerabilityAssessmentScanExportProperties - Properties of the export operation's result.

type DatabaseVulnerabilityAssessmentScansClient

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

DatabaseVulnerabilityAssessmentScansClient contains the methods for the DatabaseVulnerabilityAssessmentScans group. Don't use this type directly, use NewDatabaseVulnerabilityAssessmentScansClient() instead.

func NewDatabaseVulnerabilityAssessmentScansClient

func NewDatabaseVulnerabilityAssessmentScansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DatabaseVulnerabilityAssessmentScansClient

NewDatabaseVulnerabilityAssessmentScansClient creates a new instance of DatabaseVulnerabilityAssessmentScansClient with the specified values. subscriptionID - The 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 (*DatabaseVulnerabilityAssessmentScansClient) BeginInitiateScan

BeginInitiateScan - Executes a Vulnerability Assessment database scan. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. vulnerabilityAssessmentName - The name of the vulnerability assessment. scanID - The vulnerability assessment scan Id of the scan to retrieve. options - DatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.BeginInitiateScan method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScansExecute.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseVulnerabilityAssessmentScansClient("<subscription-id>", cred, nil)
	poller, err := client.BeginInitiateScan(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		"<scan-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*DatabaseVulnerabilityAssessmentScansClient) Export

Export - Convert an existing scan result to a human readable format. If already exists nothing happens If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the scanned database. vulnerabilityAssessmentName - The name of the vulnerability assessment. scanID - The vulnerability assessment scan Id. options - DatabaseVulnerabilityAssessmentScansClientExportOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.Export method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanExport.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseVulnerabilityAssessmentScansClient("<subscription-id>", cred, nil)
	res, err := client.Export(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		"<scan-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseVulnerabilityAssessmentScansClientExportResult)
}
Output:

func (*DatabaseVulnerabilityAssessmentScansClient) Get

Get - Gets a vulnerability assessment scan record of a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. vulnerabilityAssessmentName - The name of the vulnerability assessment. scanID - The vulnerability assessment scan Id of the scan to retrieve. options - DatabaseVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseVulnerabilityAssessmentScansClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		"<scan-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseVulnerabilityAssessmentScansClientGetResult)
}
Output:

func (*DatabaseVulnerabilityAssessmentScansClient) ListByDatabase

ListByDatabase - Lists the vulnerability assessment scans of a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. vulnerabilityAssessmentName - The name of the vulnerability assessment. options - DatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseVulnerabilityAssessmentScansClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type DatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions added in v0.3.0

type DatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions struct {
}

DatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.BeginInitiateScan method.

type DatabaseVulnerabilityAssessmentScansClientExportOptions added in v0.3.0

type DatabaseVulnerabilityAssessmentScansClientExportOptions struct {
}

DatabaseVulnerabilityAssessmentScansClientExportOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.Export method.

type DatabaseVulnerabilityAssessmentScansClientExportResponse added in v0.3.0

type DatabaseVulnerabilityAssessmentScansClientExportResponse struct {
	DatabaseVulnerabilityAssessmentScansClientExportResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseVulnerabilityAssessmentScansClientExportResponse contains the response from method DatabaseVulnerabilityAssessmentScansClient.Export.

type DatabaseVulnerabilityAssessmentScansClientExportResult added in v0.3.0

type DatabaseVulnerabilityAssessmentScansClientExportResult struct {
	DatabaseVulnerabilityAssessmentScansExport
}

DatabaseVulnerabilityAssessmentScansClientExportResult contains the result from method DatabaseVulnerabilityAssessmentScansClient.Export.

type DatabaseVulnerabilityAssessmentScansClientGetOptions added in v0.3.0

type DatabaseVulnerabilityAssessmentScansClientGetOptions struct {
}

DatabaseVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.Get method.

type DatabaseVulnerabilityAssessmentScansClientGetResponse added in v0.3.0

type DatabaseVulnerabilityAssessmentScansClientGetResponse struct {
	DatabaseVulnerabilityAssessmentScansClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseVulnerabilityAssessmentScansClientGetResponse contains the response from method DatabaseVulnerabilityAssessmentScansClient.Get.

type DatabaseVulnerabilityAssessmentScansClientGetResult added in v0.3.0

type DatabaseVulnerabilityAssessmentScansClientGetResult struct {
	VulnerabilityAssessmentScanRecord
}

DatabaseVulnerabilityAssessmentScansClientGetResult contains the result from method DatabaseVulnerabilityAssessmentScansClient.Get.

type DatabaseVulnerabilityAssessmentScansClientInitiateScanPoller added in v0.3.0

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

DatabaseVulnerabilityAssessmentScansClientInitiateScanPoller provides polling facilities until the operation reaches a terminal state.

func (*DatabaseVulnerabilityAssessmentScansClientInitiateScanPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*DatabaseVulnerabilityAssessmentScansClientInitiateScanPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final DatabaseVulnerabilityAssessmentScansClientInitiateScanResponse will be returned.

func (*DatabaseVulnerabilityAssessmentScansClientInitiateScanPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*DatabaseVulnerabilityAssessmentScansClientInitiateScanPoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type DatabaseVulnerabilityAssessmentScansClientInitiateScanPollerResponse added in v0.3.0

type DatabaseVulnerabilityAssessmentScansClientInitiateScanPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *DatabaseVulnerabilityAssessmentScansClientInitiateScanPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseVulnerabilityAssessmentScansClientInitiateScanPollerResponse contains the response from method DatabaseVulnerabilityAssessmentScansClient.InitiateScan.

func (DatabaseVulnerabilityAssessmentScansClientInitiateScanPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*DatabaseVulnerabilityAssessmentScansClientInitiateScanPollerResponse) Resume added in v0.3.0

Resume rehydrates a DatabaseVulnerabilityAssessmentScansClientInitiateScanPollerResponse from the provided client and resume token.

type DatabaseVulnerabilityAssessmentScansClientInitiateScanResponse added in v0.3.0

type DatabaseVulnerabilityAssessmentScansClientInitiateScanResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseVulnerabilityAssessmentScansClientInitiateScanResponse contains the response from method DatabaseVulnerabilityAssessmentScansClient.InitiateScan.

type DatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions added in v0.3.0

type DatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions struct {
}

DatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.ListByDatabase method.

type DatabaseVulnerabilityAssessmentScansClientListByDatabasePager added in v0.3.0

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

DatabaseVulnerabilityAssessmentScansClientListByDatabasePager provides operations for iterating over paged responses.

func (*DatabaseVulnerabilityAssessmentScansClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DatabaseVulnerabilityAssessmentScansClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DatabaseVulnerabilityAssessmentScansClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current DatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse page.

type DatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse added in v0.3.0

type DatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse struct {
	DatabaseVulnerabilityAssessmentScansClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse contains the response from method DatabaseVulnerabilityAssessmentScansClient.ListByDatabase.

type DatabaseVulnerabilityAssessmentScansClientListByDatabaseResult added in v0.3.0

type DatabaseVulnerabilityAssessmentScansClientListByDatabaseResult struct {
	VulnerabilityAssessmentScanRecordListResult
}

DatabaseVulnerabilityAssessmentScansClientListByDatabaseResult contains the result from method DatabaseVulnerabilityAssessmentScansClient.ListByDatabase.

type DatabaseVulnerabilityAssessmentScansExport

type DatabaseVulnerabilityAssessmentScansExport struct {
	// Resource properties.
	Properties *DatabaseVulnerabilityAssessmentScanExportProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DatabaseVulnerabilityAssessmentScansExport - A database Vulnerability Assessment scan export resource.

type DatabaseVulnerabilityAssessmentsClient

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

DatabaseVulnerabilityAssessmentsClient contains the methods for the DatabaseVulnerabilityAssessments group. Don't use this type directly, use NewDatabaseVulnerabilityAssessmentsClient() instead.

func NewDatabaseVulnerabilityAssessmentsClient

func NewDatabaseVulnerabilityAssessmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DatabaseVulnerabilityAssessmentsClient

NewDatabaseVulnerabilityAssessmentsClient creates a new instance of DatabaseVulnerabilityAssessmentsClient with the specified values. subscriptionID - The 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 (*DatabaseVulnerabilityAssessmentsClient) CreateOrUpdate

CreateOrUpdate - Creates or updates the database's vulnerability assessment. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database for which the vulnerability assessment is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. parameters - The requested resource. options - DatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		armsql.DatabaseVulnerabilityAssessment{
			Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{
				RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{
					EmailSubscriptionAdmins: to.BoolPtr(true),
					Emails: []*string{
						to.StringPtr("email1@mail.com"),
						to.StringPtr("email2@mail.com")},
					IsEnabled: to.BoolPtr(true),
				},
				StorageAccountAccessKey: to.StringPtr("<storage-account-access-key>"),
				StorageContainerPath:    to.StringPtr("<storage-container-path>"),
				StorageContainerSasKey:  to.StringPtr("<storage-container-sas-key>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResult)
}
Output:

func (*DatabaseVulnerabilityAssessmentsClient) Delete

Delete - Removes the database's vulnerability assessment. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database for which the vulnerability assessment is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. options - DatabaseVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*DatabaseVulnerabilityAssessmentsClient) Get

Get - Gets the database's vulnerability assessment. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database for which the vulnerability assessment is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. options - DatabaseVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabaseVulnerabilityAssessmentsClientGetResult)
}
Output:

func (*DatabaseVulnerabilityAssessmentsClient) ListByDatabase

ListByDatabase - Lists the vulnerability assessment policies associated with a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database for which the vulnerability assessment policies are defined. options - DatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabaseVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type DatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions added in v0.3.0

type DatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions struct {
}

DatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.CreateOrUpdate method.

type DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse added in v0.3.0

type DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse struct {
	DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse contains the response from method DatabaseVulnerabilityAssessmentsClient.CreateOrUpdate.

type DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResult added in v0.3.0

type DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResult struct {
	DatabaseVulnerabilityAssessment
}

DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResult contains the result from method DatabaseVulnerabilityAssessmentsClient.CreateOrUpdate.

type DatabaseVulnerabilityAssessmentsClientDeleteOptions added in v0.3.0

type DatabaseVulnerabilityAssessmentsClientDeleteOptions struct {
}

DatabaseVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.Delete method.

type DatabaseVulnerabilityAssessmentsClientDeleteResponse added in v0.3.0

type DatabaseVulnerabilityAssessmentsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseVulnerabilityAssessmentsClientDeleteResponse contains the response from method DatabaseVulnerabilityAssessmentsClient.Delete.

type DatabaseVulnerabilityAssessmentsClientGetOptions added in v0.3.0

type DatabaseVulnerabilityAssessmentsClientGetOptions struct {
}

DatabaseVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.Get method.

type DatabaseVulnerabilityAssessmentsClientGetResponse added in v0.3.0

type DatabaseVulnerabilityAssessmentsClientGetResponse struct {
	DatabaseVulnerabilityAssessmentsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseVulnerabilityAssessmentsClientGetResponse contains the response from method DatabaseVulnerabilityAssessmentsClient.Get.

type DatabaseVulnerabilityAssessmentsClientGetResult added in v0.3.0

type DatabaseVulnerabilityAssessmentsClientGetResult struct {
	DatabaseVulnerabilityAssessment
}

DatabaseVulnerabilityAssessmentsClientGetResult contains the result from method DatabaseVulnerabilityAssessmentsClient.Get.

type DatabaseVulnerabilityAssessmentsClientListByDatabaseOptions added in v0.3.0

type DatabaseVulnerabilityAssessmentsClientListByDatabaseOptions struct {
}

DatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.ListByDatabase method.

type DatabaseVulnerabilityAssessmentsClientListByDatabasePager added in v0.3.0

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

DatabaseVulnerabilityAssessmentsClientListByDatabasePager provides operations for iterating over paged responses.

func (*DatabaseVulnerabilityAssessmentsClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DatabaseVulnerabilityAssessmentsClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DatabaseVulnerabilityAssessmentsClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current DatabaseVulnerabilityAssessmentsClientListByDatabaseResponse page.

type DatabaseVulnerabilityAssessmentsClientListByDatabaseResponse added in v0.3.0

type DatabaseVulnerabilityAssessmentsClientListByDatabaseResponse struct {
	DatabaseVulnerabilityAssessmentsClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabaseVulnerabilityAssessmentsClientListByDatabaseResponse contains the response from method DatabaseVulnerabilityAssessmentsClient.ListByDatabase.

type DatabaseVulnerabilityAssessmentsClientListByDatabaseResult added in v0.3.0

type DatabaseVulnerabilityAssessmentsClientListByDatabaseResult struct {
	DatabaseVulnerabilityAssessmentListResult
}

DatabaseVulnerabilityAssessmentsClientListByDatabaseResult contains the result from method DatabaseVulnerabilityAssessmentsClient.ListByDatabase.

type DatabasesClient

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

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

func NewDatabasesClient

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

NewDatabasesClient creates a new instance of DatabasesClient with the specified values. subscriptionID - The 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 (*DatabasesClient) BeginCreateOrUpdate

func (client *DatabasesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOrUpdateOptions) (DatabasesClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates a new database or updates an existing database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. parameters - The requested database resource state. options - DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateVCoreDatabaseByServiceObjective.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.Database{
			Location: to.StringPtr("<location>"),
			SKU: &armsql.SKU{
				Name:     to.StringPtr("<name>"),
				Capacity: to.Int32Ptr(2),
				Family:   to.StringPtr("<family>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabasesClientCreateOrUpdateResult)
}
Output:

func (*DatabasesClient) BeginDelete

func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (DatabasesClientDeletePollerResponse, error)

BeginDelete - Deletes the database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DatabasesClientBeginDeleteOptions contains the optional parameters for the DatabasesClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/DeleteDatabase.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*DatabasesClient) BeginExport

func (client *DatabasesClient) BeginExport(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ExportDatabaseDefinition, options *DatabasesClientBeginExportOptions) (DatabasesClientExportPollerResponse, error)

BeginExport - Exports a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. parameters - The database export request parameters. options - DatabasesClientBeginExportOptions contains the optional parameters for the DatabasesClient.BeginExport method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ExportDatabaseWithNetworkIsolation.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginExport(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.ExportDatabaseDefinition{
			AdministratorLogin:         to.StringPtr("<administrator-login>"),
			AdministratorLoginPassword: to.StringPtr("<administrator-login-password>"),
			AuthenticationType:         to.StringPtr("<authentication-type>"),
			NetworkIsolation: &armsql.NetworkIsolationSettings{
				SQLServerResourceID:      to.StringPtr("<sqlserver-resource-id>"),
				StorageAccountResourceID: to.StringPtr("<storage-account-resource-id>"),
			},
			StorageKey:     to.StringPtr("<storage-key>"),
			StorageKeyType: armsql.StorageKeyType("StorageAccessKey").ToPtr(),
			StorageURI:     to.StringPtr("<storage-uri>"),
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabasesClientExportResult)
}
Output:

func (*DatabasesClient) BeginFailover

func (client *DatabasesClient) BeginFailover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginFailoverOptions) (DatabasesClientFailoverPollerResponse, error)

BeginFailover - Failovers a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database to failover. options - DatabasesClientBeginFailoverOptions contains the optional parameters for the DatabasesClient.BeginFailover method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/FailoverDatabase.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginFailover(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		&armsql.DatabasesClientBeginFailoverOptions{ReplicaType: armsql.ReplicaType("Primary").ToPtr()})
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*DatabasesClient) BeginImport

func (client *DatabasesClient) BeginImport(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ImportExistingDatabaseDefinition, options *DatabasesClientBeginImportOptions) (DatabasesClientImportPollerResponse, error)

BeginImport - Imports a bacpac into a new database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. parameters - The database import request parameters. options - DatabasesClientBeginImportOptions contains the optional parameters for the DatabasesClient.BeginImport method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ImportDatabaseWithNetworkIsolation.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginImport(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.ImportExistingDatabaseDefinition{
			AdministratorLogin:         to.StringPtr("<administrator-login>"),
			AdministratorLoginPassword: to.StringPtr("<administrator-login-password>"),
			AuthenticationType:         to.StringPtr("<authentication-type>"),
			NetworkIsolation: &armsql.NetworkIsolationSettings{
				SQLServerResourceID:      to.StringPtr("<sqlserver-resource-id>"),
				StorageAccountResourceID: to.StringPtr("<storage-account-resource-id>"),
			},
			StorageKey:     to.StringPtr("<storage-key>"),
			StorageKeyType: armsql.StorageKeyType("StorageAccessKey").ToPtr(),
			StorageURI:     to.StringPtr("<storage-uri>"),
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabasesClientImportResult)
}
Output:

func (*DatabasesClient) BeginPause

func (client *DatabasesClient) BeginPause(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginPauseOptions) (DatabasesClientPausePollerResponse, error)

BeginPause - Pauses a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database to be paused. options - DatabasesClientBeginPauseOptions contains the optional parameters for the DatabasesClient.BeginPause method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/PauseDatabase.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginPause(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabasesClientPauseResult)
}
Output:

func (*DatabasesClient) BeginResume

func (client *DatabasesClient) BeginResume(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginResumeOptions) (DatabasesClientResumePollerResponse, error)

BeginResume - Resumes a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database to be resumed. options - DatabasesClientBeginResumeOptions contains the optional parameters for the DatabasesClient.BeginResume method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResumeDatabase.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginResume(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabasesClientResumeResult)
}
Output:

func (*DatabasesClient) BeginUpdate

func (client *DatabasesClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseUpdate, options *DatabasesClientBeginUpdateOptions) (DatabasesClientUpdatePollerResponse, error)

BeginUpdate - Updates an existing database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. parameters - The requested database resource state. options - DatabasesClientBeginUpdateOptions contains the optional parameters for the DatabasesClient.BeginUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/PatchVCoreDatabaseAssignMaintenanceConfiguration.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.DatabaseUpdate{
			Properties: &armsql.DatabaseProperties{
				MaintenanceConfigurationID: to.StringPtr("<maintenance-configuration-id>"),
			},
			SKU: &armsql.SKU{
				Name: to.StringPtr("<name>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabasesClientUpdateResult)
}
Output:

func (*DatabasesClient) BeginUpgradeDataWarehouse

func (client *DatabasesClient) BeginUpgradeDataWarehouse(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginUpgradeDataWarehouseOptions) (DatabasesClientUpgradeDataWarehousePollerResponse, error)

BeginUpgradeDataWarehouse - Upgrades a data warehouse. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database to be upgraded. options - DatabasesClientBeginUpgradeDataWarehouseOptions contains the optional parameters for the DatabasesClient.BeginUpgradeDataWarehouse method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/UpgradeDataWarehouse.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpgradeDataWarehouse(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*DatabasesClient) Get

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

Get - Gets a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DatabasesClientGetOptions contains the optional parameters for the DatabasesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetVCoreDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabasesClientGetResult)
}
Output:

func (*DatabasesClient) ListByElasticPool

func (client *DatabasesClient) ListByElasticPool(resourceGroupName string, serverName string, elasticPoolName string, options *DatabasesClientListByElasticPoolOptions) *DatabasesClientListByElasticPoolPager

ListByElasticPool - Gets a list of databases in an elastic pool. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. elasticPoolName - The name of the elastic pool. options - DatabasesClientListByElasticPoolOptions contains the optional parameters for the DatabasesClient.ListByElasticPool method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListDatabasesByElasticPool.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	pager := client.ListByElasticPool("<resource-group-name>",
		"<server-name>",
		"<elastic-pool-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*DatabasesClient) ListByServer

func (client *DatabasesClient) ListByServer(resourceGroupName string, serverName string, options *DatabasesClientListByServerOptions) *DatabasesClientListByServerPager

ListByServer - Gets a list of databases. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - DatabasesClientListByServerOptions contains the optional parameters for the DatabasesClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListVCoreDatabasesByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		&armsql.DatabasesClientListByServerOptions{SkipToken: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*DatabasesClient) ListInaccessibleByServer

func (client *DatabasesClient) ListInaccessibleByServer(resourceGroupName string, serverName string, options *DatabasesClientListInaccessibleByServerOptions) *DatabasesClientListInaccessibleByServerPager

ListInaccessibleByServer - Gets a list of inaccessible databases in a logical server If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - DatabasesClientListInaccessibleByServerOptions contains the optional parameters for the DatabasesClient.ListInaccessibleByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListVCoreInaccessibleDatabasesByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	pager := client.ListInaccessibleByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*DatabasesClient) ListMetricDefinitions

func (client *DatabasesClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientListMetricDefinitionsOptions) (DatabasesClientListMetricDefinitionsResponse, error)

ListMetricDefinitions - Returns database metric definitions. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - DatabasesClientListMetricDefinitionsOptions contains the optional parameters for the DatabasesClient.ListMetricDefinitions method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsDefinitionsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	res, err := client.ListMetricDefinitions(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabasesClientListMetricDefinitionsResult)
}
Output:

func (*DatabasesClient) ListMetrics

func (client *DatabasesClient) ListMetrics(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter string, options *DatabasesClientListMetricsOptions) (DatabasesClientListMetricsResponse, error)

ListMetrics - Returns database metrics. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. filter - An OData filter expression that describes a subset of metrics to return. options - DatabasesClientListMetricsOptions contains the optional parameters for the DatabasesClient.ListMetrics method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsListWithFilter.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	res, err := client.ListMetrics(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<filter>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DatabasesClientListMetricsResult)
}
Output:

func (*DatabasesClient) Rename

func (client *DatabasesClient) Rename(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ResourceMoveDefinition, options *DatabasesClientRenameOptions) (DatabasesClientRenameResponse, error)

Rename - Renames a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database to rename. parameters - The resource move definition for renaming this database. options - DatabasesClientRenameOptions contains the optional parameters for the DatabasesClient.Rename method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/RenameDatabase.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDatabasesClient("<subscription-id>", cred, nil)
	_, err = client.Rename(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.ResourceMoveDefinition{
			ID: to.StringPtr("<id>"),
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

type DatabasesClientBeginCreateOrUpdateOptions added in v0.3.0

type DatabasesClientBeginCreateOrUpdateOptions struct {
}

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

type DatabasesClientBeginDeleteOptions added in v0.3.0

type DatabasesClientBeginDeleteOptions struct {
}

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

type DatabasesClientBeginExportOptions added in v0.3.0

type DatabasesClientBeginExportOptions struct {
}

DatabasesClientBeginExportOptions contains the optional parameters for the DatabasesClient.BeginExport method.

type DatabasesClientBeginFailoverOptions added in v0.3.0

type DatabasesClientBeginFailoverOptions struct {
	// The type of replica to be failed over.
	ReplicaType *ReplicaType
}

DatabasesClientBeginFailoverOptions contains the optional parameters for the DatabasesClient.BeginFailover method.

type DatabasesClientBeginImportOptions added in v0.3.0

type DatabasesClientBeginImportOptions struct {
}

DatabasesClientBeginImportOptions contains the optional parameters for the DatabasesClient.BeginImport method.

type DatabasesClientBeginPauseOptions added in v0.3.0

type DatabasesClientBeginPauseOptions struct {
}

DatabasesClientBeginPauseOptions contains the optional parameters for the DatabasesClient.BeginPause method.

type DatabasesClientBeginResumeOptions added in v0.3.0

type DatabasesClientBeginResumeOptions struct {
}

DatabasesClientBeginResumeOptions contains the optional parameters for the DatabasesClient.BeginResume method.

type DatabasesClientBeginUpdateOptions added in v0.3.0

type DatabasesClientBeginUpdateOptions struct {
}

DatabasesClientBeginUpdateOptions contains the optional parameters for the DatabasesClient.BeginUpdate method.

type DatabasesClientBeginUpgradeDataWarehouseOptions added in v0.3.0

type DatabasesClientBeginUpgradeDataWarehouseOptions struct {
}

DatabasesClientBeginUpgradeDataWarehouseOptions contains the optional parameters for the DatabasesClient.BeginUpgradeDataWarehouse method.

type DatabasesClientCreateOrUpdatePoller added in v0.3.0

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

DatabasesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*DatabasesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*DatabasesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final DatabasesClientCreateOrUpdateResponse will be returned.

func (*DatabasesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*DatabasesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

func (p *DatabasesClientCreateOrUpdatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type DatabasesClientCreateOrUpdatePollerResponse added in v0.3.0

type DatabasesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *DatabasesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientCreateOrUpdatePollerResponse contains the response from method DatabasesClient.CreateOrUpdate.

func (DatabasesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*DatabasesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a DatabasesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type DatabasesClientCreateOrUpdateResponse added in v0.3.0

type DatabasesClientCreateOrUpdateResponse struct {
	DatabasesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientCreateOrUpdateResponse contains the response from method DatabasesClient.CreateOrUpdate.

type DatabasesClientCreateOrUpdateResult added in v0.3.0

type DatabasesClientCreateOrUpdateResult struct {
	Database
}

DatabasesClientCreateOrUpdateResult contains the result from method DatabasesClient.CreateOrUpdate.

type DatabasesClientDeletePoller added in v0.3.0

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

DatabasesClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*DatabasesClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*DatabasesClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final DatabasesClientDeleteResponse will be returned.

func (*DatabasesClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*DatabasesClientDeletePoller) ResumeToken added in v0.3.0

func (p *DatabasesClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type DatabasesClientDeletePollerResponse added in v0.3.0

type DatabasesClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *DatabasesClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientDeletePollerResponse contains the response from method DatabasesClient.Delete.

func (DatabasesClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*DatabasesClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a DatabasesClientDeletePollerResponse from the provided client and resume token.

type DatabasesClientDeleteResponse added in v0.3.0

type DatabasesClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientDeleteResponse contains the response from method DatabasesClient.Delete.

type DatabasesClientExportPoller added in v0.3.0

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

DatabasesClientExportPoller provides polling facilities until the operation reaches a terminal state.

func (*DatabasesClientExportPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*DatabasesClientExportPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final DatabasesClientExportResponse will be returned.

func (*DatabasesClientExportPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*DatabasesClientExportPoller) ResumeToken added in v0.3.0

func (p *DatabasesClientExportPoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type DatabasesClientExportPollerResponse added in v0.3.0

type DatabasesClientExportPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *DatabasesClientExportPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientExportPollerResponse contains the response from method DatabasesClient.Export.

func (DatabasesClientExportPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*DatabasesClientExportPollerResponse) Resume added in v0.3.0

Resume rehydrates a DatabasesClientExportPollerResponse from the provided client and resume token.

type DatabasesClientExportResponse added in v0.3.0

type DatabasesClientExportResponse struct {
	DatabasesClientExportResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientExportResponse contains the response from method DatabasesClient.Export.

type DatabasesClientExportResult added in v0.3.0

type DatabasesClientExportResult struct {
	ImportExportOperationResult
}

DatabasesClientExportResult contains the result from method DatabasesClient.Export.

type DatabasesClientFailoverPoller added in v0.3.0

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

DatabasesClientFailoverPoller provides polling facilities until the operation reaches a terminal state.

func (*DatabasesClientFailoverPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*DatabasesClientFailoverPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final DatabasesClientFailoverResponse will be returned.

func (*DatabasesClientFailoverPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*DatabasesClientFailoverPoller) ResumeToken added in v0.3.0

func (p *DatabasesClientFailoverPoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type DatabasesClientFailoverPollerResponse added in v0.3.0

type DatabasesClientFailoverPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *DatabasesClientFailoverPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientFailoverPollerResponse contains the response from method DatabasesClient.Failover.

func (DatabasesClientFailoverPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*DatabasesClientFailoverPollerResponse) Resume added in v0.3.0

Resume rehydrates a DatabasesClientFailoverPollerResponse from the provided client and resume token.

type DatabasesClientFailoverResponse added in v0.3.0

type DatabasesClientFailoverResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientFailoverResponse contains the response from method DatabasesClient.Failover.

type DatabasesClientGetOptions added in v0.3.0

type DatabasesClientGetOptions struct {
}

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

type DatabasesClientGetResponse added in v0.3.0

type DatabasesClientGetResponse struct {
	DatabasesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientGetResponse contains the response from method DatabasesClient.Get.

type DatabasesClientGetResult added in v0.3.0

type DatabasesClientGetResult struct {
	Database
}

DatabasesClientGetResult contains the result from method DatabasesClient.Get.

type DatabasesClientImportPoller added in v0.3.0

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

DatabasesClientImportPoller provides polling facilities until the operation reaches a terminal state.

func (*DatabasesClientImportPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*DatabasesClientImportPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final DatabasesClientImportResponse will be returned.

func (*DatabasesClientImportPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*DatabasesClientImportPoller) ResumeToken added in v0.3.0

func (p *DatabasesClientImportPoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type DatabasesClientImportPollerResponse added in v0.3.0

type DatabasesClientImportPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *DatabasesClientImportPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientImportPollerResponse contains the response from method DatabasesClient.Import.

func (DatabasesClientImportPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*DatabasesClientImportPollerResponse) Resume added in v0.3.0

Resume rehydrates a DatabasesClientImportPollerResponse from the provided client and resume token.

type DatabasesClientImportResponse added in v0.3.0

type DatabasesClientImportResponse struct {
	DatabasesClientImportResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientImportResponse contains the response from method DatabasesClient.Import.

type DatabasesClientImportResult added in v0.3.0

type DatabasesClientImportResult struct {
	ImportExportOperationResult
}

DatabasesClientImportResult contains the result from method DatabasesClient.Import.

type DatabasesClientListByElasticPoolOptions added in v0.3.0

type DatabasesClientListByElasticPoolOptions struct {
}

DatabasesClientListByElasticPoolOptions contains the optional parameters for the DatabasesClient.ListByElasticPool method.

type DatabasesClientListByElasticPoolPager added in v0.3.0

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

DatabasesClientListByElasticPoolPager provides operations for iterating over paged responses.

func (*DatabasesClientListByElasticPoolPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DatabasesClientListByElasticPoolPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DatabasesClientListByElasticPoolPager) PageResponse added in v0.3.0

PageResponse returns the current DatabasesClientListByElasticPoolResponse page.

type DatabasesClientListByElasticPoolResponse added in v0.3.0

type DatabasesClientListByElasticPoolResponse struct {
	DatabasesClientListByElasticPoolResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientListByElasticPoolResponse contains the response from method DatabasesClient.ListByElasticPool.

type DatabasesClientListByElasticPoolResult added in v0.3.0

type DatabasesClientListByElasticPoolResult struct {
	DatabaseListResult
}

DatabasesClientListByElasticPoolResult contains the result from method DatabasesClient.ListByElasticPool.

type DatabasesClientListByServerOptions added in v0.3.0

type DatabasesClientListByServerOptions struct {
	SkipToken *string
}

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

type DatabasesClientListByServerPager added in v0.3.0

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

DatabasesClientListByServerPager provides operations for iterating over paged responses.

func (*DatabasesClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DatabasesClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DatabasesClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current DatabasesClientListByServerResponse page.

type DatabasesClientListByServerResponse added in v0.3.0

type DatabasesClientListByServerResponse struct {
	DatabasesClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientListByServerResponse contains the response from method DatabasesClient.ListByServer.

type DatabasesClientListByServerResult added in v0.3.0

type DatabasesClientListByServerResult struct {
	DatabaseListResult
}

DatabasesClientListByServerResult contains the result from method DatabasesClient.ListByServer.

type DatabasesClientListInaccessibleByServerOptions added in v0.3.0

type DatabasesClientListInaccessibleByServerOptions struct {
}

DatabasesClientListInaccessibleByServerOptions contains the optional parameters for the DatabasesClient.ListInaccessibleByServer method.

type DatabasesClientListInaccessibleByServerPager added in v0.3.0

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

DatabasesClientListInaccessibleByServerPager provides operations for iterating over paged responses.

func (*DatabasesClientListInaccessibleByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DatabasesClientListInaccessibleByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DatabasesClientListInaccessibleByServerPager) PageResponse added in v0.3.0

PageResponse returns the current DatabasesClientListInaccessibleByServerResponse page.

type DatabasesClientListInaccessibleByServerResponse added in v0.3.0

type DatabasesClientListInaccessibleByServerResponse struct {
	DatabasesClientListInaccessibleByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientListInaccessibleByServerResponse contains the response from method DatabasesClient.ListInaccessibleByServer.

type DatabasesClientListInaccessibleByServerResult added in v0.3.0

type DatabasesClientListInaccessibleByServerResult struct {
	DatabaseListResult
}

DatabasesClientListInaccessibleByServerResult contains the result from method DatabasesClient.ListInaccessibleByServer.

type DatabasesClientListMetricDefinitionsOptions added in v0.3.0

type DatabasesClientListMetricDefinitionsOptions struct {
}

DatabasesClientListMetricDefinitionsOptions contains the optional parameters for the DatabasesClient.ListMetricDefinitions method.

type DatabasesClientListMetricDefinitionsResponse added in v0.3.0

type DatabasesClientListMetricDefinitionsResponse struct {
	DatabasesClientListMetricDefinitionsResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientListMetricDefinitionsResponse contains the response from method DatabasesClient.ListMetricDefinitions.

type DatabasesClientListMetricDefinitionsResult added in v0.3.0

type DatabasesClientListMetricDefinitionsResult struct {
	MetricDefinitionListResult
}

DatabasesClientListMetricDefinitionsResult contains the result from method DatabasesClient.ListMetricDefinitions.

type DatabasesClientListMetricsOptions added in v0.3.0

type DatabasesClientListMetricsOptions struct {
}

DatabasesClientListMetricsOptions contains the optional parameters for the DatabasesClient.ListMetrics method.

type DatabasesClientListMetricsResponse added in v0.3.0

type DatabasesClientListMetricsResponse struct {
	DatabasesClientListMetricsResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientListMetricsResponse contains the response from method DatabasesClient.ListMetrics.

type DatabasesClientListMetricsResult added in v0.3.0

type DatabasesClientListMetricsResult struct {
	MetricListResult
}

DatabasesClientListMetricsResult contains the result from method DatabasesClient.ListMetrics.

type DatabasesClientPausePoller added in v0.3.0

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

DatabasesClientPausePoller provides polling facilities until the operation reaches a terminal state.

func (*DatabasesClientPausePoller) Done added in v0.3.0

func (p *DatabasesClientPausePoller) Done() bool

Done returns true if the LRO has reached a terminal state.

func (*DatabasesClientPausePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final DatabasesClientPauseResponse will be returned.

func (*DatabasesClientPausePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*DatabasesClientPausePoller) ResumeToken added in v0.3.0

func (p *DatabasesClientPausePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type DatabasesClientPausePollerResponse added in v0.3.0

type DatabasesClientPausePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *DatabasesClientPausePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientPausePollerResponse contains the response from method DatabasesClient.Pause.

func (DatabasesClientPausePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*DatabasesClientPausePollerResponse) Resume added in v0.3.0

Resume rehydrates a DatabasesClientPausePollerResponse from the provided client and resume token.

type DatabasesClientPauseResponse added in v0.3.0

type DatabasesClientPauseResponse struct {
	DatabasesClientPauseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientPauseResponse contains the response from method DatabasesClient.Pause.

type DatabasesClientPauseResult added in v0.3.0

type DatabasesClientPauseResult struct {
	Database
}

DatabasesClientPauseResult contains the result from method DatabasesClient.Pause.

type DatabasesClientRenameOptions added in v0.3.0

type DatabasesClientRenameOptions struct {
}

DatabasesClientRenameOptions contains the optional parameters for the DatabasesClient.Rename method.

type DatabasesClientRenameResponse added in v0.3.0

type DatabasesClientRenameResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientRenameResponse contains the response from method DatabasesClient.Rename.

type DatabasesClientResumePoller added in v0.3.0

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

DatabasesClientResumePoller provides polling facilities until the operation reaches a terminal state.

func (*DatabasesClientResumePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*DatabasesClientResumePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final DatabasesClientResumeResponse will be returned.

func (*DatabasesClientResumePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*DatabasesClientResumePoller) ResumeToken added in v0.3.0

func (p *DatabasesClientResumePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type DatabasesClientResumePollerResponse added in v0.3.0

type DatabasesClientResumePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *DatabasesClientResumePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientResumePollerResponse contains the response from method DatabasesClient.Resume.

func (DatabasesClientResumePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*DatabasesClientResumePollerResponse) Resume added in v0.3.0

Resume rehydrates a DatabasesClientResumePollerResponse from the provided client and resume token.

type DatabasesClientResumeResponse added in v0.3.0

type DatabasesClientResumeResponse struct {
	DatabasesClientResumeResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientResumeResponse contains the response from method DatabasesClient.Resume.

type DatabasesClientResumeResult added in v0.3.0

type DatabasesClientResumeResult struct {
	Database
}

DatabasesClientResumeResult contains the result from method DatabasesClient.Resume.

type DatabasesClientUpdatePoller added in v0.3.0

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

DatabasesClientUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*DatabasesClientUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*DatabasesClientUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final DatabasesClientUpdateResponse will be returned.

func (*DatabasesClientUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*DatabasesClientUpdatePoller) ResumeToken added in v0.3.0

func (p *DatabasesClientUpdatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type DatabasesClientUpdatePollerResponse added in v0.3.0

type DatabasesClientUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *DatabasesClientUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientUpdatePollerResponse contains the response from method DatabasesClient.Update.

func (DatabasesClientUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*DatabasesClientUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a DatabasesClientUpdatePollerResponse from the provided client and resume token.

type DatabasesClientUpdateResponse added in v0.3.0

type DatabasesClientUpdateResponse struct {
	DatabasesClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientUpdateResponse contains the response from method DatabasesClient.Update.

type DatabasesClientUpdateResult added in v0.3.0

type DatabasesClientUpdateResult struct {
	Database
}

DatabasesClientUpdateResult contains the result from method DatabasesClient.Update.

type DatabasesClientUpgradeDataWarehousePoller added in v0.3.0

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

DatabasesClientUpgradeDataWarehousePoller provides polling facilities until the operation reaches a terminal state.

func (*DatabasesClientUpgradeDataWarehousePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*DatabasesClientUpgradeDataWarehousePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final DatabasesClientUpgradeDataWarehouseResponse will be returned.

func (*DatabasesClientUpgradeDataWarehousePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*DatabasesClientUpgradeDataWarehousePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type DatabasesClientUpgradeDataWarehousePollerResponse added in v0.3.0

type DatabasesClientUpgradeDataWarehousePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *DatabasesClientUpgradeDataWarehousePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientUpgradeDataWarehousePollerResponse contains the response from method DatabasesClient.UpgradeDataWarehouse.

func (DatabasesClientUpgradeDataWarehousePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*DatabasesClientUpgradeDataWarehousePollerResponse) Resume added in v0.3.0

Resume rehydrates a DatabasesClientUpgradeDataWarehousePollerResponse from the provided client and resume token.

type DatabasesClientUpgradeDataWarehouseResponse added in v0.3.0

type DatabasesClientUpgradeDataWarehouseResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DatabasesClientUpgradeDataWarehouseResponse contains the response from method DatabasesClient.UpgradeDataWarehouse.

type DayOfWeek

type DayOfWeek string

DayOfWeek - Day of maintenance window.

const (
	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.

func (DayOfWeek) ToPtr

func (c DayOfWeek) ToPtr() *DayOfWeek

ToPtr returns a *DayOfWeek pointing to the current value.

type Delegation added in v0.3.0

type Delegation struct {
	// The resource id of the source resource - Internal Use Only
	ResourceID *string `json:"resourceId,omitempty"`

	// READ-ONLY; AAD tenant guid of the source resource identity - Internal Use Only.
	TenantID *string `json:"tenantId,omitempty" azure:"ro"`
}

Delegation - Delegated Resource Properties - Internal Use Only

type DeletedServer

type DeletedServer struct {
	// Resource properties.
	Properties *DeletedServerProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DeletedServer - A deleted server.

type DeletedServerListResult

type DeletedServerListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*DeletedServer `json:"value,omitempty" azure:"ro"`
}

DeletedServerListResult - A list of deleted servers.

func (DeletedServerListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DeletedServerListResult.

type DeletedServerProperties

type DeletedServerProperties struct {
	// READ-ONLY; The deletion time of the deleted server.
	DeletionTime *time.Time `json:"deletionTime,omitempty" azure:"ro"`

	// READ-ONLY; The fully qualified domain name of the server.
	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty" azure:"ro"`

	// READ-ONLY; The original ID of the server before deletion.
	OriginalID *string `json:"originalId,omitempty" azure:"ro"`

	// READ-ONLY; The version of the deleted server.
	Version *string `json:"version,omitempty" azure:"ro"`
}

DeletedServerProperties - The properties of a deleted server.

func (DeletedServerProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DeletedServerProperties.

func (*DeletedServerProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServerProperties.

type DeletedServersClient

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

DeletedServersClient contains the methods for the DeletedServers group. Don't use this type directly, use NewDeletedServersClient() instead.

func NewDeletedServersClient

func NewDeletedServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DeletedServersClient

NewDeletedServersClient creates a new instance of DeletedServersClient with the specified values. subscriptionID - The 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 (*DeletedServersClient) BeginRecover

func (client *DeletedServersClient) BeginRecover(ctx context.Context, locationName string, deletedServerName string, options *DeletedServersClientBeginRecoverOptions) (DeletedServersClientRecoverPollerResponse, error)

BeginRecover - Recovers a deleted server. If the operation fails it returns an *azcore.ResponseError type. locationName - The name of the region where the resource is located. deletedServerName - The name of the deleted server. options - DeletedServersClientBeginRecoverOptions contains the optional parameters for the DeletedServersClient.BeginRecover method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerRecover.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDeletedServersClient("<subscription-id>", cred, nil)
	poller, err := client.BeginRecover(ctx,
		"<location-name>",
		"<deleted-server-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DeletedServersClientRecoverResult)
}
Output:

func (*DeletedServersClient) Get

func (client *DeletedServersClient) Get(ctx context.Context, locationName string, deletedServerName string, options *DeletedServersClientGetOptions) (DeletedServersClientGetResponse, error)

Get - Gets a deleted server. If the operation fails it returns an *azcore.ResponseError type. locationName - The name of the region where the resource is located. deletedServerName - The name of the deleted server. options - DeletedServersClientGetOptions contains the optional parameters for the DeletedServersClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDeletedServersClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<location-name>",
		"<deleted-server-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.DeletedServersClientGetResult)
}
Output:

func (*DeletedServersClient) List

List - Gets a list of all deleted servers in a subscription. If the operation fails it returns an *azcore.ResponseError type. options - DeletedServersClientListOptions contains the optional parameters for the DeletedServersClient.List method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerListBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDeletedServersClient("<subscription-id>", cred, nil)
	pager := client.List(nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*DeletedServersClient) ListByLocation

ListByLocation - Gets a list of deleted servers for a location. If the operation fails it returns an *azcore.ResponseError type. locationName - The name of the region where the resource is located. options - DeletedServersClientListByLocationOptions contains the optional parameters for the DeletedServersClient.ListByLocation method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewDeletedServersClient("<subscription-id>", cred, nil)
	pager := client.ListByLocation("<location-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type DeletedServersClientBeginRecoverOptions added in v0.3.0

type DeletedServersClientBeginRecoverOptions struct {
}

DeletedServersClientBeginRecoverOptions contains the optional parameters for the DeletedServersClient.BeginRecover method.

type DeletedServersClientGetOptions added in v0.3.0

type DeletedServersClientGetOptions struct {
}

DeletedServersClientGetOptions contains the optional parameters for the DeletedServersClient.Get method.

type DeletedServersClientGetResponse added in v0.3.0

type DeletedServersClientGetResponse struct {
	DeletedServersClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DeletedServersClientGetResponse contains the response from method DeletedServersClient.Get.

type DeletedServersClientGetResult added in v0.3.0

type DeletedServersClientGetResult struct {
	DeletedServer
}

DeletedServersClientGetResult contains the result from method DeletedServersClient.Get.

type DeletedServersClientListByLocationOptions added in v0.3.0

type DeletedServersClientListByLocationOptions struct {
}

DeletedServersClientListByLocationOptions contains the optional parameters for the DeletedServersClient.ListByLocation method.

type DeletedServersClientListByLocationPager added in v0.3.0

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

DeletedServersClientListByLocationPager provides operations for iterating over paged responses.

func (*DeletedServersClientListByLocationPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DeletedServersClientListByLocationPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DeletedServersClientListByLocationPager) PageResponse added in v0.3.0

PageResponse returns the current DeletedServersClientListByLocationResponse page.

type DeletedServersClientListByLocationResponse added in v0.3.0

type DeletedServersClientListByLocationResponse struct {
	DeletedServersClientListByLocationResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DeletedServersClientListByLocationResponse contains the response from method DeletedServersClient.ListByLocation.

type DeletedServersClientListByLocationResult added in v0.3.0

type DeletedServersClientListByLocationResult struct {
	DeletedServerListResult
}

DeletedServersClientListByLocationResult contains the result from method DeletedServersClient.ListByLocation.

type DeletedServersClientListOptions added in v0.3.0

type DeletedServersClientListOptions struct {
}

DeletedServersClientListOptions contains the optional parameters for the DeletedServersClient.List method.

type DeletedServersClientListPager added in v0.3.0

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

DeletedServersClientListPager provides operations for iterating over paged responses.

func (*DeletedServersClientListPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*DeletedServersClientListPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*DeletedServersClientListPager) PageResponse added in v0.3.0

PageResponse returns the current DeletedServersClientListResponse page.

type DeletedServersClientListResponse added in v0.3.0

type DeletedServersClientListResponse struct {
	DeletedServersClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DeletedServersClientListResponse contains the response from method DeletedServersClient.List.

type DeletedServersClientListResult added in v0.3.0

type DeletedServersClientListResult struct {
	DeletedServerListResult
}

DeletedServersClientListResult contains the result from method DeletedServersClient.List.

type DeletedServersClientRecoverPoller added in v0.3.0

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

DeletedServersClientRecoverPoller provides polling facilities until the operation reaches a terminal state.

func (*DeletedServersClientRecoverPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*DeletedServersClientRecoverPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final DeletedServersClientRecoverResponse will be returned.

func (*DeletedServersClientRecoverPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*DeletedServersClientRecoverPoller) ResumeToken added in v0.3.0

func (p *DeletedServersClientRecoverPoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type DeletedServersClientRecoverPollerResponse added in v0.3.0

type DeletedServersClientRecoverPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *DeletedServersClientRecoverPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DeletedServersClientRecoverPollerResponse contains the response from method DeletedServersClient.Recover.

func (DeletedServersClientRecoverPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*DeletedServersClientRecoverPollerResponse) Resume added in v0.3.0

Resume rehydrates a DeletedServersClientRecoverPollerResponse from the provided client and resume token.

type DeletedServersClientRecoverResponse added in v0.3.0

type DeletedServersClientRecoverResponse struct {
	DeletedServersClientRecoverResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

DeletedServersClientRecoverResponse contains the response from method DeletedServersClient.Recover.

type DeletedServersClientRecoverResult added in v0.3.0

type DeletedServersClientRecoverResult struct {
	DeletedServer
}

DeletedServersClientRecoverResult contains the result from method DeletedServersClient.Recover.

type DiffBackupIntervalInHours

type DiffBackupIntervalInHours int32

DiffBackupIntervalInHours - The differential backup interval in hours. This is how many interval hours between each differential backup will be supported. This is only applicable to live databases but not dropped databases.

const (
	DiffBackupIntervalInHoursTwelve     DiffBackupIntervalInHours = 12
	DiffBackupIntervalInHoursTwentyFour DiffBackupIntervalInHours = 24
)

func PossibleDiffBackupIntervalInHoursValues

func PossibleDiffBackupIntervalInHoursValues() []DiffBackupIntervalInHours

PossibleDiffBackupIntervalInHoursValues returns the possible values for the DiffBackupIntervalInHours const type.

func (DiffBackupIntervalInHours) ToPtr

ToPtr returns a *DiffBackupIntervalInHours pointing to the current value.

type EditionCapability

type EditionCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; The database edition name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The read scale capability for the edition.
	ReadScale *ReadScaleCapability `json:"readScale,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; The list of supported service objectives for the edition.
	SupportedServiceLevelObjectives []*ServiceObjectiveCapability `json:"supportedServiceLevelObjectives,omitempty" azure:"ro"`

	// READ-ONLY; The list of supported storage capabilities for this edition
	SupportedStorageCapabilities []*StorageCapability `json:"supportedStorageCapabilities,omitempty" azure:"ro"`

	// READ-ONLY; Whether or not zone redundancy is supported for the edition.
	ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"`
}

EditionCapability - The edition capability.

func (EditionCapability) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EditionCapability.

type ElasticPool

type ElasticPool struct {
	// REQUIRED; Resource location.
	Location *string `json:"location,omitempty"`

	// Resource properties.
	Properties *ElasticPoolProperties `json:"properties,omitempty"`

	// The elastic pool SKU.
	// The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family,
	// and capacity) that are available to your subscription in an Azure region,
	// use the Capabilities_ListByLocation REST API or the following command:
	// az sql elastic-pool list-editions -l <location> -o table
	// `
	SKU *SKU `json:"sku,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Kind of elastic pool. This is metadata used for the Azure portal experience.
	Kind *string `json:"kind,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ElasticPool - An elastic pool.

func (ElasticPool) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ElasticPool.

type ElasticPoolActivitiesClient

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

ElasticPoolActivitiesClient contains the methods for the ElasticPoolActivities group. Don't use this type directly, use NewElasticPoolActivitiesClient() instead.

func NewElasticPoolActivitiesClient

func NewElasticPoolActivitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ElasticPoolActivitiesClient

NewElasticPoolActivitiesClient creates a new instance of ElasticPoolActivitiesClient with the specified values. subscriptionID - The 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 (*ElasticPoolActivitiesClient) ListByElasticPool

ListByElasticPool - Returns elastic pool activities. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. elasticPoolName - The name of the elastic pool for which to get the current activity. options - ElasticPoolActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolActivitiesClient.ListByElasticPool method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolActivityList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewElasticPoolActivitiesClient("<subscription-id>", cred, nil)
	res, err := client.ListByElasticPool(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<elastic-pool-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ElasticPoolActivitiesClientListByElasticPoolResult)
}
Output:

type ElasticPoolActivitiesClientListByElasticPoolOptions added in v0.3.0

type ElasticPoolActivitiesClientListByElasticPoolOptions struct {
}

ElasticPoolActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolActivitiesClient.ListByElasticPool method.

type ElasticPoolActivitiesClientListByElasticPoolResponse added in v0.3.0

type ElasticPoolActivitiesClientListByElasticPoolResponse struct {
	ElasticPoolActivitiesClientListByElasticPoolResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolActivitiesClientListByElasticPoolResponse contains the response from method ElasticPoolActivitiesClient.ListByElasticPool.

type ElasticPoolActivitiesClientListByElasticPoolResult added in v0.3.0

type ElasticPoolActivitiesClientListByElasticPoolResult struct {
	ElasticPoolActivityListResult
}

ElasticPoolActivitiesClientListByElasticPoolResult contains the result from method ElasticPoolActivitiesClient.ListByElasticPool.

type ElasticPoolActivity

type ElasticPoolActivity struct {
	// The geo-location where the resource lives
	Location *string `json:"location,omitempty"`

	// The properties representing the resource.
	Properties *ElasticPoolActivityProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ElasticPoolActivity - Represents the activity on an elastic pool.

type ElasticPoolActivityListResult

type ElasticPoolActivityListResult struct {
	// REQUIRED; The list of elastic pool activities.
	Value []*ElasticPoolActivity `json:"value,omitempty"`
}

ElasticPoolActivityListResult - Represents the response to a list elastic pool activity request.

func (ElasticPoolActivityListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivityListResult.

type ElasticPoolActivityProperties

type ElasticPoolActivityProperties struct {
	// READ-ONLY; The name of the elastic pool.
	ElasticPoolName *string `json:"elasticPoolName,omitempty" azure:"ro"`

	// READ-ONLY; The time the operation finished (ISO8601 format).
	EndTime *time.Time `json:"endTime,omitempty" azure:"ro"`

	// READ-ONLY; The error code if available.
	ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"`

	// READ-ONLY; The error message if available.
	ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"`

	// READ-ONLY; The error severity if available.
	ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"`

	// READ-ONLY; The operation name.
	Operation *string `json:"operation,omitempty" azure:"ro"`

	// READ-ONLY; The unique operation ID.
	OperationID *string `json:"operationId,omitempty" azure:"ro"`

	// READ-ONLY; The percentage complete if available.
	PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"`

	// READ-ONLY; The requested per database DTU cap.
	RequestedDatabaseDtuCap *int32 `json:"requestedDatabaseDtuCap,omitempty" azure:"ro"`

	// READ-ONLY; The requested per database DTU guarantee.
	RequestedDatabaseDtuGuarantee *int32 `json:"requestedDatabaseDtuGuarantee,omitempty" azure:"ro"`

	// READ-ONLY; The requested max DTU per database if available.
	RequestedDatabaseDtuMax *int32 `json:"requestedDatabaseDtuMax,omitempty" azure:"ro"`

	// READ-ONLY; The requested min DTU per database if available.
	RequestedDatabaseDtuMin *int32 `json:"requestedDatabaseDtuMin,omitempty" azure:"ro"`

	// READ-ONLY; The requested DTU for the pool if available.
	RequestedDtu *int32 `json:"requestedDtu,omitempty" azure:"ro"`

	// READ-ONLY; The requested DTU guarantee.
	RequestedDtuGuarantee *int32 `json:"requestedDtuGuarantee,omitempty" azure:"ro"`

	// READ-ONLY; The requested name for the elastic pool if available.
	RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty" azure:"ro"`

	// READ-ONLY; The requested storage limit for the pool in GB if available.
	RequestedStorageLimitInGB *int64 `json:"requestedStorageLimitInGB,omitempty" azure:"ro"`

	// READ-ONLY; The requested storage limit in MB.
	RequestedStorageLimitInMB *int32 `json:"requestedStorageLimitInMB,omitempty" azure:"ro"`

	// READ-ONLY; The name of the server the elastic pool is in.
	ServerName *string `json:"serverName,omitempty" azure:"ro"`

	// READ-ONLY; The time the operation started (ISO8601 format).
	StartTime *time.Time `json:"startTime,omitempty" azure:"ro"`

	// READ-ONLY; The current state of the operation.
	State *string `json:"state,omitempty" azure:"ro"`
}

ElasticPoolActivityProperties - Represents the properties of an elastic pool.

func (ElasticPoolActivityProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivityProperties.

func (*ElasticPoolActivityProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolActivityProperties.

type ElasticPoolDatabaseActivitiesClient

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

ElasticPoolDatabaseActivitiesClient contains the methods for the ElasticPoolDatabaseActivities group. Don't use this type directly, use NewElasticPoolDatabaseActivitiesClient() instead.

func NewElasticPoolDatabaseActivitiesClient

func NewElasticPoolDatabaseActivitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ElasticPoolDatabaseActivitiesClient

NewElasticPoolDatabaseActivitiesClient creates a new instance of ElasticPoolDatabaseActivitiesClient with the specified values. subscriptionID - The 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 (*ElasticPoolDatabaseActivitiesClient) ListByElasticPool

ListByElasticPool - Returns activity on databases inside of an elastic pool. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. elasticPoolName - The name of the elastic pool. options - ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolDatabaseActivitiesClient.ListByElasticPool method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolDatabaseActivityList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewElasticPoolDatabaseActivitiesClient("<subscription-id>", cred, nil)
	res, err := client.ListByElasticPool(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<elastic-pool-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ElasticPoolDatabaseActivitiesClientListByElasticPoolResult)
}
Output:

type ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions added in v0.3.0

type ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions struct {
}

ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolDatabaseActivitiesClient.ListByElasticPool method.

type ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse added in v0.3.0

type ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse struct {
	ElasticPoolDatabaseActivitiesClientListByElasticPoolResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse contains the response from method ElasticPoolDatabaseActivitiesClient.ListByElasticPool.

type ElasticPoolDatabaseActivitiesClientListByElasticPoolResult added in v0.3.0

type ElasticPoolDatabaseActivitiesClientListByElasticPoolResult struct {
	ElasticPoolDatabaseActivityListResult
}

ElasticPoolDatabaseActivitiesClientListByElasticPoolResult contains the result from method ElasticPoolDatabaseActivitiesClient.ListByElasticPool.

type ElasticPoolDatabaseActivity

type ElasticPoolDatabaseActivity struct {
	// The geo-location where the resource lives
	Location *string `json:"location,omitempty"`

	// The properties representing the resource.
	Properties *ElasticPoolDatabaseActivityProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ElasticPoolDatabaseActivity - Represents the activity on an elastic pool.

type ElasticPoolDatabaseActivityListResult

type ElasticPoolDatabaseActivityListResult struct {
	// REQUIRED; The list of elastic pool database activities.
	Value []*ElasticPoolDatabaseActivity `json:"value,omitempty"`
}

ElasticPoolDatabaseActivityListResult - Represents the response to a list elastic pool database activity request.

func (ElasticPoolDatabaseActivityListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ElasticPoolDatabaseActivityListResult.

type ElasticPoolDatabaseActivityProperties

type ElasticPoolDatabaseActivityProperties struct {
	// READ-ONLY; The name of the current elastic pool the database is in if available.
	CurrentElasticPoolName *string `json:"currentElasticPoolName,omitempty" azure:"ro"`

	// READ-ONLY; The name of the current service objective if available.
	CurrentServiceObjective *string `json:"currentServiceObjective,omitempty" azure:"ro"`

	// READ-ONLY; The database name.
	DatabaseName *string `json:"databaseName,omitempty" azure:"ro"`

	// READ-ONLY; The time the operation finished (ISO8601 format).
	EndTime *time.Time `json:"endTime,omitempty" azure:"ro"`

	// READ-ONLY; The error code if available.
	ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"`

	// READ-ONLY; The error message if available.
	ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"`

	// READ-ONLY; The error severity if available.
	ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"`

	// READ-ONLY; The operation name.
	Operation *string `json:"operation,omitempty" azure:"ro"`

	// READ-ONLY; The unique operation ID.
	OperationID *string `json:"operationId,omitempty" azure:"ro"`

	// READ-ONLY; The percentage complete if available.
	PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"`

	// READ-ONLY; The name for the elastic pool the database is moving into if available.
	RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty" azure:"ro"`

	// READ-ONLY; The name of the requested service objective if available.
	RequestedServiceObjective *string `json:"requestedServiceObjective,omitempty" azure:"ro"`

	// READ-ONLY; The name of the server the elastic pool is in.
	ServerName *string `json:"serverName,omitempty" azure:"ro"`

	// READ-ONLY; The time the operation started (ISO8601 format).
	StartTime *time.Time `json:"startTime,omitempty" azure:"ro"`

	// READ-ONLY; The current state of the operation.
	State *string `json:"state,omitempty" azure:"ro"`
}

ElasticPoolDatabaseActivityProperties - Represents the properties of an elastic pool database activity.

func (ElasticPoolDatabaseActivityProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ElasticPoolDatabaseActivityProperties.

func (*ElasticPoolDatabaseActivityProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolDatabaseActivityProperties.

type ElasticPoolEditionCapability

type ElasticPoolEditionCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; The elastic pool edition name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; The list of supported elastic pool DTU levels for the edition.
	SupportedElasticPoolPerformanceLevels []*ElasticPoolPerformanceLevelCapability `json:"supportedElasticPoolPerformanceLevels,omitempty" azure:"ro"`

	// READ-ONLY; Whether or not zone redundancy is supported for the edition.
	ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"`
}

ElasticPoolEditionCapability - The elastic pool edition capability.

func (ElasticPoolEditionCapability) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ElasticPoolEditionCapability.

type ElasticPoolLicenseType

type ElasticPoolLicenseType string

ElasticPoolLicenseType - The license type to apply for this elastic pool.

const (
	ElasticPoolLicenseTypeBasePrice       ElasticPoolLicenseType = "BasePrice"
	ElasticPoolLicenseTypeLicenseIncluded ElasticPoolLicenseType = "LicenseIncluded"
)

func PossibleElasticPoolLicenseTypeValues

func PossibleElasticPoolLicenseTypeValues() []ElasticPoolLicenseType

PossibleElasticPoolLicenseTypeValues returns the possible values for the ElasticPoolLicenseType const type.

func (ElasticPoolLicenseType) ToPtr

ToPtr returns a *ElasticPoolLicenseType pointing to the current value.

type ElasticPoolListResult

type ElasticPoolListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ElasticPool `json:"value,omitempty" azure:"ro"`
}

ElasticPoolListResult - The result of an elastic pool list request.

func (ElasticPoolListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ElasticPoolListResult.

type ElasticPoolOperation

type ElasticPoolOperation struct {
	// Resource properties.
	Properties *ElasticPoolOperationProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ElasticPoolOperation - A elastic pool operation.

type ElasticPoolOperationListResult

type ElasticPoolOperationListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ElasticPoolOperation `json:"value,omitempty" azure:"ro"`
}

ElasticPoolOperationListResult - The response to a list elastic pool operations request

func (ElasticPoolOperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ElasticPoolOperationListResult.

type ElasticPoolOperationProperties

type ElasticPoolOperationProperties struct {
	// READ-ONLY; The operation description.
	Description *string `json:"description,omitempty" azure:"ro"`

	// READ-ONLY; The name of the elastic pool the operation is being performed on.
	ElasticPoolName *string `json:"elasticPoolName,omitempty" azure:"ro"`

	// READ-ONLY; The operation error code.
	ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"`

	// READ-ONLY; The operation error description.
	ErrorDescription *string `json:"errorDescription,omitempty" azure:"ro"`

	// READ-ONLY; The operation error severity.
	ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"`

	// READ-ONLY; The estimated completion time of the operation.
	EstimatedCompletionTime *time.Time `json:"estimatedCompletionTime,omitempty" azure:"ro"`

	// READ-ONLY; Whether the operation can be cancelled.
	IsCancellable *bool `json:"isCancellable,omitempty" azure:"ro"`

	// READ-ONLY; Whether or not the error is a user error.
	IsUserError *bool `json:"isUserError,omitempty" azure:"ro"`

	// READ-ONLY; The name of operation.
	Operation *string `json:"operation,omitempty" azure:"ro"`

	// READ-ONLY; The friendly name of operation.
	OperationFriendlyName *string `json:"operationFriendlyName,omitempty" azure:"ro"`

	// READ-ONLY; The percentage of the operation completed.
	PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"`

	// READ-ONLY; The name of the server.
	ServerName *string `json:"serverName,omitempty" azure:"ro"`

	// READ-ONLY; The operation start time.
	StartTime *time.Time `json:"startTime,omitempty" azure:"ro"`

	// READ-ONLY; The operation state.
	State *string `json:"state,omitempty" azure:"ro"`
}

ElasticPoolOperationProperties - The properties of a elastic pool operation.

func (ElasticPoolOperationProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ElasticPoolOperationProperties.

func (*ElasticPoolOperationProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolOperationProperties.

type ElasticPoolOperationsClient

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

ElasticPoolOperationsClient contains the methods for the ElasticPoolOperations group. Don't use this type directly, use NewElasticPoolOperationsClient() instead.

func NewElasticPoolOperationsClient

func NewElasticPoolOperationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ElasticPoolOperationsClient

NewElasticPoolOperationsClient creates a new instance of ElasticPoolOperationsClient with the specified values. subscriptionID - The 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 (*ElasticPoolOperationsClient) Cancel

func (client *ElasticPoolOperationsClient) Cancel(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, operationID string, options *ElasticPoolOperationsClientCancelOptions) (ElasticPoolOperationsClientCancelResponse, error)

Cancel - Cancels the asynchronous operation on the elastic pool. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. operationID - The operation identifier. options - ElasticPoolOperationsClientCancelOptions contains the optional parameters for the ElasticPoolOperationsClient.Cancel method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelElasticPoolOperation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewElasticPoolOperationsClient("<subscription-id>", cred, nil)
	_, err = client.Cancel(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<elastic-pool-name>",
		"<operation-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ElasticPoolOperationsClient) ListByElasticPool

func (client *ElasticPoolOperationsClient) ListByElasticPool(resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolOperationsClientListByElasticPoolOptions) *ElasticPoolOperationsClientListByElasticPoolPager

ListByElasticPool - Gets a list of operations performed on the elastic pool. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ElasticPoolOperationsClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolOperationsClient.ListByElasticPool method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListElasticPoolOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewElasticPoolOperationsClient("<subscription-id>", cred, nil)
	pager := client.ListByElasticPool("<resource-group-name>",
		"<server-name>",
		"<elastic-pool-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ElasticPoolOperationsClientCancelOptions added in v0.3.0

type ElasticPoolOperationsClientCancelOptions struct {
}

ElasticPoolOperationsClientCancelOptions contains the optional parameters for the ElasticPoolOperationsClient.Cancel method.

type ElasticPoolOperationsClientCancelResponse added in v0.3.0

type ElasticPoolOperationsClientCancelResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolOperationsClientCancelResponse contains the response from method ElasticPoolOperationsClient.Cancel.

type ElasticPoolOperationsClientListByElasticPoolOptions added in v0.3.0

type ElasticPoolOperationsClientListByElasticPoolOptions struct {
}

ElasticPoolOperationsClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolOperationsClient.ListByElasticPool method.

type ElasticPoolOperationsClientListByElasticPoolPager added in v0.3.0

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

ElasticPoolOperationsClientListByElasticPoolPager provides operations for iterating over paged responses.

func (*ElasticPoolOperationsClientListByElasticPoolPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ElasticPoolOperationsClientListByElasticPoolPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ElasticPoolOperationsClientListByElasticPoolPager) PageResponse added in v0.3.0

PageResponse returns the current ElasticPoolOperationsClientListByElasticPoolResponse page.

type ElasticPoolOperationsClientListByElasticPoolResponse added in v0.3.0

type ElasticPoolOperationsClientListByElasticPoolResponse struct {
	ElasticPoolOperationsClientListByElasticPoolResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolOperationsClientListByElasticPoolResponse contains the response from method ElasticPoolOperationsClient.ListByElasticPool.

type ElasticPoolOperationsClientListByElasticPoolResult added in v0.3.0

type ElasticPoolOperationsClientListByElasticPoolResult struct {
	ElasticPoolOperationListResult
}

ElasticPoolOperationsClientListByElasticPoolResult contains the result from method ElasticPoolOperationsClient.ListByElasticPool.

type ElasticPoolPerDatabaseMaxPerformanceLevelCapability

type ElasticPoolPerDatabaseMaxPerformanceLevelCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; The maximum performance level per database.
	Limit *float64 `json:"limit,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; The list of supported min database performance levels.
	SupportedPerDatabaseMinPerformanceLevels []*ElasticPoolPerDatabaseMinPerformanceLevelCapability `json:"supportedPerDatabaseMinPerformanceLevels,omitempty" azure:"ro"`

	// READ-ONLY; Unit type used to measure performance level.
	Unit *PerformanceLevelUnit `json:"unit,omitempty" azure:"ro"`
}

ElasticPoolPerDatabaseMaxPerformanceLevelCapability - The max per-database performance level capability.

func (ElasticPoolPerDatabaseMaxPerformanceLevelCapability) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ElasticPoolPerDatabaseMaxPerformanceLevelCapability.

type ElasticPoolPerDatabaseMinPerformanceLevelCapability

type ElasticPoolPerDatabaseMinPerformanceLevelCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; The minimum performance level per database.
	Limit *float64 `json:"limit,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; Unit type used to measure performance level.
	Unit *PerformanceLevelUnit `json:"unit,omitempty" azure:"ro"`
}

ElasticPoolPerDatabaseMinPerformanceLevelCapability - The minimum per-database performance level capability.

type ElasticPoolPerDatabaseSettings

type ElasticPoolPerDatabaseSettings struct {
	// The maximum capacity any one database can consume.
	MaxCapacity *float64 `json:"maxCapacity,omitempty"`

	// The minimum capacity all databases are guaranteed.
	MinCapacity *float64 `json:"minCapacity,omitempty"`
}

ElasticPoolPerDatabaseSettings - Per database settings of an elastic pool.

type ElasticPoolPerformanceLevelCapability

type ElasticPoolPerformanceLevelCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; The included (free) max size for this performance level.
	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty" azure:"ro"`

	// READ-ONLY; The maximum number of databases supported.
	MaxDatabaseCount *int32 `json:"maxDatabaseCount,omitempty" azure:"ro"`

	// READ-ONLY; The performance level for the pool.
	PerformanceLevel *PerformanceLevelCapability `json:"performanceLevel,omitempty" azure:"ro"`

	// READ-ONLY; The sku.
	SKU *SKU `json:"sku,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; List of supported license types.
	SupportedLicenseTypes []*LicenseTypeCapability `json:"supportedLicenseTypes,omitempty" azure:"ro"`

	// READ-ONLY; List of supported maintenance configurations
	SupportedMaintenanceConfigurations []*MaintenanceConfigurationCapability `json:"supportedMaintenanceConfigurations,omitempty" azure:"ro"`

	// READ-ONLY; The list of supported max sizes.
	SupportedMaxSizes []*MaxSizeRangeCapability `json:"supportedMaxSizes,omitempty" azure:"ro"`

	// READ-ONLY; The list of supported per database max performance levels.
	SupportedPerDatabaseMaxPerformanceLevels []*ElasticPoolPerDatabaseMaxPerformanceLevelCapability `json:"supportedPerDatabaseMaxPerformanceLevels,omitempty" azure:"ro"`

	// READ-ONLY; The list of supported per database max sizes.
	SupportedPerDatabaseMaxSizes []*MaxSizeRangeCapability `json:"supportedPerDatabaseMaxSizes,omitempty" azure:"ro"`

	// READ-ONLY; Whether or not zone redundancy is supported for the performance level.
	ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"`
}

ElasticPoolPerformanceLevelCapability - The Elastic Pool performance level capability.

func (ElasticPoolPerformanceLevelCapability) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ElasticPoolPerformanceLevelCapability.

type ElasticPoolProperties

type ElasticPoolProperties struct {
	// The license type to apply for this elastic pool.
	LicenseType *ElasticPoolLicenseType `json:"licenseType,omitempty"`

	// Maintenance configuration id assigned to the elastic pool. This configuration defines the period when the maintenance updates
	// will will occur.
	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`

	// The storage limit for the database elastic pool in bytes.
	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`

	// The per database settings for the elastic pool.
	PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"`

	// Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across
	// multiple availability zones.
	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`

	// READ-ONLY; The creation date of the elastic pool (ISO8601 format).
	CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"`

	// READ-ONLY; The state of the elastic pool.
	State *ElasticPoolState `json:"state,omitempty" azure:"ro"`
}

ElasticPoolProperties - Properties of an elastic pool

func (ElasticPoolProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ElasticPoolProperties.

func (*ElasticPoolProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolProperties.

type ElasticPoolState

type ElasticPoolState string

ElasticPoolState - The state of the elastic pool.

const (
	ElasticPoolStateCreating ElasticPoolState = "Creating"
	ElasticPoolStateDisabled ElasticPoolState = "Disabled"
	ElasticPoolStateReady    ElasticPoolState = "Ready"
)

func PossibleElasticPoolStateValues

func PossibleElasticPoolStateValues() []ElasticPoolState

PossibleElasticPoolStateValues returns the possible values for the ElasticPoolState const type.

func (ElasticPoolState) ToPtr

ToPtr returns a *ElasticPoolState pointing to the current value.

type ElasticPoolUpdate

type ElasticPoolUpdate struct {
	// Resource properties.
	Properties *ElasticPoolUpdateProperties `json:"properties,omitempty"`

	// An ARM Resource SKU.
	SKU *SKU `json:"sku,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`
}

ElasticPoolUpdate - An elastic pool update.

func (ElasticPoolUpdate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ElasticPoolUpdate.

type ElasticPoolUpdateProperties

type ElasticPoolUpdateProperties struct {
	// The license type to apply for this elastic pool.
	LicenseType *ElasticPoolLicenseType `json:"licenseType,omitempty"`

	// Maintenance configuration id assigned to the elastic pool. This configuration defines the period when the maintenance updates
	// will will occur.
	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`

	// The storage limit for the database elastic pool in bytes.
	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`

	// The per database settings for the elastic pool.
	PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"`

	// Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across
	// multiple availability zones.
	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
}

ElasticPoolUpdateProperties - Properties of an elastic pool

type ElasticPoolsClient

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

ElasticPoolsClient contains the methods for the ElasticPools group. Don't use this type directly, use NewElasticPoolsClient() instead.

func NewElasticPoolsClient

func NewElasticPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ElasticPoolsClient

NewElasticPoolsClient creates a new instance of ElasticPoolsClient with the specified values. subscriptionID - The 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 (*ElasticPoolsClient) BeginCreateOrUpdate

func (client *ElasticPoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPool, options *ElasticPoolsClientBeginCreateOrUpdateOptions) (ElasticPoolsClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates an elastic pool. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. elasticPoolName - The name of the elastic pool. parameters - The elastic pool parameters. options - ElasticPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the ElasticPoolsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ElasticPoolCreateOrUpdateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewElasticPoolsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<elastic-pool-name>",
		armsql.ElasticPool{
			Location: to.StringPtr("<location>"),
			Properties: &armsql.ElasticPoolProperties{
				PerDatabaseSettings: &armsql.ElasticPoolPerDatabaseSettings{
					MaxCapacity: to.Float64Ptr(2),
					MinCapacity: to.Float64Ptr(0.25),
				},
			},
			SKU: &armsql.SKU{
				Name:     to.StringPtr("<name>"),
				Capacity: to.Int32Ptr(2),
				Tier:     to.StringPtr("<tier>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ElasticPoolsClientCreateOrUpdateResult)
}
Output:

func (*ElasticPoolsClient) BeginDelete

func (client *ElasticPoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientBeginDeleteOptions) (ElasticPoolsClientDeletePollerResponse, error)

BeginDelete - Deletes an elastic pool. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. elasticPoolName - The name of the elastic pool. options - ElasticPoolsClientBeginDeleteOptions contains the optional parameters for the ElasticPoolsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ElasticPoolDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewElasticPoolsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<elastic-pool-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ElasticPoolsClient) BeginFailover

func (client *ElasticPoolsClient) BeginFailover(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientBeginFailoverOptions) (ElasticPoolsClientFailoverPollerResponse, error)

BeginFailover - Failovers an elastic pool. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. elasticPoolName - The name of the elastic pool to failover. options - ElasticPoolsClientBeginFailoverOptions contains the optional parameters for the ElasticPoolsClient.BeginFailover method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverElasticPool.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewElasticPoolsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginFailover(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<elastic-pool-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ElasticPoolsClient) BeginUpdate

func (client *ElasticPoolsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPoolUpdate, options *ElasticPoolsClientBeginUpdateOptions) (ElasticPoolsClientUpdatePollerResponse, error)

BeginUpdate - Updates an elastic pool. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. elasticPoolName - The name of the elastic pool. parameters - The elastic pool update parameters. options - ElasticPoolsClientBeginUpdateOptions contains the optional parameters for the ElasticPoolsClient.BeginUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ElasticPoolUpdateAssignMaintenanceConfiguration.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewElasticPoolsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<elastic-pool-name>",
		armsql.ElasticPoolUpdate{
			Properties: &armsql.ElasticPoolUpdateProperties{
				MaintenanceConfigurationID: to.StringPtr("<maintenance-configuration-id>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ElasticPoolsClientUpdateResult)
}
Output:

func (*ElasticPoolsClient) Get

func (client *ElasticPoolsClient) Get(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientGetOptions) (ElasticPoolsClientGetResponse, error)

Get - Gets an elastic pool. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. elasticPoolName - The name of the elastic pool. options - ElasticPoolsClientGetOptions contains the optional parameters for the ElasticPoolsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ElasticPoolGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewElasticPoolsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<elastic-pool-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ElasticPoolsClientGetResult)
}
Output:

func (*ElasticPoolsClient) ListByServer

func (client *ElasticPoolsClient) ListByServer(resourceGroupName string, serverName string, options *ElasticPoolsClientListByServerOptions) *ElasticPoolsClientListByServerPager

ListByServer - Gets all elastic pools in a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ElasticPoolsClientListByServerOptions contains the optional parameters for the ElasticPoolsClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ElasticPoolListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewElasticPoolsClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		&armsql.ElasticPoolsClientListByServerOptions{Skip: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*ElasticPoolsClient) ListMetricDefinitions

func (client *ElasticPoolsClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientListMetricDefinitionsOptions) (ElasticPoolsClientListMetricDefinitionsResponse, error)

ListMetricDefinitions - Returns elastic pool metric definitions. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. elasticPoolName - The name of the elastic pool. options - ElasticPoolsClientListMetricDefinitionsOptions contains the optional parameters for the ElasticPoolsClient.ListMetricDefinitions method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsDefinitionsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewElasticPoolsClient("<subscription-id>", cred, nil)
	res, err := client.ListMetricDefinitions(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<elastic-pool-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ElasticPoolsClientListMetricDefinitionsResult)
}
Output:

func (*ElasticPoolsClient) ListMetrics

func (client *ElasticPoolsClient) ListMetrics(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, filter string, options *ElasticPoolsClientListMetricsOptions) (ElasticPoolsClientListMetricsResponse, error)

ListMetrics - Returns elastic pool metrics. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. elasticPoolName - The name of the elastic pool. filter - An OData filter expression that describes a subset of metrics to return. options - ElasticPoolsClientListMetricsOptions contains the optional parameters for the ElasticPoolsClient.ListMetrics method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsListWithFilter.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewElasticPoolsClient("<subscription-id>", cred, nil)
	res, err := client.ListMetrics(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<elastic-pool-name>",
		"<filter>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ElasticPoolsClientListMetricsResult)
}
Output:

type ElasticPoolsClientBeginCreateOrUpdateOptions added in v0.3.0

type ElasticPoolsClientBeginCreateOrUpdateOptions struct {
}

ElasticPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the ElasticPoolsClient.BeginCreateOrUpdate method.

type ElasticPoolsClientBeginDeleteOptions added in v0.3.0

type ElasticPoolsClientBeginDeleteOptions struct {
}

ElasticPoolsClientBeginDeleteOptions contains the optional parameters for the ElasticPoolsClient.BeginDelete method.

type ElasticPoolsClientBeginFailoverOptions added in v0.3.0

type ElasticPoolsClientBeginFailoverOptions struct {
}

ElasticPoolsClientBeginFailoverOptions contains the optional parameters for the ElasticPoolsClient.BeginFailover method.

type ElasticPoolsClientBeginUpdateOptions added in v0.3.0

type ElasticPoolsClientBeginUpdateOptions struct {
}

ElasticPoolsClientBeginUpdateOptions contains the optional parameters for the ElasticPoolsClient.BeginUpdate method.

type ElasticPoolsClientCreateOrUpdatePoller added in v0.3.0

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

ElasticPoolsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ElasticPoolsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ElasticPoolsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ElasticPoolsClientCreateOrUpdateResponse will be returned.

func (*ElasticPoolsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ElasticPoolsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ElasticPoolsClientCreateOrUpdatePollerResponse added in v0.3.0

type ElasticPoolsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ElasticPoolsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolsClientCreateOrUpdatePollerResponse contains the response from method ElasticPoolsClient.CreateOrUpdate.

func (ElasticPoolsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ElasticPoolsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ElasticPoolsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ElasticPoolsClientCreateOrUpdateResponse added in v0.3.0

type ElasticPoolsClientCreateOrUpdateResponse struct {
	ElasticPoolsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolsClientCreateOrUpdateResponse contains the response from method ElasticPoolsClient.CreateOrUpdate.

type ElasticPoolsClientCreateOrUpdateResult added in v0.3.0

type ElasticPoolsClientCreateOrUpdateResult struct {
	ElasticPool
}

ElasticPoolsClientCreateOrUpdateResult contains the result from method ElasticPoolsClient.CreateOrUpdate.

type ElasticPoolsClientDeletePoller added in v0.3.0

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

ElasticPoolsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*ElasticPoolsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ElasticPoolsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ElasticPoolsClientDeleteResponse will be returned.

func (*ElasticPoolsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ElasticPoolsClientDeletePoller) ResumeToken added in v0.3.0

func (p *ElasticPoolsClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ElasticPoolsClientDeletePollerResponse added in v0.3.0

type ElasticPoolsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ElasticPoolsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolsClientDeletePollerResponse contains the response from method ElasticPoolsClient.Delete.

func (ElasticPoolsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ElasticPoolsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a ElasticPoolsClientDeletePollerResponse from the provided client and resume token.

type ElasticPoolsClientDeleteResponse added in v0.3.0

type ElasticPoolsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolsClientDeleteResponse contains the response from method ElasticPoolsClient.Delete.

type ElasticPoolsClientFailoverPoller added in v0.3.0

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

ElasticPoolsClientFailoverPoller provides polling facilities until the operation reaches a terminal state.

func (*ElasticPoolsClientFailoverPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ElasticPoolsClientFailoverPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ElasticPoolsClientFailoverResponse will be returned.

func (*ElasticPoolsClientFailoverPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ElasticPoolsClientFailoverPoller) ResumeToken added in v0.3.0

func (p *ElasticPoolsClientFailoverPoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ElasticPoolsClientFailoverPollerResponse added in v0.3.0

type ElasticPoolsClientFailoverPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ElasticPoolsClientFailoverPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolsClientFailoverPollerResponse contains the response from method ElasticPoolsClient.Failover.

func (ElasticPoolsClientFailoverPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ElasticPoolsClientFailoverPollerResponse) Resume added in v0.3.0

Resume rehydrates a ElasticPoolsClientFailoverPollerResponse from the provided client and resume token.

type ElasticPoolsClientFailoverResponse added in v0.3.0

type ElasticPoolsClientFailoverResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolsClientFailoverResponse contains the response from method ElasticPoolsClient.Failover.

type ElasticPoolsClientGetOptions added in v0.3.0

type ElasticPoolsClientGetOptions struct {
}

ElasticPoolsClientGetOptions contains the optional parameters for the ElasticPoolsClient.Get method.

type ElasticPoolsClientGetResponse added in v0.3.0

type ElasticPoolsClientGetResponse struct {
	ElasticPoolsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolsClientGetResponse contains the response from method ElasticPoolsClient.Get.

type ElasticPoolsClientGetResult added in v0.3.0

type ElasticPoolsClientGetResult struct {
	ElasticPool
}

ElasticPoolsClientGetResult contains the result from method ElasticPoolsClient.Get.

type ElasticPoolsClientListByServerOptions added in v0.3.0

type ElasticPoolsClientListByServerOptions struct {
	// The number of elements in the collection to skip.
	Skip *int32
}

ElasticPoolsClientListByServerOptions contains the optional parameters for the ElasticPoolsClient.ListByServer method.

type ElasticPoolsClientListByServerPager added in v0.3.0

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

ElasticPoolsClientListByServerPager provides operations for iterating over paged responses.

func (*ElasticPoolsClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ElasticPoolsClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ElasticPoolsClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current ElasticPoolsClientListByServerResponse page.

type ElasticPoolsClientListByServerResponse added in v0.3.0

type ElasticPoolsClientListByServerResponse struct {
	ElasticPoolsClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolsClientListByServerResponse contains the response from method ElasticPoolsClient.ListByServer.

type ElasticPoolsClientListByServerResult added in v0.3.0

type ElasticPoolsClientListByServerResult struct {
	ElasticPoolListResult
}

ElasticPoolsClientListByServerResult contains the result from method ElasticPoolsClient.ListByServer.

type ElasticPoolsClientListMetricDefinitionsOptions added in v0.3.0

type ElasticPoolsClientListMetricDefinitionsOptions struct {
}

ElasticPoolsClientListMetricDefinitionsOptions contains the optional parameters for the ElasticPoolsClient.ListMetricDefinitions method.

type ElasticPoolsClientListMetricDefinitionsResponse added in v0.3.0

type ElasticPoolsClientListMetricDefinitionsResponse struct {
	ElasticPoolsClientListMetricDefinitionsResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolsClientListMetricDefinitionsResponse contains the response from method ElasticPoolsClient.ListMetricDefinitions.

type ElasticPoolsClientListMetricDefinitionsResult added in v0.3.0

type ElasticPoolsClientListMetricDefinitionsResult struct {
	MetricDefinitionListResult
}

ElasticPoolsClientListMetricDefinitionsResult contains the result from method ElasticPoolsClient.ListMetricDefinitions.

type ElasticPoolsClientListMetricsOptions added in v0.3.0

type ElasticPoolsClientListMetricsOptions struct {
}

ElasticPoolsClientListMetricsOptions contains the optional parameters for the ElasticPoolsClient.ListMetrics method.

type ElasticPoolsClientListMetricsResponse added in v0.3.0

type ElasticPoolsClientListMetricsResponse struct {
	ElasticPoolsClientListMetricsResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolsClientListMetricsResponse contains the response from method ElasticPoolsClient.ListMetrics.

type ElasticPoolsClientListMetricsResult added in v0.3.0

type ElasticPoolsClientListMetricsResult struct {
	MetricListResult
}

ElasticPoolsClientListMetricsResult contains the result from method ElasticPoolsClient.ListMetrics.

type ElasticPoolsClientUpdatePoller added in v0.3.0

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

ElasticPoolsClientUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ElasticPoolsClientUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ElasticPoolsClientUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ElasticPoolsClientUpdateResponse will be returned.

func (*ElasticPoolsClientUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ElasticPoolsClientUpdatePoller) ResumeToken added in v0.3.0

func (p *ElasticPoolsClientUpdatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ElasticPoolsClientUpdatePollerResponse added in v0.3.0

type ElasticPoolsClientUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ElasticPoolsClientUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolsClientUpdatePollerResponse contains the response from method ElasticPoolsClient.Update.

func (ElasticPoolsClientUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ElasticPoolsClientUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ElasticPoolsClientUpdatePollerResponse from the provided client and resume token.

type ElasticPoolsClientUpdateResponse added in v0.3.0

type ElasticPoolsClientUpdateResponse struct {
	ElasticPoolsClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ElasticPoolsClientUpdateResponse contains the response from method ElasticPoolsClient.Update.

type ElasticPoolsClientUpdateResult added in v0.3.0

type ElasticPoolsClientUpdateResult struct {
	ElasticPool
}

ElasticPoolsClientUpdateResult contains the result from method ElasticPoolsClient.Update.

type EncryptionProtector

type EncryptionProtector struct {
	// Resource properties.
	Properties *EncryptionProtectorProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
	Kind *string `json:"kind,omitempty" azure:"ro"`

	// READ-ONLY; Resource location.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

EncryptionProtector - The server encryption protector.

type EncryptionProtectorListResult

type EncryptionProtectorListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*EncryptionProtector `json:"value,omitempty" azure:"ro"`
}

EncryptionProtectorListResult - A list of server encryption protectors.

func (EncryptionProtectorListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EncryptionProtectorListResult.

type EncryptionProtectorName

type EncryptionProtectorName string
const (
	EncryptionProtectorNameCurrent EncryptionProtectorName = "current"
)

func PossibleEncryptionProtectorNameValues

func PossibleEncryptionProtectorNameValues() []EncryptionProtectorName

PossibleEncryptionProtectorNameValues returns the possible values for the EncryptionProtectorName const type.

func (EncryptionProtectorName) ToPtr

ToPtr returns a *EncryptionProtectorName pointing to the current value.

type EncryptionProtectorProperties

type EncryptionProtectorProperties struct {
	// REQUIRED; The encryption protector type like 'ServiceManaged', 'AzureKeyVault'.
	ServerKeyType *ServerKeyType `json:"serverKeyType,omitempty"`

	// Key auto rotation opt-in flag. Either true or false.
	AutoRotationEnabled *bool `json:"autoRotationEnabled,omitempty"`

	// The name of the server key.
	ServerKeyName *string `json:"serverKeyName,omitempty"`

	// READ-ONLY; Subregion of the encryption protector.
	Subregion *string `json:"subregion,omitempty" azure:"ro"`

	// READ-ONLY; Thumbprint of the server key.
	Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"`

	// READ-ONLY; The URI of the server key.
	URI *string `json:"uri,omitempty" azure:"ro"`
}

EncryptionProtectorProperties - Properties for an encryption protector execution.

type EncryptionProtectorsClient

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

EncryptionProtectorsClient contains the methods for the EncryptionProtectors group. Don't use this type directly, use NewEncryptionProtectorsClient() instead.

func NewEncryptionProtectorsClient

func NewEncryptionProtectorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *EncryptionProtectorsClient

NewEncryptionProtectorsClient creates a new instance of EncryptionProtectorsClient with the specified values. subscriptionID - The 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 (*EncryptionProtectorsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Updates an existing encryption protector. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. encryptionProtectorName - The name of the encryption protector to be updated. parameters - The requested encryption protector resource state. options - EncryptionProtectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the EncryptionProtectorsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorCreateOrUpdateKeyVault.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewEncryptionProtectorsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.EncryptionProtectorName("current"),
		armsql.EncryptionProtector{
			Properties: &armsql.EncryptionProtectorProperties{
				AutoRotationEnabled: to.BoolPtr(false),
				ServerKeyName:       to.StringPtr("<server-key-name>"),
				ServerKeyType:       armsql.ServerKeyType("AzureKeyVault").ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.EncryptionProtectorsClientCreateOrUpdateResult)
}
Output:

func (*EncryptionProtectorsClient) BeginRevalidate

BeginRevalidate - Revalidates an existing encryption protector. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. encryptionProtectorName - The name of the encryption protector to be updated. options - EncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the EncryptionProtectorsClient.BeginRevalidate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorRevalidate.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewEncryptionProtectorsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginRevalidate(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.EncryptionProtectorName("current"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*EncryptionProtectorsClient) Get

func (client *EncryptionProtectorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, encryptionProtectorName EncryptionProtectorName, options *EncryptionProtectorsClientGetOptions) (EncryptionProtectorsClientGetResponse, error)

Get - Gets a server encryption protector. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. encryptionProtectorName - The name of the encryption protector to be retrieved. options - EncryptionProtectorsClientGetOptions contains the optional parameters for the EncryptionProtectorsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewEncryptionProtectorsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.EncryptionProtectorName("current"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.EncryptionProtectorsClientGetResult)
}
Output:

func (*EncryptionProtectorsClient) ListByServer

ListByServer - Gets a list of server encryption protectors If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - EncryptionProtectorsClientListByServerOptions contains the optional parameters for the EncryptionProtectorsClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewEncryptionProtectorsClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type EncryptionProtectorsClientBeginCreateOrUpdateOptions added in v0.3.0

type EncryptionProtectorsClientBeginCreateOrUpdateOptions struct {
}

EncryptionProtectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the EncryptionProtectorsClient.BeginCreateOrUpdate method.

type EncryptionProtectorsClientBeginRevalidateOptions added in v0.3.0

type EncryptionProtectorsClientBeginRevalidateOptions struct {
}

EncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the EncryptionProtectorsClient.BeginRevalidate method.

type EncryptionProtectorsClientCreateOrUpdatePoller added in v0.3.0

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

EncryptionProtectorsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*EncryptionProtectorsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*EncryptionProtectorsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final EncryptionProtectorsClientCreateOrUpdateResponse will be returned.

func (*EncryptionProtectorsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*EncryptionProtectorsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type EncryptionProtectorsClientCreateOrUpdatePollerResponse added in v0.3.0

type EncryptionProtectorsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *EncryptionProtectorsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

EncryptionProtectorsClientCreateOrUpdatePollerResponse contains the response from method EncryptionProtectorsClient.CreateOrUpdate.

func (EncryptionProtectorsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*EncryptionProtectorsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a EncryptionProtectorsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type EncryptionProtectorsClientCreateOrUpdateResponse added in v0.3.0

type EncryptionProtectorsClientCreateOrUpdateResponse struct {
	EncryptionProtectorsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

EncryptionProtectorsClientCreateOrUpdateResponse contains the response from method EncryptionProtectorsClient.CreateOrUpdate.

type EncryptionProtectorsClientCreateOrUpdateResult added in v0.3.0

type EncryptionProtectorsClientCreateOrUpdateResult struct {
	EncryptionProtector
}

EncryptionProtectorsClientCreateOrUpdateResult contains the result from method EncryptionProtectorsClient.CreateOrUpdate.

type EncryptionProtectorsClientGetOptions added in v0.3.0

type EncryptionProtectorsClientGetOptions struct {
}

EncryptionProtectorsClientGetOptions contains the optional parameters for the EncryptionProtectorsClient.Get method.

type EncryptionProtectorsClientGetResponse added in v0.3.0

type EncryptionProtectorsClientGetResponse struct {
	EncryptionProtectorsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

EncryptionProtectorsClientGetResponse contains the response from method EncryptionProtectorsClient.Get.

type EncryptionProtectorsClientGetResult added in v0.3.0

type EncryptionProtectorsClientGetResult struct {
	EncryptionProtector
}

EncryptionProtectorsClientGetResult contains the result from method EncryptionProtectorsClient.Get.

type EncryptionProtectorsClientListByServerOptions added in v0.3.0

type EncryptionProtectorsClientListByServerOptions struct {
}

EncryptionProtectorsClientListByServerOptions contains the optional parameters for the EncryptionProtectorsClient.ListByServer method.

type EncryptionProtectorsClientListByServerPager added in v0.3.0

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

EncryptionProtectorsClientListByServerPager provides operations for iterating over paged responses.

func (*EncryptionProtectorsClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*EncryptionProtectorsClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*EncryptionProtectorsClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current EncryptionProtectorsClientListByServerResponse page.

type EncryptionProtectorsClientListByServerResponse added in v0.3.0

type EncryptionProtectorsClientListByServerResponse struct {
	EncryptionProtectorsClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

EncryptionProtectorsClientListByServerResponse contains the response from method EncryptionProtectorsClient.ListByServer.

type EncryptionProtectorsClientListByServerResult added in v0.3.0

type EncryptionProtectorsClientListByServerResult struct {
	EncryptionProtectorListResult
}

EncryptionProtectorsClientListByServerResult contains the result from method EncryptionProtectorsClient.ListByServer.

type EncryptionProtectorsClientRevalidatePoller added in v0.3.0

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

EncryptionProtectorsClientRevalidatePoller provides polling facilities until the operation reaches a terminal state.

func (*EncryptionProtectorsClientRevalidatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*EncryptionProtectorsClientRevalidatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final EncryptionProtectorsClientRevalidateResponse will be returned.

func (*EncryptionProtectorsClientRevalidatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*EncryptionProtectorsClientRevalidatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type EncryptionProtectorsClientRevalidatePollerResponse added in v0.3.0

type EncryptionProtectorsClientRevalidatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *EncryptionProtectorsClientRevalidatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

EncryptionProtectorsClientRevalidatePollerResponse contains the response from method EncryptionProtectorsClient.Revalidate.

func (EncryptionProtectorsClientRevalidatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*EncryptionProtectorsClientRevalidatePollerResponse) Resume added in v0.3.0

Resume rehydrates a EncryptionProtectorsClientRevalidatePollerResponse from the provided client and resume token.

type EncryptionProtectorsClientRevalidateResponse added in v0.3.0

type EncryptionProtectorsClientRevalidateResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

EncryptionProtectorsClientRevalidateResponse contains the response from method EncryptionProtectorsClient.Revalidate.

type ExportDatabaseDefinition

type ExportDatabaseDefinition struct {
	// REQUIRED; Administrator login name.
	AdministratorLogin *string `json:"administratorLogin,omitempty"`

	// REQUIRED; Administrator login password.
	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`

	// REQUIRED; Storage key.
	StorageKey *string `json:"storageKey,omitempty"`

	// REQUIRED; Storage key type.
	StorageKeyType *StorageKeyType `json:"storageKeyType,omitempty"`

	// REQUIRED; Storage Uri.
	StorageURI *string `json:"storageUri,omitempty"`

	// Authentication type.
	AuthenticationType *string `json:"authenticationType,omitempty"`

	// Optional resource information to enable network isolation for request.
	NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"`
}

ExportDatabaseDefinition - Contains the information necessary to perform export database operation.

type ExtendedDatabaseBlobAuditingPoliciesClient

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

ExtendedDatabaseBlobAuditingPoliciesClient contains the methods for the ExtendedDatabaseBlobAuditingPolicies group. Don't use this type directly, use NewExtendedDatabaseBlobAuditingPoliciesClient() instead.

func NewExtendedDatabaseBlobAuditingPoliciesClient

func NewExtendedDatabaseBlobAuditingPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ExtendedDatabaseBlobAuditingPoliciesClient

NewExtendedDatabaseBlobAuditingPoliciesClient creates a new instance of ExtendedDatabaseBlobAuditingPoliciesClient with the specified values. subscriptionID - The 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 (*ExtendedDatabaseBlobAuditingPoliciesClient) CreateOrUpdate

CreateOrUpdate - Creates or updates an extended database's blob auditing policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. parameters - The extended database blob auditing policy. options - ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ExtendedDatabaseAzureMonitorAuditingCreateMin.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewExtendedDatabaseBlobAuditingPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.ExtendedDatabaseBlobAuditingPolicy{
			Properties: &armsql.ExtendedDatabaseBlobAuditingPolicyProperties{
				IsAzureMonitorTargetEnabled: to.BoolPtr(true),
				State:                       armsql.BlobAuditingPolicyStateEnabled.ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResult)
}
Output:

func (*ExtendedDatabaseBlobAuditingPoliciesClient) Get

Get - Gets an extended database's blob auditing policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - ExtendedDatabaseBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ExtendedDatabaseBlobAuditingGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewExtendedDatabaseBlobAuditingPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ExtendedDatabaseBlobAuditingPoliciesClientGetResult)
}
Output:

func (*ExtendedDatabaseBlobAuditingPoliciesClient) ListByDatabase

ListByDatabase - Lists extended auditing settings of a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseExtendedAuditingSettingsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewExtendedDatabaseBlobAuditingPoliciesClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions added in v0.3.0

type ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions struct {
}

ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.CreateOrUpdate method.

type ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse added in v0.3.0

type ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse struct {
	ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse contains the response from method ExtendedDatabaseBlobAuditingPoliciesClient.CreateOrUpdate.

type ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResult added in v0.3.0

type ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResult struct {
	ExtendedDatabaseBlobAuditingPolicy
}

ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResult contains the result from method ExtendedDatabaseBlobAuditingPoliciesClient.CreateOrUpdate.

type ExtendedDatabaseBlobAuditingPoliciesClientGetOptions added in v0.3.0

type ExtendedDatabaseBlobAuditingPoliciesClientGetOptions struct {
}

ExtendedDatabaseBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.Get method.

type ExtendedDatabaseBlobAuditingPoliciesClientGetResponse added in v0.3.0

type ExtendedDatabaseBlobAuditingPoliciesClientGetResponse struct {
	ExtendedDatabaseBlobAuditingPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ExtendedDatabaseBlobAuditingPoliciesClientGetResponse contains the response from method ExtendedDatabaseBlobAuditingPoliciesClient.Get.

type ExtendedDatabaseBlobAuditingPoliciesClientGetResult added in v0.3.0

type ExtendedDatabaseBlobAuditingPoliciesClientGetResult struct {
	ExtendedDatabaseBlobAuditingPolicy
}

ExtendedDatabaseBlobAuditingPoliciesClientGetResult contains the result from method ExtendedDatabaseBlobAuditingPoliciesClient.Get.

type ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseOptions added in v0.3.0

type ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseOptions struct {
}

ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.ListByDatabase method.

type ExtendedDatabaseBlobAuditingPoliciesClientListByDatabasePager added in v0.3.0

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

ExtendedDatabaseBlobAuditingPoliciesClientListByDatabasePager provides operations for iterating over paged responses.

func (*ExtendedDatabaseBlobAuditingPoliciesClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ExtendedDatabaseBlobAuditingPoliciesClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ExtendedDatabaseBlobAuditingPoliciesClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResponse page.

type ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResponse added in v0.3.0

type ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResponse struct {
	ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResponse contains the response from method ExtendedDatabaseBlobAuditingPoliciesClient.ListByDatabase.

type ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResult added in v0.3.0

type ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResult struct {
	ExtendedDatabaseBlobAuditingPolicyListResult
}

ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResult contains the result from method ExtendedDatabaseBlobAuditingPoliciesClient.ListByDatabase.

type ExtendedDatabaseBlobAuditingPolicy

type ExtendedDatabaseBlobAuditingPolicy struct {
	// Resource properties.
	Properties *ExtendedDatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ExtendedDatabaseBlobAuditingPolicy - An extended database blob auditing policy.

type ExtendedDatabaseBlobAuditingPolicyListResult

type ExtendedDatabaseBlobAuditingPolicyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ExtendedDatabaseBlobAuditingPolicy `json:"value,omitempty" azure:"ro"`
}

ExtendedDatabaseBlobAuditingPolicyListResult - A list of database extended auditing settings.

func (ExtendedDatabaseBlobAuditingPolicyListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ExtendedDatabaseBlobAuditingPolicyListResult.

type ExtendedDatabaseBlobAuditingPolicyProperties

type ExtendedDatabaseBlobAuditingPolicyProperties struct {
	// REQUIRED; Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
	State *BlobAuditingPolicyState `json:"state,omitempty"`

	// Specifies the Actions-Groups and Actions to audit.
	// The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures
	// executed against the database, as well as successful and failed logins:
	// BATCHCOMPLETEDGROUP, SUCCESSFULDATABASEAUTHENTICATIONGROUP, FAILEDDATABASEAUTHENTICATIONGROUP.
	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
	// The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary
	// groups could lead to very large quantities of audit records):
	// APPLICATIONROLECHANGEPASSWORDGROUP BACKUPRESTOREGROUP DATABASELOGOUTGROUP DATABASEOBJECTCHANGEGROUP DATABASEOBJECTOWNERSHIPCHANGEGROUP
	// DATABASEOBJECTPERMISSIONCHANGEGROUP DATABASEOPERATIONGROUP
	// DATABASEPERMISSIONCHANGEGROUP DATABASEPRINCIPALCHANGEGROUP DATABASEPRINCIPALIMPERSONATIONGROUP DATABASEROLEMEMBERCHANGEGROUP
	// FAILEDDATABASEAUTHENTICATIONGROUP SCHEMAOBJECTACCESSGROUP SCHEMAOBJECT
	// CHANGEGROUP SCHEMAOBJECTOWNERSHIPCHANGEGROUP SCHEMAOBJECTPERMISSIONCHANGEGROUP SUCCESSFULDATABASEAUTHENTICATIONGROUP USERCHANGEPASSWORDGROUP
	// BATCHSTARTEDGROUP BATCHCOMPLETED_GROUP
	// These are groups that cover all sql statements and stored procedures executed against the database, and should not be used
	// in combination with other groups as this will result in duplicate audit logs.
	// For more information, see Database-Level Audit Action Groups
	// [https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups].
	// For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server
	// auditing policy). The supported actions to audit are: SELECT UPDATE INSERT DELETE
	// EXECUTE RECEIVE REFERENCES
	// The general form for defining an action to be audited is: {action} ON {object} BY {principal}
	// Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or
	// schema. For the latter cases, the forms DATABASE::{dbname} and SCHEMA::{schema
	// name} are used, respectively.
	// For example: SELECT on dbo.myTable by public SELECT on DATABASE::myDatabase by public SELECT on SCHEMA::mySchema by public
	// For more information, see Database-Level Audit Actions
	// [https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions]
	AuditActionsAndGroups []*string `json:"auditActionsAndGroups,omitempty"`

	// Specifies whether audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify 'State'
	// as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on
	// the database should be also created. Note that for server level audit you
	// should use the 'master' database as {databaseName}.
	// Diagnostic Settings URI format: PUT
	// https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
	// For more information, see Diagnostic Settings REST API [https://go.microsoft.com/fwlink/?linkid=2033207]or Diagnostic Settings
	// PowerShell [https://go.microsoft.com/fwlink/?linkid=2033043]
	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`

	// Specifies whether storageAccountAccessKey value is the storage's secondary key.
	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`

	// Specifies condition of where clause when creating an audit.
	PredicateExpression *string `json:"predicateExpression,omitempty"`

	// Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. The default
	// minimum value is 1000 (1 second). The maximum is 2,147,483,647.
	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`

	// Specifies the number of days to keep in the audit logs in the storage account.
	RetentionDays *int32 `json:"retentionDays,omitempty"`

	// Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, not
	// specifying the storageAccountAccessKey will use SQL server system-assigned
	// managed identity to access the storage. Prerequisites for using managed identity authentication:
	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server
	// identity. For more information, see Auditing to storage using Managed
	// Identity authentication [https://go.microsoft.com/fwlink/?linkid=2114355]
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`

	// Specifies the blob storage subscription Id.
	StorageAccountSubscriptionID *string `json:"storageAccountSubscriptionId,omitempty"`

	// Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint
	// or isAzureMonitorTargetEnabled is required.
	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
}

ExtendedDatabaseBlobAuditingPolicyProperties - Properties of an extended database blob auditing policy.

func (ExtendedDatabaseBlobAuditingPolicyProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ExtendedDatabaseBlobAuditingPolicyProperties.

type ExtendedServerBlobAuditingPoliciesClient

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

ExtendedServerBlobAuditingPoliciesClient contains the methods for the ExtendedServerBlobAuditingPolicies group. Don't use this type directly, use NewExtendedServerBlobAuditingPoliciesClient() instead.

func NewExtendedServerBlobAuditingPoliciesClient

func NewExtendedServerBlobAuditingPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ExtendedServerBlobAuditingPoliciesClient

NewExtendedServerBlobAuditingPoliciesClient creates a new instance of ExtendedServerBlobAuditingPoliciesClient with the specified values. subscriptionID - The 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 (*ExtendedServerBlobAuditingPoliciesClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates an extended server's blob auditing policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. parameters - Properties of extended blob auditing policy options - ExtendedServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ExtendedServerBlobAuditingCreateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewExtendedServerBlobAuditingPoliciesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.ExtendedServerBlobAuditingPolicy{
			Properties: &armsql.ExtendedServerBlobAuditingPolicyProperties{
				AuditActionsAndGroups: []*string{
					to.StringPtr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"),
					to.StringPtr("FAILED_DATABASE_AUTHENTICATION_GROUP"),
					to.StringPtr("BATCH_COMPLETED_GROUP")},
				IsAzureMonitorTargetEnabled:  to.BoolPtr(true),
				IsStorageSecondaryKeyInUse:   to.BoolPtr(false),
				PredicateExpression:          to.StringPtr("<predicate-expression>"),
				QueueDelayMs:                 to.Int32Ptr(4000),
				RetentionDays:                to.Int32Ptr(6),
				State:                        armsql.BlobAuditingPolicyStateEnabled.ToPtr(),
				StorageAccountAccessKey:      to.StringPtr("<storage-account-access-key>"),
				StorageAccountSubscriptionID: to.StringPtr("<storage-account-subscription-id>"),
				StorageEndpoint:              to.StringPtr("<storage-endpoint>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResult)
}
Output:

func (*ExtendedServerBlobAuditingPoliciesClient) Get

Get - Gets an extended server's blob auditing policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ExtendedServerBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ExtendedServerBlobAuditingGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewExtendedServerBlobAuditingPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ExtendedServerBlobAuditingPoliciesClientGetResult)
}
Output:

func (*ExtendedServerBlobAuditingPoliciesClient) ListByServer

ListByServer - Lists extended auditing settings of a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ExtendedServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerExtendedAuditingSettingsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewExtendedServerBlobAuditingPoliciesClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ExtendedServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions added in v0.3.0

type ExtendedServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions struct {
}

ExtendedServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.BeginCreateOrUpdate method.

type ExtendedServerBlobAuditingPoliciesClientCreateOrUpdatePoller added in v0.3.0

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

ExtendedServerBlobAuditingPoliciesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ExtendedServerBlobAuditingPoliciesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ExtendedServerBlobAuditingPoliciesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResponse will be returned.

func (*ExtendedServerBlobAuditingPoliciesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ExtendedServerBlobAuditingPoliciesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ExtendedServerBlobAuditingPoliciesClientCreateOrUpdatePollerResponse added in v0.3.0

type ExtendedServerBlobAuditingPoliciesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ExtendedServerBlobAuditingPoliciesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ExtendedServerBlobAuditingPoliciesClientCreateOrUpdatePollerResponse contains the response from method ExtendedServerBlobAuditingPoliciesClient.CreateOrUpdate.

func (ExtendedServerBlobAuditingPoliciesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ExtendedServerBlobAuditingPoliciesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ExtendedServerBlobAuditingPoliciesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResponse added in v0.3.0

type ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResponse struct {
	ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResponse contains the response from method ExtendedServerBlobAuditingPoliciesClient.CreateOrUpdate.

type ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResult added in v0.3.0

type ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResult struct {
	ExtendedServerBlobAuditingPolicy
}

ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResult contains the result from method ExtendedServerBlobAuditingPoliciesClient.CreateOrUpdate.

type ExtendedServerBlobAuditingPoliciesClientGetOptions added in v0.3.0

type ExtendedServerBlobAuditingPoliciesClientGetOptions struct {
}

ExtendedServerBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.Get method.

type ExtendedServerBlobAuditingPoliciesClientGetResponse added in v0.3.0

type ExtendedServerBlobAuditingPoliciesClientGetResponse struct {
	ExtendedServerBlobAuditingPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ExtendedServerBlobAuditingPoliciesClientGetResponse contains the response from method ExtendedServerBlobAuditingPoliciesClient.Get.

type ExtendedServerBlobAuditingPoliciesClientGetResult added in v0.3.0

type ExtendedServerBlobAuditingPoliciesClientGetResult struct {
	ExtendedServerBlobAuditingPolicy
}

ExtendedServerBlobAuditingPoliciesClientGetResult contains the result from method ExtendedServerBlobAuditingPoliciesClient.Get.

type ExtendedServerBlobAuditingPoliciesClientListByServerOptions added in v0.3.0

type ExtendedServerBlobAuditingPoliciesClientListByServerOptions struct {
}

ExtendedServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.ListByServer method.

type ExtendedServerBlobAuditingPoliciesClientListByServerPager added in v0.3.0

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

ExtendedServerBlobAuditingPoliciesClientListByServerPager provides operations for iterating over paged responses.

func (*ExtendedServerBlobAuditingPoliciesClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ExtendedServerBlobAuditingPoliciesClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ExtendedServerBlobAuditingPoliciesClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current ExtendedServerBlobAuditingPoliciesClientListByServerResponse page.

type ExtendedServerBlobAuditingPoliciesClientListByServerResponse added in v0.3.0

type ExtendedServerBlobAuditingPoliciesClientListByServerResponse struct {
	ExtendedServerBlobAuditingPoliciesClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ExtendedServerBlobAuditingPoliciesClientListByServerResponse contains the response from method ExtendedServerBlobAuditingPoliciesClient.ListByServer.

type ExtendedServerBlobAuditingPoliciesClientListByServerResult added in v0.3.0

type ExtendedServerBlobAuditingPoliciesClientListByServerResult struct {
	ExtendedServerBlobAuditingPolicyListResult
}

ExtendedServerBlobAuditingPoliciesClientListByServerResult contains the result from method ExtendedServerBlobAuditingPoliciesClient.ListByServer.

type ExtendedServerBlobAuditingPolicy

type ExtendedServerBlobAuditingPolicy struct {
	// Resource properties.
	Properties *ExtendedServerBlobAuditingPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ExtendedServerBlobAuditingPolicy - An extended server blob auditing policy.

type ExtendedServerBlobAuditingPolicyListResult

type ExtendedServerBlobAuditingPolicyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ExtendedServerBlobAuditingPolicy `json:"value,omitempty" azure:"ro"`
}

ExtendedServerBlobAuditingPolicyListResult - A list of server extended auditing settings.

func (ExtendedServerBlobAuditingPolicyListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ExtendedServerBlobAuditingPolicyListResult.

type ExtendedServerBlobAuditingPolicyProperties

type ExtendedServerBlobAuditingPolicyProperties struct {
	// REQUIRED; Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
	State *BlobAuditingPolicyState `json:"state,omitempty"`

	// Specifies the Actions-Groups and Actions to audit.
	// The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures
	// executed against the database, as well as successful and failed logins:
	// BATCHCOMPLETEDGROUP, SUCCESSFULDATABASEAUTHENTICATIONGROUP, FAILEDDATABASEAUTHENTICATIONGROUP.
	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
	// The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary
	// groups could lead to very large quantities of audit records):
	// APPLICATIONROLECHANGEPASSWORDGROUP BACKUPRESTOREGROUP DATABASELOGOUTGROUP DATABASEOBJECTCHANGEGROUP DATABASEOBJECTOWNERSHIPCHANGEGROUP
	// DATABASEOBJECTPERMISSIONCHANGEGROUP DATABASEOPERATIONGROUP
	// DATABASEPERMISSIONCHANGEGROUP DATABASEPRINCIPALCHANGEGROUP DATABASEPRINCIPALIMPERSONATIONGROUP DATABASEROLEMEMBERCHANGEGROUP
	// FAILEDDATABASEAUTHENTICATIONGROUP SCHEMAOBJECTACCESSGROUP SCHEMAOBJECT
	// CHANGEGROUP SCHEMAOBJECTOWNERSHIPCHANGEGROUP SCHEMAOBJECTPERMISSIONCHANGEGROUP SUCCESSFULDATABASEAUTHENTICATIONGROUP USERCHANGEPASSWORDGROUP
	// BATCHSTARTEDGROUP BATCHCOMPLETED_GROUP
	// These are groups that cover all sql statements and stored procedures executed against the database, and should not be used
	// in combination with other groups as this will result in duplicate audit logs.
	// For more information, see Database-Level Audit Action Groups
	// [https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups].
	// For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server
	// auditing policy). The supported actions to audit are: SELECT UPDATE INSERT DELETE
	// EXECUTE RECEIVE REFERENCES
	// The general form for defining an action to be audited is: {action} ON {object} BY {principal}
	// Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or
	// schema. For the latter cases, the forms DATABASE::{dbname} and SCHEMA::{schema
	// name} are used, respectively.
	// For example: SELECT on dbo.myTable by public SELECT on DATABASE::myDatabase by public SELECT on SCHEMA::mySchema by public
	// For more information, see Database-Level Audit Actions
	// [https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions]
	AuditActionsAndGroups []*string `json:"auditActionsAndGroups,omitempty"`

	// Specifies whether audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify 'State'
	// as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on
	// the database should be also created. Note that for server level audit you
	// should use the 'master' database as {databaseName}.
	// Diagnostic Settings URI format: PUT
	// https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
	// For more information, see Diagnostic Settings REST API [https://go.microsoft.com/fwlink/?linkid=2033207]or Diagnostic Settings
	// PowerShell [https://go.microsoft.com/fwlink/?linkid=2033043]
	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`

	// Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure Monitor. In order to send the
	// events to Azure Monitor, specify 'State' as 'Enabled',
	// 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true
	// When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on
	// the master database should also be created.
	// Diagnostic Settings URI format: PUT
	// https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
	// For more information, see Diagnostic Settings REST API [https://go.microsoft.com/fwlink/?linkid=2033207]or Diagnostic Settings
	// PowerShell [https://go.microsoft.com/fwlink/?linkid=2033043]
	IsDevopsAuditEnabled *bool `json:"isDevopsAuditEnabled,omitempty"`

	// Specifies whether storageAccountAccessKey value is the storage's secondary key.
	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`

	// Specifies condition of where clause when creating an audit.
	PredicateExpression *string `json:"predicateExpression,omitempty"`

	// Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. The default
	// minimum value is 1000 (1 second). The maximum is 2,147,483,647.
	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`

	// Specifies the number of days to keep in the audit logs in the storage account.
	RetentionDays *int32 `json:"retentionDays,omitempty"`

	// Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, not
	// specifying the storageAccountAccessKey will use SQL server system-assigned
	// managed identity to access the storage. Prerequisites for using managed identity authentication:
	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server
	// identity. For more information, see Auditing to storage using Managed
	// Identity authentication [https://go.microsoft.com/fwlink/?linkid=2114355]
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`

	// Specifies the blob storage subscription Id.
	StorageAccountSubscriptionID *string `json:"storageAccountSubscriptionId,omitempty"`

	// Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint
	// or isAzureMonitorTargetEnabled is required.
	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
}

ExtendedServerBlobAuditingPolicyProperties - Properties of an extended server blob auditing policy.

func (ExtendedServerBlobAuditingPolicyProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ExtendedServerBlobAuditingPolicyProperties.

type FailoverGroup

type FailoverGroup struct {
	// Resource properties.
	Properties *FailoverGroupProperties `json:"properties,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource location.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

FailoverGroup - A failover group.

func (FailoverGroup) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type FailoverGroup.

type FailoverGroupListResult

type FailoverGroupListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*FailoverGroup `json:"value,omitempty" azure:"ro"`
}

FailoverGroupListResult - A list of failover groups.

func (FailoverGroupListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type FailoverGroupListResult.

type FailoverGroupProperties

type FailoverGroupProperties struct {
	// REQUIRED; List of partner server information for the failover group.
	PartnerServers []*PartnerInfo `json:"partnerServers,omitempty"`

	// REQUIRED; Read-write endpoint of the failover group instance.
	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`

	// List of databases in the failover group.
	Databases []*string `json:"databases,omitempty"`

	// Read-only endpoint of the failover group instance.
	ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`

	// READ-ONLY; Local replication role of the failover group instance.
	ReplicationRole *FailoverGroupReplicationRole `json:"replicationRole,omitempty" azure:"ro"`

	// READ-ONLY; Replication state of the failover group instance.
	ReplicationState *string `json:"replicationState,omitempty" azure:"ro"`
}

FailoverGroupProperties - Properties of a failover group.

func (FailoverGroupProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type FailoverGroupProperties.

type FailoverGroupReadOnlyEndpoint

type FailoverGroupReadOnlyEndpoint struct {
	// Failover policy of the read-only endpoint for the failover group.
	FailoverPolicy *ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
}

FailoverGroupReadOnlyEndpoint - Read-only endpoint of the failover group instance.

type FailoverGroupReadWriteEndpoint

type FailoverGroupReadWriteEndpoint struct {
	// REQUIRED; Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes
	// is required.
	FailoverPolicy *ReadWriteEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`

	// Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then
	// failoverWithDataLossGracePeriodMinutes is required.
	FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"`
}

FailoverGroupReadWriteEndpoint - Read-write endpoint of the failover group instance.

type FailoverGroupReplicationRole

type FailoverGroupReplicationRole string

FailoverGroupReplicationRole - Local replication role of the failover group instance.

const (
	FailoverGroupReplicationRolePrimary   FailoverGroupReplicationRole = "Primary"
	FailoverGroupReplicationRoleSecondary FailoverGroupReplicationRole = "Secondary"
)

func PossibleFailoverGroupReplicationRoleValues

func PossibleFailoverGroupReplicationRoleValues() []FailoverGroupReplicationRole

PossibleFailoverGroupReplicationRoleValues returns the possible values for the FailoverGroupReplicationRole const type.

func (FailoverGroupReplicationRole) ToPtr

ToPtr returns a *FailoverGroupReplicationRole pointing to the current value.

type FailoverGroupUpdate

type FailoverGroupUpdate struct {
	// Resource properties.
	Properties *FailoverGroupUpdateProperties `json:"properties,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`
}

FailoverGroupUpdate - A failover group update request.

func (FailoverGroupUpdate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type FailoverGroupUpdate.

type FailoverGroupUpdateProperties

type FailoverGroupUpdateProperties struct {
	// List of databases in the failover group.
	Databases []*string `json:"databases,omitempty"`

	// Read-only endpoint of the failover group instance.
	ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`

	// Read-write endpoint of the failover group instance.
	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
}

FailoverGroupUpdateProperties - Properties of a failover group update.

func (FailoverGroupUpdateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type FailoverGroupUpdateProperties.

type FailoverGroupsClient

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

FailoverGroupsClient contains the methods for the FailoverGroups group. Don't use this type directly, use NewFailoverGroupsClient() instead.

func NewFailoverGroupsClient

func NewFailoverGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *FailoverGroupsClient

NewFailoverGroupsClient creates a new instance of FailoverGroupsClient with the specified values. subscriptionID - The 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 (*FailoverGroupsClient) BeginCreateOrUpdate

func (client *FailoverGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroup, options *FailoverGroupsClientBeginCreateOrUpdateOptions) (FailoverGroupsClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates a failover group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server containing the failover group. failoverGroupName - The name of the failover group. parameters - The failover group parameters. options - FailoverGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the FailoverGroupsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupCreateOrUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewFailoverGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<failover-group-name>",
		armsql.FailoverGroup{
			Properties: &armsql.FailoverGroupProperties{
				Databases: []*string{
					to.StringPtr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1"),
					to.StringPtr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-2")},
				PartnerServers: []*armsql.PartnerInfo{
					{
						ID: to.StringPtr("<id>"),
					}},
				ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{
					FailoverPolicy: armsql.ReadOnlyEndpointFailoverPolicy("Disabled").ToPtr(),
				},
				ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{
					FailoverPolicy:                         armsql.ReadWriteEndpointFailoverPolicy("Automatic").ToPtr(),
					FailoverWithDataLossGracePeriodMinutes: to.Int32Ptr(480),
				},
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.FailoverGroupsClientCreateOrUpdateResult)
}
Output:

func (*FailoverGroupsClient) BeginDelete

func (client *FailoverGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginDeleteOptions) (FailoverGroupsClientDeletePollerResponse, error)

BeginDelete - Deletes a failover group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server containing the failover group. failoverGroupName - The name of the failover group. options - FailoverGroupsClientBeginDeleteOptions contains the optional parameters for the FailoverGroupsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewFailoverGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<failover-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*FailoverGroupsClient) BeginFailover

func (client *FailoverGroupsClient) BeginFailover(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginFailoverOptions) (FailoverGroupsClientFailoverPollerResponse, error)

BeginFailover - Fails over from the current primary server to this server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server containing the failover group. failoverGroupName - The name of the failover group. options - FailoverGroupsClientBeginFailoverOptions contains the optional parameters for the FailoverGroupsClient.BeginFailover method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupFailover.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewFailoverGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginFailover(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<failover-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.FailoverGroupsClientFailoverResult)
}
Output:

func (*FailoverGroupsClient) BeginForceFailoverAllowDataLoss

func (client *FailoverGroupsClient) BeginForceFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginForceFailoverAllowDataLossOptions) (FailoverGroupsClientForceFailoverAllowDataLossPollerResponse, error)

BeginForceFailoverAllowDataLoss - Fails over from the current primary server to this server. This operation might result in data loss. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server containing the failover group. failoverGroupName - The name of the failover group. options - FailoverGroupsClientBeginForceFailoverAllowDataLossOptions contains the optional parameters for the FailoverGroupsClient.BeginForceFailoverAllowDataLoss method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupForceFailoverAllowDataLoss.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewFailoverGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginForceFailoverAllowDataLoss(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<failover-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.FailoverGroupsClientForceFailoverAllowDataLossResult)
}
Output:

func (*FailoverGroupsClient) BeginUpdate

func (client *FailoverGroupsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroupUpdate, options *FailoverGroupsClientBeginUpdateOptions) (FailoverGroupsClientUpdatePollerResponse, error)

BeginUpdate - Updates a failover group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server containing the failover group. failoverGroupName - The name of the failover group. parameters - The failover group parameters. options - FailoverGroupsClientBeginUpdateOptions contains the optional parameters for the FailoverGroupsClient.BeginUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewFailoverGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<failover-group-name>",
		armsql.FailoverGroupUpdate{
			Properties: &armsql.FailoverGroupUpdateProperties{
				Databases: []*string{
					to.StringPtr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1")},
				ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{
					FailoverPolicy:                         armsql.ReadWriteEndpointFailoverPolicy("Automatic").ToPtr(),
					FailoverWithDataLossGracePeriodMinutes: to.Int32Ptr(120),
				},
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.FailoverGroupsClientUpdateResult)
}
Output:

func (*FailoverGroupsClient) Get

func (client *FailoverGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientGetOptions) (FailoverGroupsClientGetResponse, error)

Get - Gets a failover group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server containing the failover group. failoverGroupName - The name of the failover group. options - FailoverGroupsClientGetOptions contains the optional parameters for the FailoverGroupsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewFailoverGroupsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<failover-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.FailoverGroupsClientGetResult)
}
Output:

func (*FailoverGroupsClient) ListByServer

func (client *FailoverGroupsClient) ListByServer(resourceGroupName string, serverName string, options *FailoverGroupsClientListByServerOptions) *FailoverGroupsClientListByServerPager

ListByServer - Lists the failover groups in a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server containing the failover group. options - FailoverGroupsClientListByServerOptions contains the optional parameters for the FailoverGroupsClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewFailoverGroupsClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type FailoverGroupsClientBeginCreateOrUpdateOptions added in v0.3.0

type FailoverGroupsClientBeginCreateOrUpdateOptions struct {
}

FailoverGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the FailoverGroupsClient.BeginCreateOrUpdate method.

type FailoverGroupsClientBeginDeleteOptions added in v0.3.0

type FailoverGroupsClientBeginDeleteOptions struct {
}

FailoverGroupsClientBeginDeleteOptions contains the optional parameters for the FailoverGroupsClient.BeginDelete method.

type FailoverGroupsClientBeginFailoverOptions added in v0.3.0

type FailoverGroupsClientBeginFailoverOptions struct {
}

FailoverGroupsClientBeginFailoverOptions contains the optional parameters for the FailoverGroupsClient.BeginFailover method.

type FailoverGroupsClientBeginForceFailoverAllowDataLossOptions added in v0.3.0

type FailoverGroupsClientBeginForceFailoverAllowDataLossOptions struct {
}

FailoverGroupsClientBeginForceFailoverAllowDataLossOptions contains the optional parameters for the FailoverGroupsClient.BeginForceFailoverAllowDataLoss method.

type FailoverGroupsClientBeginUpdateOptions added in v0.3.0

type FailoverGroupsClientBeginUpdateOptions struct {
}

FailoverGroupsClientBeginUpdateOptions contains the optional parameters for the FailoverGroupsClient.BeginUpdate method.

type FailoverGroupsClientCreateOrUpdatePoller added in v0.3.0

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

FailoverGroupsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*FailoverGroupsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*FailoverGroupsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final FailoverGroupsClientCreateOrUpdateResponse will be returned.

func (*FailoverGroupsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*FailoverGroupsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type FailoverGroupsClientCreateOrUpdatePollerResponse added in v0.3.0

type FailoverGroupsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *FailoverGroupsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FailoverGroupsClientCreateOrUpdatePollerResponse contains the response from method FailoverGroupsClient.CreateOrUpdate.

func (FailoverGroupsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*FailoverGroupsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a FailoverGroupsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type FailoverGroupsClientCreateOrUpdateResponse added in v0.3.0

type FailoverGroupsClientCreateOrUpdateResponse struct {
	FailoverGroupsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FailoverGroupsClientCreateOrUpdateResponse contains the response from method FailoverGroupsClient.CreateOrUpdate.

type FailoverGroupsClientCreateOrUpdateResult added in v0.3.0

type FailoverGroupsClientCreateOrUpdateResult struct {
	FailoverGroup
}

FailoverGroupsClientCreateOrUpdateResult contains the result from method FailoverGroupsClient.CreateOrUpdate.

type FailoverGroupsClientDeletePoller added in v0.3.0

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

FailoverGroupsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*FailoverGroupsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*FailoverGroupsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final FailoverGroupsClientDeleteResponse will be returned.

func (*FailoverGroupsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*FailoverGroupsClientDeletePoller) ResumeToken added in v0.3.0

func (p *FailoverGroupsClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type FailoverGroupsClientDeletePollerResponse added in v0.3.0

type FailoverGroupsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *FailoverGroupsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FailoverGroupsClientDeletePollerResponse contains the response from method FailoverGroupsClient.Delete.

func (FailoverGroupsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*FailoverGroupsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a FailoverGroupsClientDeletePollerResponse from the provided client and resume token.

type FailoverGroupsClientDeleteResponse added in v0.3.0

type FailoverGroupsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FailoverGroupsClientDeleteResponse contains the response from method FailoverGroupsClient.Delete.

type FailoverGroupsClientFailoverPoller added in v0.3.0

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

FailoverGroupsClientFailoverPoller provides polling facilities until the operation reaches a terminal state.

func (*FailoverGroupsClientFailoverPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*FailoverGroupsClientFailoverPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final FailoverGroupsClientFailoverResponse will be returned.

func (*FailoverGroupsClientFailoverPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*FailoverGroupsClientFailoverPoller) ResumeToken added in v0.3.0

func (p *FailoverGroupsClientFailoverPoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type FailoverGroupsClientFailoverPollerResponse added in v0.3.0

type FailoverGroupsClientFailoverPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *FailoverGroupsClientFailoverPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FailoverGroupsClientFailoverPollerResponse contains the response from method FailoverGroupsClient.Failover.

func (FailoverGroupsClientFailoverPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*FailoverGroupsClientFailoverPollerResponse) Resume added in v0.3.0

Resume rehydrates a FailoverGroupsClientFailoverPollerResponse from the provided client and resume token.

type FailoverGroupsClientFailoverResponse added in v0.3.0

type FailoverGroupsClientFailoverResponse struct {
	FailoverGroupsClientFailoverResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FailoverGroupsClientFailoverResponse contains the response from method FailoverGroupsClient.Failover.

type FailoverGroupsClientFailoverResult added in v0.3.0

type FailoverGroupsClientFailoverResult struct {
	FailoverGroup
}

FailoverGroupsClientFailoverResult contains the result from method FailoverGroupsClient.Failover.

type FailoverGroupsClientForceFailoverAllowDataLossPoller added in v0.3.0

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

FailoverGroupsClientForceFailoverAllowDataLossPoller provides polling facilities until the operation reaches a terminal state.

func (*FailoverGroupsClientForceFailoverAllowDataLossPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*FailoverGroupsClientForceFailoverAllowDataLossPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final FailoverGroupsClientForceFailoverAllowDataLossResponse will be returned.

func (*FailoverGroupsClientForceFailoverAllowDataLossPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*FailoverGroupsClientForceFailoverAllowDataLossPoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type FailoverGroupsClientForceFailoverAllowDataLossPollerResponse added in v0.3.0

type FailoverGroupsClientForceFailoverAllowDataLossPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *FailoverGroupsClientForceFailoverAllowDataLossPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FailoverGroupsClientForceFailoverAllowDataLossPollerResponse contains the response from method FailoverGroupsClient.ForceFailoverAllowDataLoss.

func (FailoverGroupsClientForceFailoverAllowDataLossPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*FailoverGroupsClientForceFailoverAllowDataLossPollerResponse) Resume added in v0.3.0

Resume rehydrates a FailoverGroupsClientForceFailoverAllowDataLossPollerResponse from the provided client and resume token.

type FailoverGroupsClientForceFailoverAllowDataLossResponse added in v0.3.0

type FailoverGroupsClientForceFailoverAllowDataLossResponse struct {
	FailoverGroupsClientForceFailoverAllowDataLossResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FailoverGroupsClientForceFailoverAllowDataLossResponse contains the response from method FailoverGroupsClient.ForceFailoverAllowDataLoss.

type FailoverGroupsClientForceFailoverAllowDataLossResult added in v0.3.0

type FailoverGroupsClientForceFailoverAllowDataLossResult struct {
	FailoverGroup
}

FailoverGroupsClientForceFailoverAllowDataLossResult contains the result from method FailoverGroupsClient.ForceFailoverAllowDataLoss.

type FailoverGroupsClientGetOptions added in v0.3.0

type FailoverGroupsClientGetOptions struct {
}

FailoverGroupsClientGetOptions contains the optional parameters for the FailoverGroupsClient.Get method.

type FailoverGroupsClientGetResponse added in v0.3.0

type FailoverGroupsClientGetResponse struct {
	FailoverGroupsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FailoverGroupsClientGetResponse contains the response from method FailoverGroupsClient.Get.

type FailoverGroupsClientGetResult added in v0.3.0

type FailoverGroupsClientGetResult struct {
	FailoverGroup
}

FailoverGroupsClientGetResult contains the result from method FailoverGroupsClient.Get.

type FailoverGroupsClientListByServerOptions added in v0.3.0

type FailoverGroupsClientListByServerOptions struct {
}

FailoverGroupsClientListByServerOptions contains the optional parameters for the FailoverGroupsClient.ListByServer method.

type FailoverGroupsClientListByServerPager added in v0.3.0

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

FailoverGroupsClientListByServerPager provides operations for iterating over paged responses.

func (*FailoverGroupsClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*FailoverGroupsClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*FailoverGroupsClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current FailoverGroupsClientListByServerResponse page.

type FailoverGroupsClientListByServerResponse added in v0.3.0

type FailoverGroupsClientListByServerResponse struct {
	FailoverGroupsClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FailoverGroupsClientListByServerResponse contains the response from method FailoverGroupsClient.ListByServer.

type FailoverGroupsClientListByServerResult added in v0.3.0

type FailoverGroupsClientListByServerResult struct {
	FailoverGroupListResult
}

FailoverGroupsClientListByServerResult contains the result from method FailoverGroupsClient.ListByServer.

type FailoverGroupsClientUpdatePoller added in v0.3.0

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

FailoverGroupsClientUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*FailoverGroupsClientUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*FailoverGroupsClientUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final FailoverGroupsClientUpdateResponse will be returned.

func (*FailoverGroupsClientUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*FailoverGroupsClientUpdatePoller) ResumeToken added in v0.3.0

func (p *FailoverGroupsClientUpdatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type FailoverGroupsClientUpdatePollerResponse added in v0.3.0

type FailoverGroupsClientUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *FailoverGroupsClientUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FailoverGroupsClientUpdatePollerResponse contains the response from method FailoverGroupsClient.Update.

func (FailoverGroupsClientUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*FailoverGroupsClientUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a FailoverGroupsClientUpdatePollerResponse from the provided client and resume token.

type FailoverGroupsClientUpdateResponse added in v0.3.0

type FailoverGroupsClientUpdateResponse struct {
	FailoverGroupsClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FailoverGroupsClientUpdateResponse contains the response from method FailoverGroupsClient.Update.

type FailoverGroupsClientUpdateResult added in v0.3.0

type FailoverGroupsClientUpdateResult struct {
	FailoverGroup
}

FailoverGroupsClientUpdateResult contains the result from method FailoverGroupsClient.Update.

type FirewallRule

type FirewallRule struct {
	// Resource name.
	Name *string `json:"name,omitempty"`

	// Resource properties.
	Properties *ServerFirewallRuleProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

FirewallRule - A server firewall rule.

type FirewallRuleList

type FirewallRuleList struct {
	Values []*FirewallRule `json:"values,omitempty"`
}

FirewallRuleList - A list of server firewall rules.

func (FirewallRuleList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type FirewallRuleList.

type FirewallRuleListResult

type FirewallRuleListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*FirewallRule `json:"value,omitempty" azure:"ro"`
}

FirewallRuleListResult - The response to a list firewall rules request

func (FirewallRuleListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type FirewallRuleListResult.

type FirewallRulesClient

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

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

func NewFirewallRulesClient

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

NewFirewallRulesClient creates a new instance of FirewallRulesClient with the specified values. subscriptionID - The 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 (*FirewallRulesClient) CreateOrUpdate

func (client *FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule, options *FirewallRulesClientCreateOrUpdateOptions) (FirewallRulesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates a firewall rule. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. firewallRuleName - The name of the firewall rule. parameters - The required parameters for creating or updating a firewall rule. options - FirewallRulesClientCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleCreate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewFirewallRulesClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<firewall-rule-name>",
		armsql.FirewallRule{
			Properties: &armsql.ServerFirewallRuleProperties{
				EndIPAddress:   to.StringPtr("<end-ipaddress>"),
				StartIPAddress: to.StringPtr("<start-ipaddress>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.FirewallRulesClientCreateOrUpdateResult)
}
Output:

func (*FirewallRulesClient) Delete

func (client *FirewallRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientDeleteOptions) (FirewallRulesClientDeleteResponse, error)

Delete - Deletes a firewall rule. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. firewallRuleName - The name of the firewall rule. options - FirewallRulesClientDeleteOptions contains the optional parameters for the FirewallRulesClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewFirewallRulesClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<firewall-rule-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*FirewallRulesClient) Get

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

Get - Gets a firewall rule. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. firewallRuleName - The name of the firewall rule. options - FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewFirewallRulesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<firewall-rule-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.FirewallRulesClientGetResult)
}
Output:

func (*FirewallRulesClient) ListByServer

func (client *FirewallRulesClient) ListByServer(resourceGroupName string, serverName string, options *FirewallRulesClientListByServerOptions) *FirewallRulesClientListByServerPager

ListByServer - Gets a list of firewall rules. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - FirewallRulesClientListByServerOptions contains the optional parameters for the FirewallRulesClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewFirewallRulesClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*FirewallRulesClient) Replace

func (client *FirewallRulesClient) Replace(ctx context.Context, resourceGroupName string, serverName string, parameters FirewallRuleList, options *FirewallRulesClientReplaceOptions) (FirewallRulesClientReplaceResponse, error)

Replace - Replaces all firewall rules on the server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - FirewallRulesClientReplaceOptions contains the optional parameters for the FirewallRulesClient.Replace method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleReplace.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewFirewallRulesClient("<subscription-id>", cred, nil)
	res, err := client.Replace(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.FirewallRuleList{
			Values: []*armsql.FirewallRule{
				{
					Name: to.StringPtr("<name>"),
					Properties: &armsql.ServerFirewallRuleProperties{
						EndIPAddress:   to.StringPtr("<end-ipaddress>"),
						StartIPAddress: to.StringPtr("<start-ipaddress>"),
					},
				}},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.FirewallRulesClientReplaceResult)
}
Output:

type FirewallRulesClientCreateOrUpdateOptions added in v0.3.0

type FirewallRulesClientCreateOrUpdateOptions struct {
}

FirewallRulesClientCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.CreateOrUpdate method.

type FirewallRulesClientCreateOrUpdateResponse added in v0.3.0

type FirewallRulesClientCreateOrUpdateResponse struct {
	FirewallRulesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FirewallRulesClientCreateOrUpdateResponse contains the response from method FirewallRulesClient.CreateOrUpdate.

type FirewallRulesClientCreateOrUpdateResult added in v0.3.0

type FirewallRulesClientCreateOrUpdateResult struct {
	FirewallRule
}

FirewallRulesClientCreateOrUpdateResult contains the result from method FirewallRulesClient.CreateOrUpdate.

type FirewallRulesClientDeleteOptions added in v0.3.0

type FirewallRulesClientDeleteOptions struct {
}

FirewallRulesClientDeleteOptions contains the optional parameters for the FirewallRulesClient.Delete method.

type FirewallRulesClientDeleteResponse added in v0.3.0

type FirewallRulesClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FirewallRulesClientDeleteResponse contains the response from method FirewallRulesClient.Delete.

type FirewallRulesClientGetOptions added in v0.3.0

type FirewallRulesClientGetOptions struct {
}

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

type FirewallRulesClientGetResponse added in v0.3.0

type FirewallRulesClientGetResponse struct {
	FirewallRulesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FirewallRulesClientGetResponse contains the response from method FirewallRulesClient.Get.

type FirewallRulesClientGetResult added in v0.3.0

type FirewallRulesClientGetResult struct {
	FirewallRule
}

FirewallRulesClientGetResult contains the result from method FirewallRulesClient.Get.

type FirewallRulesClientListByServerOptions added in v0.3.0

type FirewallRulesClientListByServerOptions struct {
}

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

type FirewallRulesClientListByServerPager added in v0.3.0

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

FirewallRulesClientListByServerPager provides operations for iterating over paged responses.

func (*FirewallRulesClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*FirewallRulesClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*FirewallRulesClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current FirewallRulesClientListByServerResponse page.

type FirewallRulesClientListByServerResponse added in v0.3.0

type FirewallRulesClientListByServerResponse struct {
	FirewallRulesClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FirewallRulesClientListByServerResponse contains the response from method FirewallRulesClient.ListByServer.

type FirewallRulesClientListByServerResult added in v0.3.0

type FirewallRulesClientListByServerResult struct {
	FirewallRuleListResult
}

FirewallRulesClientListByServerResult contains the result from method FirewallRulesClient.ListByServer.

type FirewallRulesClientReplaceOptions added in v0.3.0

type FirewallRulesClientReplaceOptions struct {
}

FirewallRulesClientReplaceOptions contains the optional parameters for the FirewallRulesClient.Replace method.

type FirewallRulesClientReplaceResponse added in v0.3.0

type FirewallRulesClientReplaceResponse struct {
	FirewallRulesClientReplaceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

FirewallRulesClientReplaceResponse contains the response from method FirewallRulesClient.Replace.

type FirewallRulesClientReplaceResult added in v0.3.0

type FirewallRulesClientReplaceResult struct {
	FirewallRule
}

FirewallRulesClientReplaceResult contains the result from method FirewallRulesClient.Replace.

type GeoBackupPoliciesClient

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

GeoBackupPoliciesClient contains the methods for the GeoBackupPolicies group. Don't use this type directly, use NewGeoBackupPoliciesClient() instead.

func NewGeoBackupPoliciesClient

func NewGeoBackupPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *GeoBackupPoliciesClient

NewGeoBackupPoliciesClient creates a new instance of GeoBackupPoliciesClient with the specified values. subscriptionID - The 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 (*GeoBackupPoliciesClient) CreateOrUpdate

func (client *GeoBackupPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, geoBackupPolicyName GeoBackupPolicyName, parameters GeoBackupPolicy, options *GeoBackupPoliciesClientCreateOrUpdateOptions) (GeoBackupPoliciesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Updates a database geo backup policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. geoBackupPolicyName - The name of the geo backup policy. parameters - The required parameters for creating or updating the geo backup policy. options - GeoBackupPoliciesClientCreateOrUpdateOptions contains the optional parameters for the GeoBackupPoliciesClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesCreateOrUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewGeoBackupPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.GeoBackupPolicyName("Default"),
		armsql.GeoBackupPolicy{
			Properties: &armsql.GeoBackupPolicyProperties{
				State: armsql.GeoBackupPolicyStateEnabled.ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.GeoBackupPoliciesClientCreateOrUpdateResult)
}
Output:

func (*GeoBackupPoliciesClient) Get

func (client *GeoBackupPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, geoBackupPolicyName GeoBackupPolicyName, options *GeoBackupPoliciesClientGetOptions) (GeoBackupPoliciesClientGetResponse, error)

Get - Gets a geo backup policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. geoBackupPolicyName - The name of the geo backup policy. options - GeoBackupPoliciesClientGetOptions contains the optional parameters for the GeoBackupPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewGeoBackupPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.GeoBackupPolicyName("Default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.GeoBackupPoliciesClientGetResult)
}
Output:

func (*GeoBackupPoliciesClient) ListByDatabase

func (client *GeoBackupPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *GeoBackupPoliciesClientListByDatabaseOptions) (GeoBackupPoliciesClientListByDatabaseResponse, error)

ListByDatabase - Returns a list of geo backup policies. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - GeoBackupPoliciesClientListByDatabaseOptions contains the optional parameters for the GeoBackupPoliciesClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewGeoBackupPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.ListByDatabase(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.GeoBackupPoliciesClientListByDatabaseResult)
}
Output:

type GeoBackupPoliciesClientCreateOrUpdateOptions added in v0.3.0

type GeoBackupPoliciesClientCreateOrUpdateOptions struct {
}

GeoBackupPoliciesClientCreateOrUpdateOptions contains the optional parameters for the GeoBackupPoliciesClient.CreateOrUpdate method.

type GeoBackupPoliciesClientCreateOrUpdateResponse added in v0.3.0

type GeoBackupPoliciesClientCreateOrUpdateResponse struct {
	GeoBackupPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

GeoBackupPoliciesClientCreateOrUpdateResponse contains the response from method GeoBackupPoliciesClient.CreateOrUpdate.

type GeoBackupPoliciesClientCreateOrUpdateResult added in v0.3.0

type GeoBackupPoliciesClientCreateOrUpdateResult struct {
	GeoBackupPolicy
}

GeoBackupPoliciesClientCreateOrUpdateResult contains the result from method GeoBackupPoliciesClient.CreateOrUpdate.

type GeoBackupPoliciesClientGetOptions added in v0.3.0

type GeoBackupPoliciesClientGetOptions struct {
}

GeoBackupPoliciesClientGetOptions contains the optional parameters for the GeoBackupPoliciesClient.Get method.

type GeoBackupPoliciesClientGetResponse added in v0.3.0

type GeoBackupPoliciesClientGetResponse struct {
	GeoBackupPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

GeoBackupPoliciesClientGetResponse contains the response from method GeoBackupPoliciesClient.Get.

type GeoBackupPoliciesClientGetResult added in v0.3.0

type GeoBackupPoliciesClientGetResult struct {
	GeoBackupPolicy
}

GeoBackupPoliciesClientGetResult contains the result from method GeoBackupPoliciesClient.Get.

type GeoBackupPoliciesClientListByDatabaseOptions added in v0.3.0

type GeoBackupPoliciesClientListByDatabaseOptions struct {
}

GeoBackupPoliciesClientListByDatabaseOptions contains the optional parameters for the GeoBackupPoliciesClient.ListByDatabase method.

type GeoBackupPoliciesClientListByDatabaseResponse added in v0.3.0

type GeoBackupPoliciesClientListByDatabaseResponse struct {
	GeoBackupPoliciesClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

GeoBackupPoliciesClientListByDatabaseResponse contains the response from method GeoBackupPoliciesClient.ListByDatabase.

type GeoBackupPoliciesClientListByDatabaseResult added in v0.3.0

type GeoBackupPoliciesClientListByDatabaseResult struct {
	GeoBackupPolicyListResult
}

GeoBackupPoliciesClientListByDatabaseResult contains the result from method GeoBackupPoliciesClient.ListByDatabase.

type GeoBackupPolicy

type GeoBackupPolicy struct {
	// REQUIRED; The properties of the geo backup policy.
	Properties *GeoBackupPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Kind of geo backup policy. This is metadata used for the Azure portal experience.
	Kind *string `json:"kind,omitempty" azure:"ro"`

	// READ-ONLY; Backup policy location.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

GeoBackupPolicy - A database geo backup policy.

type GeoBackupPolicyListResult

type GeoBackupPolicyListResult struct {
	// The list of geo backup policies.
	Value []*GeoBackupPolicy `json:"value,omitempty"`
}

GeoBackupPolicyListResult - The response to a list geo backup policies request.

func (GeoBackupPolicyListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type GeoBackupPolicyListResult.

type GeoBackupPolicyName

type GeoBackupPolicyName string
const (
	GeoBackupPolicyNameDefault GeoBackupPolicyName = "Default"
)

func PossibleGeoBackupPolicyNameValues

func PossibleGeoBackupPolicyNameValues() []GeoBackupPolicyName

PossibleGeoBackupPolicyNameValues returns the possible values for the GeoBackupPolicyName const type.

func (GeoBackupPolicyName) ToPtr

ToPtr returns a *GeoBackupPolicyName pointing to the current value.

type GeoBackupPolicyProperties

type GeoBackupPolicyProperties struct {
	// REQUIRED; The state of the geo backup policy.
	State *GeoBackupPolicyState `json:"state,omitempty"`

	// READ-ONLY; The storage type of the geo backup policy.
	StorageType *string `json:"storageType,omitempty" azure:"ro"`
}

GeoBackupPolicyProperties - The properties of the geo backup policy.

type GeoBackupPolicyState

type GeoBackupPolicyState string

GeoBackupPolicyState - The state of the geo backup policy.

const (
	GeoBackupPolicyStateDisabled GeoBackupPolicyState = "Disabled"
	GeoBackupPolicyStateEnabled  GeoBackupPolicyState = "Enabled"
)

func PossibleGeoBackupPolicyStateValues

func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState

PossibleGeoBackupPolicyStateValues returns the possible values for the GeoBackupPolicyState const type.

func (GeoBackupPolicyState) ToPtr

ToPtr returns a *GeoBackupPolicyState pointing to the current value.

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"
	IdentityTypeSystemAssignedUserAssigned IdentityType = "SystemAssigned,UserAssigned"
	IdentityTypeUserAssigned               IdentityType = "UserAssigned"
)

func PossibleIdentityTypeValues

func PossibleIdentityTypeValues() []IdentityType

PossibleIdentityTypeValues returns the possible values for the IdentityType const type.

func (IdentityType) ToPtr

func (c IdentityType) ToPtr() *IdentityType

ToPtr returns a *IdentityType pointing to the current value.

type ImplementationMethod

type ImplementationMethod string

ImplementationMethod - Gets the method in which this recommended action can be manually implemented. e.g., TSql, AzurePowerShell.

const (
	ImplementationMethodTSQL            ImplementationMethod = "TSql"
	ImplementationMethodAzurePowerShell ImplementationMethod = "AzurePowerShell"
)

func PossibleImplementationMethodValues

func PossibleImplementationMethodValues() []ImplementationMethod

PossibleImplementationMethodValues returns the possible values for the ImplementationMethod const type.

func (ImplementationMethod) ToPtr

ToPtr returns a *ImplementationMethod pointing to the current value.

type ImportExistingDatabaseDefinition

type ImportExistingDatabaseDefinition struct {
	// REQUIRED; Administrator login name.
	AdministratorLogin *string `json:"administratorLogin,omitempty"`

	// REQUIRED; Administrator login password.
	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`

	// REQUIRED; Storage key.
	StorageKey *string `json:"storageKey,omitempty"`

	// REQUIRED; Storage key type.
	StorageKeyType *StorageKeyType `json:"storageKeyType,omitempty"`

	// REQUIRED; Storage Uri.
	StorageURI *string `json:"storageUri,omitempty"`

	// Authentication type.
	AuthenticationType *string `json:"authenticationType,omitempty"`

	// Optional resource information to enable network isolation for request.
	NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"`
}

ImportExistingDatabaseDefinition - Contains the information necessary to perform import operation for existing database.

type ImportExportExtensionsOperationListResult

type ImportExportExtensionsOperationListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ImportExportExtensionsOperationResult `json:"value,omitempty" azure:"ro"`
}

ImportExportExtensionsOperationListResult - Import export operation extensions list.

func (ImportExportExtensionsOperationListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ImportExportExtensionsOperationListResult.

type ImportExportExtensionsOperationResult

type ImportExportExtensionsOperationResult struct {
	// Resource properties.
	Properties *ImportExportExtensionsOperationResultProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ImportExportExtensionsOperationResult - An Extension operation result resource.

type ImportExportExtensionsOperationResultProperties

type ImportExportExtensionsOperationResultProperties struct {
	// READ-ONLY; Database name.
	DatabaseName *string `json:"databaseName,omitempty" azure:"ro"`

	// READ-ONLY; Error message.
	ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"`

	// READ-ONLY; Last modified time.
	LastModifiedTime *string `json:"lastModifiedTime,omitempty" azure:"ro"`

	// READ-ONLY; Request Id.
	RequestID *string `json:"requestId,omitempty" azure:"ro"`

	// READ-ONLY; Request type.
	RequestType *string `json:"requestType,omitempty" azure:"ro"`

	// READ-ONLY; Server name.
	ServerName *string `json:"serverName,omitempty" azure:"ro"`

	// READ-ONLY; Operation status.
	Status *string `json:"status,omitempty" azure:"ro"`
}

ImportExportExtensionsOperationResultProperties - Contains the operation result properties for import/export operation.

type ImportExportOperationResult

type ImportExportOperationResult struct {
	// Resource properties.
	Properties *ImportExportOperationResultProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ImportExportOperationResult - An ImportExport operation result resource.

type ImportExportOperationResultProperties

type ImportExportOperationResultProperties struct {
	// READ-ONLY; Blob Uri.
	BlobURI *string `json:"blobUri,omitempty" azure:"ro"`

	// READ-ONLY; Database name.
	DatabaseName *string `json:"databaseName,omitempty" azure:"ro"`

	// READ-ONLY; Error message.
	ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"`

	// READ-ONLY; Last modified time.
	LastModifiedTime *string `json:"lastModifiedTime,omitempty" azure:"ro"`

	// READ-ONLY; Gets the status of private endpoints associated with this request.
	PrivateEndpointConnections []*PrivateEndpointConnectionRequestStatus `json:"privateEndpointConnections,omitempty" azure:"ro"`

	// READ-ONLY; Queued time.
	QueuedTime *string `json:"queuedTime,omitempty" azure:"ro"`

	// READ-ONLY; Request Id.
	RequestID *string `json:"requestId,omitempty" azure:"ro"`

	// READ-ONLY; Request type.
	RequestType *string `json:"requestType,omitempty" azure:"ro"`

	// READ-ONLY; Server name.
	ServerName *string `json:"serverName,omitempty" azure:"ro"`

	// READ-ONLY; Operation status.
	Status *string `json:"status,omitempty" azure:"ro"`
}

ImportExportOperationResultProperties - Contains the operation result properties for import/export operation.

func (ImportExportOperationResultProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ImportExportOperationResultProperties.

type ImportNewDatabaseDefinition

type ImportNewDatabaseDefinition struct {
	// REQUIRED; Administrator login name.
	AdministratorLogin *string `json:"administratorLogin,omitempty"`

	// REQUIRED; Administrator login password.
	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`

	// REQUIRED; Storage key.
	StorageKey *string `json:"storageKey,omitempty"`

	// REQUIRED; Storage key type.
	StorageKeyType *StorageKeyType `json:"storageKeyType,omitempty"`

	// REQUIRED; Storage Uri.
	StorageURI *string `json:"storageUri,omitempty"`

	// Authentication type.
	AuthenticationType *string `json:"authenticationType,omitempty"`

	// Name of the import database.
	DatabaseName *string `json:"databaseName,omitempty"`

	// Edition of the import database.
	Edition *string `json:"edition,omitempty"`

	// Max size in bytes for the import database.
	MaxSizeBytes *string `json:"maxSizeBytes,omitempty"`

	// Optional resource information to enable network isolation for request.
	NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"`

	// Service level objective name of the import database.
	ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty"`
}

ImportNewDatabaseDefinition - Contains the information necessary to perform import operation for new database.

type InstanceFailoverGroup

type InstanceFailoverGroup struct {
	// Resource properties.
	Properties *InstanceFailoverGroupProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

InstanceFailoverGroup - An instance failover group.

type InstanceFailoverGroupListResult

type InstanceFailoverGroupListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*InstanceFailoverGroup `json:"value,omitempty" azure:"ro"`
}

InstanceFailoverGroupListResult - A list of instance failover groups.

func (InstanceFailoverGroupListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupListResult.

type InstanceFailoverGroupProperties

type InstanceFailoverGroupProperties struct {
	// REQUIRED; List of managed instance pairs in the failover group.
	ManagedInstancePairs []*ManagedInstancePairInfo `json:"managedInstancePairs,omitempty"`

	// REQUIRED; Partner region information for the failover group.
	PartnerRegions []*PartnerRegionInfo `json:"partnerRegions,omitempty"`

	// REQUIRED; Read-write endpoint of the failover group instance.
	ReadWriteEndpoint *InstanceFailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`

	// Read-only endpoint of the failover group instance.
	ReadOnlyEndpoint *InstanceFailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`

	// READ-ONLY; Local replication role of the failover group instance.
	ReplicationRole *InstanceFailoverGroupReplicationRole `json:"replicationRole,omitempty" azure:"ro"`

	// READ-ONLY; Replication state of the failover group instance.
	ReplicationState *string `json:"replicationState,omitempty" azure:"ro"`
}

InstanceFailoverGroupProperties - Properties of a instance failover group.

func (InstanceFailoverGroupProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupProperties.

type InstanceFailoverGroupReadOnlyEndpoint

type InstanceFailoverGroupReadOnlyEndpoint struct {
	// Failover policy of the read-only endpoint for the failover group.
	FailoverPolicy *ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
}

InstanceFailoverGroupReadOnlyEndpoint - Read-only endpoint of the failover group instance.

type InstanceFailoverGroupReadWriteEndpoint

type InstanceFailoverGroupReadWriteEndpoint struct {
	// REQUIRED; Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes
	// is required.
	FailoverPolicy *ReadWriteEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`

	// Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then
	// failoverWithDataLossGracePeriodMinutes is required.
	FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"`
}

InstanceFailoverGroupReadWriteEndpoint - Read-write endpoint of the failover group instance.

type InstanceFailoverGroupReplicationRole

type InstanceFailoverGroupReplicationRole string

InstanceFailoverGroupReplicationRole - Local replication role of the failover group instance.

const (
	InstanceFailoverGroupReplicationRolePrimary   InstanceFailoverGroupReplicationRole = "Primary"
	InstanceFailoverGroupReplicationRoleSecondary InstanceFailoverGroupReplicationRole = "Secondary"
)

func PossibleInstanceFailoverGroupReplicationRoleValues

func PossibleInstanceFailoverGroupReplicationRoleValues() []InstanceFailoverGroupReplicationRole

PossibleInstanceFailoverGroupReplicationRoleValues returns the possible values for the InstanceFailoverGroupReplicationRole const type.

func (InstanceFailoverGroupReplicationRole) ToPtr

ToPtr returns a *InstanceFailoverGroupReplicationRole pointing to the current value.

type InstanceFailoverGroupsClient

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

InstanceFailoverGroupsClient contains the methods for the InstanceFailoverGroups group. Don't use this type directly, use NewInstanceFailoverGroupsClient() instead.

func NewInstanceFailoverGroupsClient

func NewInstanceFailoverGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *InstanceFailoverGroupsClient

NewInstanceFailoverGroupsClient creates a new instance of InstanceFailoverGroupsClient with the specified values. subscriptionID - The 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 (*InstanceFailoverGroupsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates a failover group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The name of the region where the resource is located. failoverGroupName - The name of the failover group. parameters - The failover group parameters. options - InstanceFailoverGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupCreateOrUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewInstanceFailoverGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<location-name>",
		"<failover-group-name>",
		armsql.InstanceFailoverGroup{
			Properties: &armsql.InstanceFailoverGroupProperties{
				ManagedInstancePairs: []*armsql.ManagedInstancePairInfo{
					{
						PartnerManagedInstanceID: to.StringPtr("<partner-managed-instance-id>"),
						PrimaryManagedInstanceID: to.StringPtr("<primary-managed-instance-id>"),
					}},
				PartnerRegions: []*armsql.PartnerRegionInfo{
					{
						Location: to.StringPtr("<location>"),
					}},
				ReadOnlyEndpoint: &armsql.InstanceFailoverGroupReadOnlyEndpoint{
					FailoverPolicy: armsql.ReadOnlyEndpointFailoverPolicy("Disabled").ToPtr(),
				},
				ReadWriteEndpoint: &armsql.InstanceFailoverGroupReadWriteEndpoint{
					FailoverPolicy:                         armsql.ReadWriteEndpointFailoverPolicy("Automatic").ToPtr(),
					FailoverWithDataLossGracePeriodMinutes: to.Int32Ptr(480),
				},
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.InstanceFailoverGroupsClientCreateOrUpdateResult)
}
Output:

func (*InstanceFailoverGroupsClient) BeginDelete

func (client *InstanceFailoverGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientBeginDeleteOptions) (InstanceFailoverGroupsClientDeletePollerResponse, error)

BeginDelete - Deletes a failover group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The name of the region where the resource is located. failoverGroupName - The name of the failover group. options - InstanceFailoverGroupsClientBeginDeleteOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewInstanceFailoverGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<location-name>",
		"<failover-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*InstanceFailoverGroupsClient) BeginFailover

func (client *InstanceFailoverGroupsClient) BeginFailover(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientBeginFailoverOptions) (InstanceFailoverGroupsClientFailoverPollerResponse, error)

BeginFailover - Fails over from the current primary managed instance to this managed instance. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The name of the region where the resource is located. failoverGroupName - The name of the failover group. options - InstanceFailoverGroupsClientBeginFailoverOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginFailover method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupFailover.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewInstanceFailoverGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginFailover(ctx,
		"<resource-group-name>",
		"<location-name>",
		"<failover-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.InstanceFailoverGroupsClientFailoverResult)
}
Output:

func (*InstanceFailoverGroupsClient) BeginForceFailoverAllowDataLoss

BeginForceFailoverAllowDataLoss - Fails over from the current primary managed instance to this managed instance. This operation might result in data loss. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The name of the region where the resource is located. failoverGroupName - The name of the failover group. options - InstanceFailoverGroupsClientBeginForceFailoverAllowDataLossOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginForceFailoverAllowDataLoss method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupForceFailoverAllowDataLoss.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewInstanceFailoverGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginForceFailoverAllowDataLoss(ctx,
		"<resource-group-name>",
		"<location-name>",
		"<failover-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.InstanceFailoverGroupsClientForceFailoverAllowDataLossResult)
}
Output:

func (*InstanceFailoverGroupsClient) Get

func (client *InstanceFailoverGroupsClient) Get(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientGetOptions) (InstanceFailoverGroupsClientGetResponse, error)

Get - Gets a failover group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The name of the region where the resource is located. failoverGroupName - The name of the failover group. options - InstanceFailoverGroupsClientGetOptions contains the optional parameters for the InstanceFailoverGroupsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewInstanceFailoverGroupsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<location-name>",
		"<failover-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.InstanceFailoverGroupsClientGetResult)
}
Output:

func (*InstanceFailoverGroupsClient) ListByLocation

ListByLocation - Lists the failover groups in a location. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The name of the region where the resource is located. options - InstanceFailoverGroupsClientListByLocationOptions contains the optional parameters for the InstanceFailoverGroupsClient.ListByLocation method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewInstanceFailoverGroupsClient("<subscription-id>", cred, nil)
	pager := client.ListByLocation("<resource-group-name>",
		"<location-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type InstanceFailoverGroupsClientBeginCreateOrUpdateOptions added in v0.3.0

type InstanceFailoverGroupsClientBeginCreateOrUpdateOptions struct {
}

InstanceFailoverGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginCreateOrUpdate method.

type InstanceFailoverGroupsClientBeginDeleteOptions added in v0.3.0

type InstanceFailoverGroupsClientBeginDeleteOptions struct {
}

InstanceFailoverGroupsClientBeginDeleteOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginDelete method.

type InstanceFailoverGroupsClientBeginFailoverOptions added in v0.3.0

type InstanceFailoverGroupsClientBeginFailoverOptions struct {
}

InstanceFailoverGroupsClientBeginFailoverOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginFailover method.

type InstanceFailoverGroupsClientBeginForceFailoverAllowDataLossOptions added in v0.3.0

type InstanceFailoverGroupsClientBeginForceFailoverAllowDataLossOptions struct {
}

InstanceFailoverGroupsClientBeginForceFailoverAllowDataLossOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginForceFailoverAllowDataLoss method.

type InstanceFailoverGroupsClientCreateOrUpdatePoller added in v0.3.0

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

InstanceFailoverGroupsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*InstanceFailoverGroupsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*InstanceFailoverGroupsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final InstanceFailoverGroupsClientCreateOrUpdateResponse will be returned.

func (*InstanceFailoverGroupsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*InstanceFailoverGroupsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type InstanceFailoverGroupsClientCreateOrUpdatePollerResponse added in v0.3.0

type InstanceFailoverGroupsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *InstanceFailoverGroupsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstanceFailoverGroupsClientCreateOrUpdatePollerResponse contains the response from method InstanceFailoverGroupsClient.CreateOrUpdate.

func (InstanceFailoverGroupsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*InstanceFailoverGroupsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a InstanceFailoverGroupsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type InstanceFailoverGroupsClientCreateOrUpdateResponse added in v0.3.0

type InstanceFailoverGroupsClientCreateOrUpdateResponse struct {
	InstanceFailoverGroupsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstanceFailoverGroupsClientCreateOrUpdateResponse contains the response from method InstanceFailoverGroupsClient.CreateOrUpdate.

type InstanceFailoverGroupsClientCreateOrUpdateResult added in v0.3.0

type InstanceFailoverGroupsClientCreateOrUpdateResult struct {
	InstanceFailoverGroup
}

InstanceFailoverGroupsClientCreateOrUpdateResult contains the result from method InstanceFailoverGroupsClient.CreateOrUpdate.

type InstanceFailoverGroupsClientDeletePoller added in v0.3.0

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

InstanceFailoverGroupsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*InstanceFailoverGroupsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*InstanceFailoverGroupsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final InstanceFailoverGroupsClientDeleteResponse will be returned.

func (*InstanceFailoverGroupsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*InstanceFailoverGroupsClientDeletePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type InstanceFailoverGroupsClientDeletePollerResponse added in v0.3.0

type InstanceFailoverGroupsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *InstanceFailoverGroupsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstanceFailoverGroupsClientDeletePollerResponse contains the response from method InstanceFailoverGroupsClient.Delete.

func (InstanceFailoverGroupsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*InstanceFailoverGroupsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a InstanceFailoverGroupsClientDeletePollerResponse from the provided client and resume token.

type InstanceFailoverGroupsClientDeleteResponse added in v0.3.0

type InstanceFailoverGroupsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstanceFailoverGroupsClientDeleteResponse contains the response from method InstanceFailoverGroupsClient.Delete.

type InstanceFailoverGroupsClientFailoverPoller added in v0.3.0

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

InstanceFailoverGroupsClientFailoverPoller provides polling facilities until the operation reaches a terminal state.

func (*InstanceFailoverGroupsClientFailoverPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*InstanceFailoverGroupsClientFailoverPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final InstanceFailoverGroupsClientFailoverResponse will be returned.

func (*InstanceFailoverGroupsClientFailoverPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*InstanceFailoverGroupsClientFailoverPoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type InstanceFailoverGroupsClientFailoverPollerResponse added in v0.3.0

type InstanceFailoverGroupsClientFailoverPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *InstanceFailoverGroupsClientFailoverPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstanceFailoverGroupsClientFailoverPollerResponse contains the response from method InstanceFailoverGroupsClient.Failover.

func (InstanceFailoverGroupsClientFailoverPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*InstanceFailoverGroupsClientFailoverPollerResponse) Resume added in v0.3.0

Resume rehydrates a InstanceFailoverGroupsClientFailoverPollerResponse from the provided client and resume token.

type InstanceFailoverGroupsClientFailoverResponse added in v0.3.0

type InstanceFailoverGroupsClientFailoverResponse struct {
	InstanceFailoverGroupsClientFailoverResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstanceFailoverGroupsClientFailoverResponse contains the response from method InstanceFailoverGroupsClient.Failover.

type InstanceFailoverGroupsClientFailoverResult added in v0.3.0

type InstanceFailoverGroupsClientFailoverResult struct {
	InstanceFailoverGroup
}

InstanceFailoverGroupsClientFailoverResult contains the result from method InstanceFailoverGroupsClient.Failover.

type InstanceFailoverGroupsClientForceFailoverAllowDataLossPoller added in v0.3.0

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

InstanceFailoverGroupsClientForceFailoverAllowDataLossPoller provides polling facilities until the operation reaches a terminal state.

func (*InstanceFailoverGroupsClientForceFailoverAllowDataLossPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*InstanceFailoverGroupsClientForceFailoverAllowDataLossPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final InstanceFailoverGroupsClientForceFailoverAllowDataLossResponse will be returned.

func (*InstanceFailoverGroupsClientForceFailoverAllowDataLossPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*InstanceFailoverGroupsClientForceFailoverAllowDataLossPoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type InstanceFailoverGroupsClientForceFailoverAllowDataLossPollerResponse added in v0.3.0

type InstanceFailoverGroupsClientForceFailoverAllowDataLossPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *InstanceFailoverGroupsClientForceFailoverAllowDataLossPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstanceFailoverGroupsClientForceFailoverAllowDataLossPollerResponse contains the response from method InstanceFailoverGroupsClient.ForceFailoverAllowDataLoss.

func (InstanceFailoverGroupsClientForceFailoverAllowDataLossPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*InstanceFailoverGroupsClientForceFailoverAllowDataLossPollerResponse) Resume added in v0.3.0

Resume rehydrates a InstanceFailoverGroupsClientForceFailoverAllowDataLossPollerResponse from the provided client and resume token.

type InstanceFailoverGroupsClientForceFailoverAllowDataLossResponse added in v0.3.0

type InstanceFailoverGroupsClientForceFailoverAllowDataLossResponse struct {
	InstanceFailoverGroupsClientForceFailoverAllowDataLossResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstanceFailoverGroupsClientForceFailoverAllowDataLossResponse contains the response from method InstanceFailoverGroupsClient.ForceFailoverAllowDataLoss.

type InstanceFailoverGroupsClientForceFailoverAllowDataLossResult added in v0.3.0

type InstanceFailoverGroupsClientForceFailoverAllowDataLossResult struct {
	InstanceFailoverGroup
}

InstanceFailoverGroupsClientForceFailoverAllowDataLossResult contains the result from method InstanceFailoverGroupsClient.ForceFailoverAllowDataLoss.

type InstanceFailoverGroupsClientGetOptions added in v0.3.0

type InstanceFailoverGroupsClientGetOptions struct {
}

InstanceFailoverGroupsClientGetOptions contains the optional parameters for the InstanceFailoverGroupsClient.Get method.

type InstanceFailoverGroupsClientGetResponse added in v0.3.0

type InstanceFailoverGroupsClientGetResponse struct {
	InstanceFailoverGroupsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstanceFailoverGroupsClientGetResponse contains the response from method InstanceFailoverGroupsClient.Get.

type InstanceFailoverGroupsClientGetResult added in v0.3.0

type InstanceFailoverGroupsClientGetResult struct {
	InstanceFailoverGroup
}

InstanceFailoverGroupsClientGetResult contains the result from method InstanceFailoverGroupsClient.Get.

type InstanceFailoverGroupsClientListByLocationOptions added in v0.3.0

type InstanceFailoverGroupsClientListByLocationOptions struct {
}

InstanceFailoverGroupsClientListByLocationOptions contains the optional parameters for the InstanceFailoverGroupsClient.ListByLocation method.

type InstanceFailoverGroupsClientListByLocationPager added in v0.3.0

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

InstanceFailoverGroupsClientListByLocationPager provides operations for iterating over paged responses.

func (*InstanceFailoverGroupsClientListByLocationPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*InstanceFailoverGroupsClientListByLocationPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*InstanceFailoverGroupsClientListByLocationPager) PageResponse added in v0.3.0

PageResponse returns the current InstanceFailoverGroupsClientListByLocationResponse page.

type InstanceFailoverGroupsClientListByLocationResponse added in v0.3.0

type InstanceFailoverGroupsClientListByLocationResponse struct {
	InstanceFailoverGroupsClientListByLocationResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstanceFailoverGroupsClientListByLocationResponse contains the response from method InstanceFailoverGroupsClient.ListByLocation.

type InstanceFailoverGroupsClientListByLocationResult added in v0.3.0

type InstanceFailoverGroupsClientListByLocationResult struct {
	InstanceFailoverGroupListResult
}

InstanceFailoverGroupsClientListByLocationResult contains the result from method InstanceFailoverGroupsClient.ListByLocation.

type InstancePool

type InstancePool struct {
	// REQUIRED; Resource location.
	Location *string `json:"location,omitempty"`

	// Resource properties.
	Properties *InstancePoolProperties `json:"properties,omitempty"`

	// The name and tier of the SKU.
	SKU *SKU `json:"sku,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

InstancePool - An Azure SQL instance pool.

func (InstancePool) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type InstancePool.

type InstancePoolEditionCapability

type InstancePoolEditionCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; The instance pool version name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; The supported families.
	SupportedFamilies []*InstancePoolFamilyCapability `json:"supportedFamilies,omitempty" azure:"ro"`
}

InstancePoolEditionCapability - The instance pool capability

func (InstancePoolEditionCapability) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type InstancePoolEditionCapability.

type InstancePoolFamilyCapability

type InstancePoolFamilyCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; Family name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; List of supported license types.
	SupportedLicenseTypes []*LicenseTypeCapability `json:"supportedLicenseTypes,omitempty" azure:"ro"`

	// READ-ONLY; List of supported virtual cores values.
	SupportedVcoresValues []*InstancePoolVcoresCapability `json:"supportedVcoresValues,omitempty" azure:"ro"`
}

InstancePoolFamilyCapability - The instance pool family capability.

func (InstancePoolFamilyCapability) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type InstancePoolFamilyCapability.

type InstancePoolLicenseType

type InstancePoolLicenseType string

InstancePoolLicenseType - The license type. Possible values are 'LicenseIncluded' (price for SQL license is included) and 'BasePrice' (without SQL license price).

const (
	InstancePoolLicenseTypeBasePrice       InstancePoolLicenseType = "BasePrice"
	InstancePoolLicenseTypeLicenseIncluded InstancePoolLicenseType = "LicenseIncluded"
)

func PossibleInstancePoolLicenseTypeValues

func PossibleInstancePoolLicenseTypeValues() []InstancePoolLicenseType

PossibleInstancePoolLicenseTypeValues returns the possible values for the InstancePoolLicenseType const type.

func (InstancePoolLicenseType) ToPtr

ToPtr returns a *InstancePoolLicenseType pointing to the current value.

type InstancePoolListResult

type InstancePoolListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*InstancePool `json:"value,omitempty" azure:"ro"`
}

InstancePoolListResult - A list of Azure SQL instance pools.

func (InstancePoolListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type InstancePoolListResult.

type InstancePoolProperties

type InstancePoolProperties struct {
	// REQUIRED; The license type. Possible values are 'LicenseIncluded' (price for SQL license is included) and 'BasePrice' (without
	// SQL license price).
	LicenseType *InstancePoolLicenseType `json:"licenseType,omitempty"`

	// REQUIRED; Resource ID of the subnet to place this instance pool in.
	SubnetID *string `json:"subnetId,omitempty"`

	// REQUIRED; Count of vCores belonging to this instance pool.
	VCores *int32 `json:"vCores,omitempty"`
}

InstancePoolProperties - Properties of an instance pool.

type InstancePoolUpdate

type InstancePoolUpdate struct {
	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`
}

InstancePoolUpdate - An update to an Instance pool.

func (InstancePoolUpdate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type InstancePoolUpdate.

type InstancePoolVcoresCapability

type InstancePoolVcoresCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; The virtual cores identifier.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; Storage limit.
	StorageLimit *MaxSizeCapability `json:"storageLimit,omitempty" azure:"ro"`

	// READ-ONLY; The virtual cores value.
	Value *int32 `json:"value,omitempty" azure:"ro"`
}

InstancePoolVcoresCapability - The managed instance virtual cores capability.

type InstancePoolsClient

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

InstancePoolsClient contains the methods for the InstancePools group. Don't use this type directly, use NewInstancePoolsClient() instead.

func NewInstancePoolsClient

func NewInstancePoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *InstancePoolsClient

NewInstancePoolsClient creates a new instance of InstancePoolsClient with the specified values. subscriptionID - The 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 (*InstancePoolsClient) BeginCreateOrUpdate

func (client *InstancePoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, instancePoolName string, parameters InstancePool, options *InstancePoolsClientBeginCreateOrUpdateOptions) (InstancePoolsClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates an instance pool. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. instancePoolName - The name of the instance pool to be created or updated. parameters - The requested instance pool resource state. options - InstancePoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the InstancePoolsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateInstancePoolMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewInstancePoolsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<instance-pool-name>",
		armsql.InstancePool{
			Location: to.StringPtr("<location>"),
			Tags: map[string]*string{
				"a": to.StringPtr("b"),
			},
			Properties: &armsql.InstancePoolProperties{
				LicenseType: armsql.InstancePoolLicenseType("LicenseIncluded").ToPtr(),
				SubnetID:    to.StringPtr("<subnet-id>"),
				VCores:      to.Int32Ptr(8),
			},
			SKU: &armsql.SKU{
				Name:   to.StringPtr("<name>"),
				Family: to.StringPtr("<family>"),
				Tier:   to.StringPtr("<tier>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.InstancePoolsClientCreateOrUpdateResult)
}
Output:

func (*InstancePoolsClient) BeginDelete

func (client *InstancePoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, instancePoolName string, options *InstancePoolsClientBeginDeleteOptions) (InstancePoolsClientDeletePollerResponse, error)

BeginDelete - Deletes an instance pool If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. instancePoolName - The name of the instance pool to be deleted options - InstancePoolsClientBeginDeleteOptions contains the optional parameters for the InstancePoolsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteInstancePool.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewInstancePoolsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<instance-pool-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*InstancePoolsClient) BeginUpdate

func (client *InstancePoolsClient) BeginUpdate(ctx context.Context, resourceGroupName string, instancePoolName string, parameters InstancePoolUpdate, options *InstancePoolsClientBeginUpdateOptions) (InstancePoolsClientUpdatePollerResponse, error)

BeginUpdate - Updates an instance pool. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. instancePoolName - The name of the instance pool to be updated. parameters - The requested instance pool resource state. options - InstancePoolsClientBeginUpdateOptions contains the optional parameters for the InstancePoolsClient.BeginUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PatchInstancePool.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewInstancePoolsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdate(ctx,
		"<resource-group-name>",
		"<instance-pool-name>",
		armsql.InstancePoolUpdate{
			Tags: map[string]*string{
				"x": to.StringPtr("y"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.InstancePoolsClientUpdateResult)
}
Output:

func (*InstancePoolsClient) Get

func (client *InstancePoolsClient) Get(ctx context.Context, resourceGroupName string, instancePoolName string, options *InstancePoolsClientGetOptions) (InstancePoolsClientGetResponse, error)

Get - Gets an instance pool. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. instancePoolName - The name of the instance pool to be retrieved. options - InstancePoolsClientGetOptions contains the optional parameters for the InstancePoolsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetInstancePool.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewInstancePoolsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<instance-pool-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.InstancePoolsClientGetResult)
}
Output:

func (*InstancePoolsClient) List

List - Gets a list of all instance pools in the subscription. If the operation fails it returns an *azcore.ResponseError type. options - InstancePoolsClientListOptions contains the optional parameters for the InstancePoolsClient.List method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListInstancePoolsBySubscriptionId.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewInstancePoolsClient("<subscription-id>", cred, nil)
	pager := client.List(nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*InstancePoolsClient) ListByResourceGroup

ListByResourceGroup - Gets a list of instance pools in the resource group If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. options - InstancePoolsClientListByResourceGroupOptions contains the optional parameters for the InstancePoolsClient.ListByResourceGroup method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListInstancePoolsByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewInstancePoolsClient("<subscription-id>", cred, nil)
	pager := client.ListByResourceGroup("<resource-group-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type InstancePoolsClientBeginCreateOrUpdateOptions added in v0.3.0

type InstancePoolsClientBeginCreateOrUpdateOptions struct {
}

InstancePoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the InstancePoolsClient.BeginCreateOrUpdate method.

type InstancePoolsClientBeginDeleteOptions added in v0.3.0

type InstancePoolsClientBeginDeleteOptions struct {
}

InstancePoolsClientBeginDeleteOptions contains the optional parameters for the InstancePoolsClient.BeginDelete method.

type InstancePoolsClientBeginUpdateOptions added in v0.3.0

type InstancePoolsClientBeginUpdateOptions struct {
}

InstancePoolsClientBeginUpdateOptions contains the optional parameters for the InstancePoolsClient.BeginUpdate method.

type InstancePoolsClientCreateOrUpdatePoller added in v0.3.0

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

InstancePoolsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*InstancePoolsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*InstancePoolsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final InstancePoolsClientCreateOrUpdateResponse will be returned.

func (*InstancePoolsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*InstancePoolsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type InstancePoolsClientCreateOrUpdatePollerResponse added in v0.3.0

type InstancePoolsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *InstancePoolsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstancePoolsClientCreateOrUpdatePollerResponse contains the response from method InstancePoolsClient.CreateOrUpdate.

func (InstancePoolsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*InstancePoolsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a InstancePoolsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type InstancePoolsClientCreateOrUpdateResponse added in v0.3.0

type InstancePoolsClientCreateOrUpdateResponse struct {
	InstancePoolsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstancePoolsClientCreateOrUpdateResponse contains the response from method InstancePoolsClient.CreateOrUpdate.

type InstancePoolsClientCreateOrUpdateResult added in v0.3.0

type InstancePoolsClientCreateOrUpdateResult struct {
	InstancePool
}

InstancePoolsClientCreateOrUpdateResult contains the result from method InstancePoolsClient.CreateOrUpdate.

type InstancePoolsClientDeletePoller added in v0.3.0

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

InstancePoolsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*InstancePoolsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*InstancePoolsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final InstancePoolsClientDeleteResponse will be returned.

func (*InstancePoolsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*InstancePoolsClientDeletePoller) ResumeToken added in v0.3.0

func (p *InstancePoolsClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type InstancePoolsClientDeletePollerResponse added in v0.3.0

type InstancePoolsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *InstancePoolsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstancePoolsClientDeletePollerResponse contains the response from method InstancePoolsClient.Delete.

func (InstancePoolsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*InstancePoolsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a InstancePoolsClientDeletePollerResponse from the provided client and resume token.

type InstancePoolsClientDeleteResponse added in v0.3.0

type InstancePoolsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstancePoolsClientDeleteResponse contains the response from method InstancePoolsClient.Delete.

type InstancePoolsClientGetOptions added in v0.3.0

type InstancePoolsClientGetOptions struct {
}

InstancePoolsClientGetOptions contains the optional parameters for the InstancePoolsClient.Get method.

type InstancePoolsClientGetResponse added in v0.3.0

type InstancePoolsClientGetResponse struct {
	InstancePoolsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstancePoolsClientGetResponse contains the response from method InstancePoolsClient.Get.

type InstancePoolsClientGetResult added in v0.3.0

type InstancePoolsClientGetResult struct {
	InstancePool
}

InstancePoolsClientGetResult contains the result from method InstancePoolsClient.Get.

type InstancePoolsClientListByResourceGroupOptions added in v0.3.0

type InstancePoolsClientListByResourceGroupOptions struct {
}

InstancePoolsClientListByResourceGroupOptions contains the optional parameters for the InstancePoolsClient.ListByResourceGroup method.

type InstancePoolsClientListByResourceGroupPager added in v0.3.0

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

InstancePoolsClientListByResourceGroupPager provides operations for iterating over paged responses.

func (*InstancePoolsClientListByResourceGroupPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*InstancePoolsClientListByResourceGroupPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*InstancePoolsClientListByResourceGroupPager) PageResponse added in v0.3.0

PageResponse returns the current InstancePoolsClientListByResourceGroupResponse page.

type InstancePoolsClientListByResourceGroupResponse added in v0.3.0

type InstancePoolsClientListByResourceGroupResponse struct {
	InstancePoolsClientListByResourceGroupResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstancePoolsClientListByResourceGroupResponse contains the response from method InstancePoolsClient.ListByResourceGroup.

type InstancePoolsClientListByResourceGroupResult added in v0.3.0

type InstancePoolsClientListByResourceGroupResult struct {
	InstancePoolListResult
}

InstancePoolsClientListByResourceGroupResult contains the result from method InstancePoolsClient.ListByResourceGroup.

type InstancePoolsClientListOptions added in v0.3.0

type InstancePoolsClientListOptions struct {
}

InstancePoolsClientListOptions contains the optional parameters for the InstancePoolsClient.List method.

type InstancePoolsClientListPager added in v0.3.0

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

InstancePoolsClientListPager provides operations for iterating over paged responses.

func (*InstancePoolsClientListPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*InstancePoolsClientListPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*InstancePoolsClientListPager) PageResponse added in v0.3.0

PageResponse returns the current InstancePoolsClientListResponse page.

type InstancePoolsClientListResponse added in v0.3.0

type InstancePoolsClientListResponse struct {
	InstancePoolsClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstancePoolsClientListResponse contains the response from method InstancePoolsClient.List.

type InstancePoolsClientListResult added in v0.3.0

type InstancePoolsClientListResult struct {
	InstancePoolListResult
}

InstancePoolsClientListResult contains the result from method InstancePoolsClient.List.

type InstancePoolsClientUpdatePoller added in v0.3.0

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

InstancePoolsClientUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*InstancePoolsClientUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*InstancePoolsClientUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final InstancePoolsClientUpdateResponse will be returned.

func (*InstancePoolsClientUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*InstancePoolsClientUpdatePoller) ResumeToken added in v0.3.0

func (p *InstancePoolsClientUpdatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type InstancePoolsClientUpdatePollerResponse added in v0.3.0

type InstancePoolsClientUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *InstancePoolsClientUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstancePoolsClientUpdatePollerResponse contains the response from method InstancePoolsClient.Update.

func (InstancePoolsClientUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*InstancePoolsClientUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a InstancePoolsClientUpdatePollerResponse from the provided client and resume token.

type InstancePoolsClientUpdateResponse added in v0.3.0

type InstancePoolsClientUpdateResponse struct {
	InstancePoolsClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

InstancePoolsClientUpdateResponse contains the response from method InstancePoolsClient.Update.

type InstancePoolsClientUpdateResult added in v0.3.0

type InstancePoolsClientUpdateResult struct {
	InstancePool
}

InstancePoolsClientUpdateResult contains the result from method InstancePoolsClient.Update.

type IsRetryable

type IsRetryable string

IsRetryable - Gets whether the error could be ignored and recommended action could be retried. Possible values are: Yes/No

const (
	IsRetryableYes IsRetryable = "Yes"
	IsRetryableNo  IsRetryable = "No"
)

func PossibleIsRetryableValues

func PossibleIsRetryableValues() []IsRetryable

PossibleIsRetryableValues returns the possible values for the IsRetryable const type.

func (IsRetryable) ToPtr

func (c IsRetryable) ToPtr() *IsRetryable

ToPtr returns a *IsRetryable pointing to the current value.

type Job

type Job struct {
	// Resource properties.
	Properties *JobProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

Job - A job.

type JobAgent

type JobAgent struct {
	// REQUIRED; Resource location.
	Location *string `json:"location,omitempty"`

	// Resource properties.
	Properties *JobAgentProperties `json:"properties,omitempty"`

	// The name and tier of the SKU.
	SKU *SKU `json:"sku,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

JobAgent - An Azure SQL job agent.

func (JobAgent) MarshalJSON

func (j JobAgent) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JobAgent.

type JobAgentListResult

type JobAgentListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*JobAgent `json:"value,omitempty" azure:"ro"`
}

JobAgentListResult - A list of Azure SQL job agents.

func (JobAgentListResult) MarshalJSON

func (j JobAgentListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JobAgentListResult.

type JobAgentProperties

type JobAgentProperties struct {
	// REQUIRED; Resource ID of the database to store job metadata in.
	DatabaseID *string `json:"databaseId,omitempty"`

	// READ-ONLY; The state of the job agent.
	State *JobAgentState `json:"state,omitempty" azure:"ro"`
}

JobAgentProperties - Properties of a job agent.

type JobAgentState

type JobAgentState string

JobAgentState - The state of the job agent.

const (
	JobAgentStateCreating JobAgentState = "Creating"
	JobAgentStateDeleting JobAgentState = "Deleting"
	JobAgentStateDisabled JobAgentState = "Disabled"
	JobAgentStateReady    JobAgentState = "Ready"
	JobAgentStateUpdating JobAgentState = "Updating"
)

func PossibleJobAgentStateValues

func PossibleJobAgentStateValues() []JobAgentState

PossibleJobAgentStateValues returns the possible values for the JobAgentState const type.

func (JobAgentState) ToPtr

func (c JobAgentState) ToPtr() *JobAgentState

ToPtr returns a *JobAgentState pointing to the current value.

type JobAgentUpdate

type JobAgentUpdate struct {
	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`
}

JobAgentUpdate - An update to an Azure SQL job agent.

func (JobAgentUpdate) MarshalJSON

func (j JobAgentUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JobAgentUpdate.

type JobAgentsClient

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

JobAgentsClient contains the methods for the JobAgents group. Don't use this type directly, use NewJobAgentsClient() instead.

func NewJobAgentsClient

func NewJobAgentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *JobAgentsClient

NewJobAgentsClient creates a new instance of JobAgentsClient with the specified values. subscriptionID - The 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 (*JobAgentsClient) BeginCreateOrUpdate

func (client *JobAgentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters JobAgent, options *JobAgentsClientBeginCreateOrUpdateOptions) (JobAgentsClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates a job agent. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent to be created or updated. parameters - The requested job agent resource state. options - JobAgentsClientBeginCreateOrUpdateOptions contains the optional parameters for the JobAgentsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobAgent.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobAgentsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		armsql.JobAgent{
			Location: to.StringPtr("<location>"),
			Properties: &armsql.JobAgentProperties{
				DatabaseID: to.StringPtr("<database-id>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobAgentsClientCreateOrUpdateResult)
}
Output:

func (*JobAgentsClient) BeginDelete

func (client *JobAgentsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, options *JobAgentsClientBeginDeleteOptions) (JobAgentsClientDeletePollerResponse, error)

BeginDelete - Deletes a job agent. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent to be deleted. options - JobAgentsClientBeginDeleteOptions contains the optional parameters for the JobAgentsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobAgent.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobAgentsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*JobAgentsClient) BeginUpdate

func (client *JobAgentsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters JobAgentUpdate, options *JobAgentsClientBeginUpdateOptions) (JobAgentsClientUpdatePollerResponse, error)

BeginUpdate - Updates a job agent. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent to be updated. parameters - The update to the job agent. options - JobAgentsClientBeginUpdateOptions contains the optional parameters for the JobAgentsClient.BeginUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateJobAgent.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobAgentsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		armsql.JobAgentUpdate{
			Tags: map[string]*string{
				"mytag1": to.StringPtr("myvalue1"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobAgentsClientUpdateResult)
}
Output:

func (*JobAgentsClient) Get

func (client *JobAgentsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, options *JobAgentsClientGetOptions) (JobAgentsClientGetResponse, error)

Get - Gets a job agent. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent to be retrieved. options - JobAgentsClientGetOptions contains the optional parameters for the JobAgentsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobAgent.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobAgentsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobAgentsClientGetResult)
}
Output:

func (*JobAgentsClient) ListByServer

func (client *JobAgentsClient) ListByServer(resourceGroupName string, serverName string, options *JobAgentsClientListByServerOptions) *JobAgentsClientListByServerPager

ListByServer - Gets a list of job agents in a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - JobAgentsClientListByServerOptions contains the optional parameters for the JobAgentsClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobAgentsByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobAgentsClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type JobAgentsClientBeginCreateOrUpdateOptions added in v0.3.0

type JobAgentsClientBeginCreateOrUpdateOptions struct {
}

JobAgentsClientBeginCreateOrUpdateOptions contains the optional parameters for the JobAgentsClient.BeginCreateOrUpdate method.

type JobAgentsClientBeginDeleteOptions added in v0.3.0

type JobAgentsClientBeginDeleteOptions struct {
}

JobAgentsClientBeginDeleteOptions contains the optional parameters for the JobAgentsClient.BeginDelete method.

type JobAgentsClientBeginUpdateOptions added in v0.3.0

type JobAgentsClientBeginUpdateOptions struct {
}

JobAgentsClientBeginUpdateOptions contains the optional parameters for the JobAgentsClient.BeginUpdate method.

type JobAgentsClientCreateOrUpdatePoller added in v0.3.0

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

JobAgentsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*JobAgentsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*JobAgentsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final JobAgentsClientCreateOrUpdateResponse will be returned.

func (*JobAgentsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*JobAgentsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

func (p *JobAgentsClientCreateOrUpdatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type JobAgentsClientCreateOrUpdatePollerResponse added in v0.3.0

type JobAgentsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *JobAgentsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobAgentsClientCreateOrUpdatePollerResponse contains the response from method JobAgentsClient.CreateOrUpdate.

func (JobAgentsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*JobAgentsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a JobAgentsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type JobAgentsClientCreateOrUpdateResponse added in v0.3.0

type JobAgentsClientCreateOrUpdateResponse struct {
	JobAgentsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobAgentsClientCreateOrUpdateResponse contains the response from method JobAgentsClient.CreateOrUpdate.

type JobAgentsClientCreateOrUpdateResult added in v0.3.0

type JobAgentsClientCreateOrUpdateResult struct {
	JobAgent
}

JobAgentsClientCreateOrUpdateResult contains the result from method JobAgentsClient.CreateOrUpdate.

type JobAgentsClientDeletePoller added in v0.3.0

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

JobAgentsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*JobAgentsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*JobAgentsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final JobAgentsClientDeleteResponse will be returned.

func (*JobAgentsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*JobAgentsClientDeletePoller) ResumeToken added in v0.3.0

func (p *JobAgentsClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type JobAgentsClientDeletePollerResponse added in v0.3.0

type JobAgentsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *JobAgentsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobAgentsClientDeletePollerResponse contains the response from method JobAgentsClient.Delete.

func (JobAgentsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*JobAgentsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a JobAgentsClientDeletePollerResponse from the provided client and resume token.

type JobAgentsClientDeleteResponse added in v0.3.0

type JobAgentsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobAgentsClientDeleteResponse contains the response from method JobAgentsClient.Delete.

type JobAgentsClientGetOptions added in v0.3.0

type JobAgentsClientGetOptions struct {
}

JobAgentsClientGetOptions contains the optional parameters for the JobAgentsClient.Get method.

type JobAgentsClientGetResponse added in v0.3.0

type JobAgentsClientGetResponse struct {
	JobAgentsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobAgentsClientGetResponse contains the response from method JobAgentsClient.Get.

type JobAgentsClientGetResult added in v0.3.0

type JobAgentsClientGetResult struct {
	JobAgent
}

JobAgentsClientGetResult contains the result from method JobAgentsClient.Get.

type JobAgentsClientListByServerOptions added in v0.3.0

type JobAgentsClientListByServerOptions struct {
}

JobAgentsClientListByServerOptions contains the optional parameters for the JobAgentsClient.ListByServer method.

type JobAgentsClientListByServerPager added in v0.3.0

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

JobAgentsClientListByServerPager provides operations for iterating over paged responses.

func (*JobAgentsClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*JobAgentsClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*JobAgentsClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current JobAgentsClientListByServerResponse page.

type JobAgentsClientListByServerResponse added in v0.3.0

type JobAgentsClientListByServerResponse struct {
	JobAgentsClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobAgentsClientListByServerResponse contains the response from method JobAgentsClient.ListByServer.

type JobAgentsClientListByServerResult added in v0.3.0

type JobAgentsClientListByServerResult struct {
	JobAgentListResult
}

JobAgentsClientListByServerResult contains the result from method JobAgentsClient.ListByServer.

type JobAgentsClientUpdatePoller added in v0.3.0

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

JobAgentsClientUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*JobAgentsClientUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*JobAgentsClientUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final JobAgentsClientUpdateResponse will be returned.

func (*JobAgentsClientUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*JobAgentsClientUpdatePoller) ResumeToken added in v0.3.0

func (p *JobAgentsClientUpdatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type JobAgentsClientUpdatePollerResponse added in v0.3.0

type JobAgentsClientUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *JobAgentsClientUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobAgentsClientUpdatePollerResponse contains the response from method JobAgentsClient.Update.

func (JobAgentsClientUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*JobAgentsClientUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a JobAgentsClientUpdatePollerResponse from the provided client and resume token.

type JobAgentsClientUpdateResponse added in v0.3.0

type JobAgentsClientUpdateResponse struct {
	JobAgentsClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobAgentsClientUpdateResponse contains the response from method JobAgentsClient.Update.

type JobAgentsClientUpdateResult added in v0.3.0

type JobAgentsClientUpdateResult struct {
	JobAgent
}

JobAgentsClientUpdateResult contains the result from method JobAgentsClient.Update.

type JobCredential

type JobCredential struct {
	// Resource properties.
	Properties *JobCredentialProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

JobCredential - A stored credential that can be used by a job to connect to target databases.

type JobCredentialListResult

type JobCredentialListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*JobCredential `json:"value,omitempty" azure:"ro"`
}

JobCredentialListResult - A list of job credentials.

func (JobCredentialListResult) MarshalJSON

func (j JobCredentialListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JobCredentialListResult.

type JobCredentialProperties

type JobCredentialProperties struct {
	// REQUIRED; The credential password.
	Password *string `json:"password,omitempty"`

	// REQUIRED; The credential user name.
	Username *string `json:"username,omitempty"`
}

JobCredentialProperties - Properties of a job credential.

type JobCredentialsClient

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

JobCredentialsClient contains the methods for the JobCredentials group. Don't use this type directly, use NewJobCredentialsClient() instead.

func NewJobCredentialsClient

func NewJobCredentialsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *JobCredentialsClient

NewJobCredentialsClient creates a new instance of JobCredentialsClient with the specified values. subscriptionID - The 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 (*JobCredentialsClient) CreateOrUpdate

func (client *JobCredentialsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string, parameters JobCredential, options *JobCredentialsClientCreateOrUpdateOptions) (JobCredentialsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates a job credential. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. credentialName - The name of the credential. parameters - The requested job credential state. options - JobCredentialsClientCreateOrUpdateOptions contains the optional parameters for the JobCredentialsClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobCredential.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobCredentialsClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<credential-name>",
		armsql.JobCredential{
			Properties: &armsql.JobCredentialProperties{
				Password: to.StringPtr("<password>"),
				Username: to.StringPtr("<username>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobCredentialsClientCreateOrUpdateResult)
}
Output:

func (*JobCredentialsClient) Delete

func (client *JobCredentialsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string, options *JobCredentialsClientDeleteOptions) (JobCredentialsClientDeleteResponse, error)

Delete - Deletes a job credential. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. credentialName - The name of the credential. options - JobCredentialsClientDeleteOptions contains the optional parameters for the JobCredentialsClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobCredential.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobCredentialsClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<credential-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*JobCredentialsClient) Get

func (client *JobCredentialsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string, options *JobCredentialsClientGetOptions) (JobCredentialsClientGetResponse, error)

Get - Gets a jobs credential. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. credentialName - The name of the credential. options - JobCredentialsClientGetOptions contains the optional parameters for the JobCredentialsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobCredential.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobCredentialsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<credential-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobCredentialsClientGetResult)
}
Output:

func (*JobCredentialsClient) ListByAgent

func (client *JobCredentialsClient) ListByAgent(resourceGroupName string, serverName string, jobAgentName string, options *JobCredentialsClientListByAgentOptions) *JobCredentialsClientListByAgentPager

ListByAgent - Gets a list of jobs credentials. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. options - JobCredentialsClientListByAgentOptions contains the optional parameters for the JobCredentialsClient.ListByAgent method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobCredentialsByAgent.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobCredentialsClient("<subscription-id>", cred, nil)
	pager := client.ListByAgent("<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type JobCredentialsClientCreateOrUpdateOptions added in v0.3.0

type JobCredentialsClientCreateOrUpdateOptions struct {
}

JobCredentialsClientCreateOrUpdateOptions contains the optional parameters for the JobCredentialsClient.CreateOrUpdate method.

type JobCredentialsClientCreateOrUpdateResponse added in v0.3.0

type JobCredentialsClientCreateOrUpdateResponse struct {
	JobCredentialsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobCredentialsClientCreateOrUpdateResponse contains the response from method JobCredentialsClient.CreateOrUpdate.

type JobCredentialsClientCreateOrUpdateResult added in v0.3.0

type JobCredentialsClientCreateOrUpdateResult struct {
	JobCredential
}

JobCredentialsClientCreateOrUpdateResult contains the result from method JobCredentialsClient.CreateOrUpdate.

type JobCredentialsClientDeleteOptions added in v0.3.0

type JobCredentialsClientDeleteOptions struct {
}

JobCredentialsClientDeleteOptions contains the optional parameters for the JobCredentialsClient.Delete method.

type JobCredentialsClientDeleteResponse added in v0.3.0

type JobCredentialsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobCredentialsClientDeleteResponse contains the response from method JobCredentialsClient.Delete.

type JobCredentialsClientGetOptions added in v0.3.0

type JobCredentialsClientGetOptions struct {
}

JobCredentialsClientGetOptions contains the optional parameters for the JobCredentialsClient.Get method.

type JobCredentialsClientGetResponse added in v0.3.0

type JobCredentialsClientGetResponse struct {
	JobCredentialsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobCredentialsClientGetResponse contains the response from method JobCredentialsClient.Get.

type JobCredentialsClientGetResult added in v0.3.0

type JobCredentialsClientGetResult struct {
	JobCredential
}

JobCredentialsClientGetResult contains the result from method JobCredentialsClient.Get.

type JobCredentialsClientListByAgentOptions added in v0.3.0

type JobCredentialsClientListByAgentOptions struct {
}

JobCredentialsClientListByAgentOptions contains the optional parameters for the JobCredentialsClient.ListByAgent method.

type JobCredentialsClientListByAgentPager added in v0.3.0

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

JobCredentialsClientListByAgentPager provides operations for iterating over paged responses.

func (*JobCredentialsClientListByAgentPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*JobCredentialsClientListByAgentPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*JobCredentialsClientListByAgentPager) PageResponse added in v0.3.0

PageResponse returns the current JobCredentialsClientListByAgentResponse page.

type JobCredentialsClientListByAgentResponse added in v0.3.0

type JobCredentialsClientListByAgentResponse struct {
	JobCredentialsClientListByAgentResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobCredentialsClientListByAgentResponse contains the response from method JobCredentialsClient.ListByAgent.

type JobCredentialsClientListByAgentResult added in v0.3.0

type JobCredentialsClientListByAgentResult struct {
	JobCredentialListResult
}

JobCredentialsClientListByAgentResult contains the result from method JobCredentialsClient.ListByAgent.

type JobExecution

type JobExecution struct {
	// Resource properties.
	Properties *JobExecutionProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

JobExecution - An execution of a job

type JobExecutionLifecycle

type JobExecutionLifecycle string

JobExecutionLifecycle - The detailed state of the job execution.

const (
	JobExecutionLifecycleCanceled                     JobExecutionLifecycle = "Canceled"
	JobExecutionLifecycleCreated                      JobExecutionLifecycle = "Created"
	JobExecutionLifecycleFailed                       JobExecutionLifecycle = "Failed"
	JobExecutionLifecycleInProgress                   JobExecutionLifecycle = "InProgress"
	JobExecutionLifecycleSkipped                      JobExecutionLifecycle = "Skipped"
	JobExecutionLifecycleSucceeded                    JobExecutionLifecycle = "Succeeded"
	JobExecutionLifecycleSucceededWithSkipped         JobExecutionLifecycle = "SucceededWithSkipped"
	JobExecutionLifecycleTimedOut                     JobExecutionLifecycle = "TimedOut"
	JobExecutionLifecycleWaitingForChildJobExecutions JobExecutionLifecycle = "WaitingForChildJobExecutions"
	JobExecutionLifecycleWaitingForRetry              JobExecutionLifecycle = "WaitingForRetry"
)

func PossibleJobExecutionLifecycleValues

func PossibleJobExecutionLifecycleValues() []JobExecutionLifecycle

PossibleJobExecutionLifecycleValues returns the possible values for the JobExecutionLifecycle const type.

func (JobExecutionLifecycle) ToPtr

ToPtr returns a *JobExecutionLifecycle pointing to the current value.

type JobExecutionListResult

type JobExecutionListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*JobExecution `json:"value,omitempty" azure:"ro"`
}

JobExecutionListResult - A list of job executions.

func (JobExecutionListResult) MarshalJSON

func (j JobExecutionListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JobExecutionListResult.

type JobExecutionProperties

type JobExecutionProperties struct {
	// Number of times the job execution has been attempted.
	CurrentAttempts *int32 `json:"currentAttempts,omitempty"`

	// READ-ONLY; The time that the job execution was created.
	CreateTime *time.Time `json:"createTime,omitempty" azure:"ro"`

	// READ-ONLY; Start time of the current attempt.
	CurrentAttemptStartTime *time.Time `json:"currentAttemptStartTime,omitempty" azure:"ro"`

	// READ-ONLY; The time that the job execution completed.
	EndTime *time.Time `json:"endTime,omitempty" azure:"ro"`

	// READ-ONLY; The unique identifier of the job execution.
	JobExecutionID *string `json:"jobExecutionId,omitempty" azure:"ro"`

	// READ-ONLY; The job version number.
	JobVersion *int32 `json:"jobVersion,omitempty" azure:"ro"`

	// READ-ONLY; The last status or error message.
	LastMessage *string `json:"lastMessage,omitempty" azure:"ro"`

	// READ-ONLY; The detailed state of the job execution.
	Lifecycle *JobExecutionLifecycle `json:"lifecycle,omitempty" azure:"ro"`

	// READ-ONLY; The ARM provisioning state of the job execution.
	ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"`

	// READ-ONLY; The time that the job execution started.
	StartTime *time.Time `json:"startTime,omitempty" azure:"ro"`

	// READ-ONLY; The job step id.
	StepID *int32 `json:"stepId,omitempty" azure:"ro"`

	// READ-ONLY; The job step name.
	StepName *string `json:"stepName,omitempty" azure:"ro"`

	// READ-ONLY; The target that this execution is executed on.
	Target *JobExecutionTarget `json:"target,omitempty" azure:"ro"`
}

JobExecutionProperties - Properties for an Azure SQL Database Elastic job execution.

func (JobExecutionProperties) MarshalJSON

func (j JobExecutionProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JobExecutionProperties.

func (*JobExecutionProperties) UnmarshalJSON

func (j *JobExecutionProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionProperties.

type JobExecutionTarget

type JobExecutionTarget struct {
	// READ-ONLY; The database name.
	DatabaseName *string `json:"databaseName,omitempty" azure:"ro"`

	// READ-ONLY; The server name.
	ServerName *string `json:"serverName,omitempty" azure:"ro"`

	// READ-ONLY; The type of the target.
	Type *JobTargetType `json:"type,omitempty" azure:"ro"`
}

JobExecutionTarget - The target that a job execution is executed on.

type JobExecutionsClient

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

JobExecutionsClient contains the methods for the JobExecutions group. Don't use this type directly, use NewJobExecutionsClient() instead.

func NewJobExecutionsClient

func NewJobExecutionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *JobExecutionsClient

NewJobExecutionsClient creates a new instance of JobExecutionsClient with the specified values. subscriptionID - The 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 (*JobExecutionsClient) BeginCreate

func (client *JobExecutionsClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobExecutionsClientBeginCreateOptions) (JobExecutionsClientCreatePollerResponse, error)

BeginCreate - Starts an elastic job execution. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job to get. options - JobExecutionsClientBeginCreateOptions contains the optional parameters for the JobExecutionsClient.BeginCreate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateJobExecution.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobExecutionsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobExecutionsClientCreateResult)
}
Output:

func (*JobExecutionsClient) BeginCreateOrUpdate

func (client *JobExecutionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, options *JobExecutionsClientBeginCreateOrUpdateOptions) (JobExecutionsClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates a job execution. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job to get. jobExecutionID - The job execution id to create the job execution under. options - JobExecutionsClientBeginCreateOrUpdateOptions contains the optional parameters for the JobExecutionsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobExecution.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobExecutionsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		"<job-execution-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobExecutionsClientCreateOrUpdateResult)
}
Output:

func (*JobExecutionsClient) Cancel

func (client *JobExecutionsClient) Cancel(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, options *JobExecutionsClientCancelOptions) (JobExecutionsClientCancelResponse, error)

Cancel - Requests cancellation of a job execution. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job. jobExecutionID - The id of the job execution to cancel. options - JobExecutionsClientCancelOptions contains the optional parameters for the JobExecutionsClient.Cancel method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelJobExecution.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobExecutionsClient("<subscription-id>", cred, nil)
	_, err = client.Cancel(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		"<job-execution-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*JobExecutionsClient) Get

func (client *JobExecutionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, options *JobExecutionsClientGetOptions) (JobExecutionsClientGetResponse, error)

Get - Gets a job execution. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job. jobExecutionID - The id of the job execution options - JobExecutionsClientGetOptions contains the optional parameters for the JobExecutionsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecution.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobExecutionsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		"<job-execution-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobExecutionsClientGetResult)
}
Output:

func (*JobExecutionsClient) ListByAgent

func (client *JobExecutionsClient) ListByAgent(resourceGroupName string, serverName string, jobAgentName string, options *JobExecutionsClientListByAgentOptions) *JobExecutionsClientListByAgentPager

ListByAgent - Lists all executions in a job agent. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. options - JobExecutionsClientListByAgentOptions contains the optional parameters for the JobExecutionsClient.ListByAgent method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgentWithFilter.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobExecutionsClient("<subscription-id>", cred, nil)
	pager := client.ListByAgent("<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		&armsql.JobExecutionsClientListByAgentOptions{CreateTimeMin: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:00:00Z"); return t }()),
			CreateTimeMax: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:05:00Z"); return t }()),
			EndTimeMin:    to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:20:00Z"); return t }()),
			EndTimeMax:    to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:25:00Z"); return t }()),
			IsActive:      to.BoolPtr(false),
			Skip:          nil,
			Top:           nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*JobExecutionsClient) ListByJob

func (client *JobExecutionsClient) ListByJob(resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobExecutionsClientListByJobOptions) *JobExecutionsClientListByJobPager

ListByJob - Lists a job's executions. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job to get. options - JobExecutionsClientListByJobOptions contains the optional parameters for the JobExecutionsClient.ListByJob method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByJob.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobExecutionsClient("<subscription-id>", cred, nil)
	pager := client.ListByJob("<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		&armsql.JobExecutionsClientListByJobOptions{CreateTimeMin: nil,
			CreateTimeMax: nil,
			EndTimeMin:    nil,
			EndTimeMax:    nil,
			IsActive:      nil,
			Skip:          nil,
			Top:           nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type JobExecutionsClientBeginCreateOptions added in v0.3.0

type JobExecutionsClientBeginCreateOptions struct {
}

JobExecutionsClientBeginCreateOptions contains the optional parameters for the JobExecutionsClient.BeginCreate method.

type JobExecutionsClientBeginCreateOrUpdateOptions added in v0.3.0

type JobExecutionsClientBeginCreateOrUpdateOptions struct {
}

JobExecutionsClientBeginCreateOrUpdateOptions contains the optional parameters for the JobExecutionsClient.BeginCreateOrUpdate method.

type JobExecutionsClientCancelOptions added in v0.3.0

type JobExecutionsClientCancelOptions struct {
}

JobExecutionsClientCancelOptions contains the optional parameters for the JobExecutionsClient.Cancel method.

type JobExecutionsClientCancelResponse added in v0.3.0

type JobExecutionsClientCancelResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobExecutionsClientCancelResponse contains the response from method JobExecutionsClient.Cancel.

type JobExecutionsClientCreateOrUpdatePoller added in v0.3.0

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

JobExecutionsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*JobExecutionsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*JobExecutionsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final JobExecutionsClientCreateOrUpdateResponse will be returned.

func (*JobExecutionsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*JobExecutionsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type JobExecutionsClientCreateOrUpdatePollerResponse added in v0.3.0

type JobExecutionsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *JobExecutionsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobExecutionsClientCreateOrUpdatePollerResponse contains the response from method JobExecutionsClient.CreateOrUpdate.

func (JobExecutionsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*JobExecutionsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a JobExecutionsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type JobExecutionsClientCreateOrUpdateResponse added in v0.3.0

type JobExecutionsClientCreateOrUpdateResponse struct {
	JobExecutionsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobExecutionsClientCreateOrUpdateResponse contains the response from method JobExecutionsClient.CreateOrUpdate.

type JobExecutionsClientCreateOrUpdateResult added in v0.3.0

type JobExecutionsClientCreateOrUpdateResult struct {
	JobExecution
}

JobExecutionsClientCreateOrUpdateResult contains the result from method JobExecutionsClient.CreateOrUpdate.

type JobExecutionsClientCreatePoller added in v0.3.0

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

JobExecutionsClientCreatePoller provides polling facilities until the operation reaches a terminal state.

func (*JobExecutionsClientCreatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*JobExecutionsClientCreatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final JobExecutionsClientCreateResponse will be returned.

func (*JobExecutionsClientCreatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*JobExecutionsClientCreatePoller) ResumeToken added in v0.3.0

func (p *JobExecutionsClientCreatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type JobExecutionsClientCreatePollerResponse added in v0.3.0

type JobExecutionsClientCreatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *JobExecutionsClientCreatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobExecutionsClientCreatePollerResponse contains the response from method JobExecutionsClient.Create.

func (JobExecutionsClientCreatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*JobExecutionsClientCreatePollerResponse) Resume added in v0.3.0

Resume rehydrates a JobExecutionsClientCreatePollerResponse from the provided client and resume token.

type JobExecutionsClientCreateResponse added in v0.3.0

type JobExecutionsClientCreateResponse struct {
	JobExecutionsClientCreateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobExecutionsClientCreateResponse contains the response from method JobExecutionsClient.Create.

type JobExecutionsClientCreateResult added in v0.3.0

type JobExecutionsClientCreateResult struct {
	JobExecution
}

JobExecutionsClientCreateResult contains the result from method JobExecutionsClient.Create.

type JobExecutionsClientGetOptions added in v0.3.0

type JobExecutionsClientGetOptions struct {
}

JobExecutionsClientGetOptions contains the optional parameters for the JobExecutionsClient.Get method.

type JobExecutionsClientGetResponse added in v0.3.0

type JobExecutionsClientGetResponse struct {
	JobExecutionsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobExecutionsClientGetResponse contains the response from method JobExecutionsClient.Get.

type JobExecutionsClientGetResult added in v0.3.0

type JobExecutionsClientGetResult struct {
	JobExecution
}

JobExecutionsClientGetResult contains the result from method JobExecutionsClient.Get.

type JobExecutionsClientListByAgentOptions added in v0.3.0

type JobExecutionsClientListByAgentOptions struct {
	// If specified, only job executions created before the specified time are included.
	CreateTimeMax *time.Time
	// If specified, only job executions created at or after the specified time are included.
	CreateTimeMin *time.Time
	// If specified, only job executions completed before the specified time are included.
	EndTimeMax *time.Time
	// If specified, only job executions completed at or after the specified time are included.
	EndTimeMin *time.Time
	// If specified, only active or only completed job executions are included.
	IsActive *bool
	// The number of elements in the collection to skip.
	Skip *int32
	// The number of elements to return from the collection.
	Top *int32
}

JobExecutionsClientListByAgentOptions contains the optional parameters for the JobExecutionsClient.ListByAgent method.

type JobExecutionsClientListByAgentPager added in v0.3.0

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

JobExecutionsClientListByAgentPager provides operations for iterating over paged responses.

func (*JobExecutionsClientListByAgentPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*JobExecutionsClientListByAgentPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*JobExecutionsClientListByAgentPager) PageResponse added in v0.3.0

PageResponse returns the current JobExecutionsClientListByAgentResponse page.

type JobExecutionsClientListByAgentResponse added in v0.3.0

type JobExecutionsClientListByAgentResponse struct {
	JobExecutionsClientListByAgentResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobExecutionsClientListByAgentResponse contains the response from method JobExecutionsClient.ListByAgent.

type JobExecutionsClientListByAgentResult added in v0.3.0

type JobExecutionsClientListByAgentResult struct {
	JobExecutionListResult
}

JobExecutionsClientListByAgentResult contains the result from method JobExecutionsClient.ListByAgent.

type JobExecutionsClientListByJobOptions added in v0.3.0

type JobExecutionsClientListByJobOptions struct {
	// If specified, only job executions created before the specified time are included.
	CreateTimeMax *time.Time
	// If specified, only job executions created at or after the specified time are included.
	CreateTimeMin *time.Time
	// If specified, only job executions completed before the specified time are included.
	EndTimeMax *time.Time
	// If specified, only job executions completed at or after the specified time are included.
	EndTimeMin *time.Time
	// If specified, only active or only completed job executions are included.
	IsActive *bool
	// The number of elements in the collection to skip.
	Skip *int32
	// The number of elements to return from the collection.
	Top *int32
}

JobExecutionsClientListByJobOptions contains the optional parameters for the JobExecutionsClient.ListByJob method.

type JobExecutionsClientListByJobPager added in v0.3.0

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

JobExecutionsClientListByJobPager provides operations for iterating over paged responses.

func (*JobExecutionsClientListByJobPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*JobExecutionsClientListByJobPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*JobExecutionsClientListByJobPager) PageResponse added in v0.3.0

PageResponse returns the current JobExecutionsClientListByJobResponse page.

type JobExecutionsClientListByJobResponse added in v0.3.0

type JobExecutionsClientListByJobResponse struct {
	JobExecutionsClientListByJobResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobExecutionsClientListByJobResponse contains the response from method JobExecutionsClient.ListByJob.

type JobExecutionsClientListByJobResult added in v0.3.0

type JobExecutionsClientListByJobResult struct {
	JobExecutionListResult
}

JobExecutionsClientListByJobResult contains the result from method JobExecutionsClient.ListByJob.

type JobListResult

type JobListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*Job `json:"value,omitempty" azure:"ro"`
}

JobListResult - A list of jobs.

func (JobListResult) MarshalJSON

func (j JobListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JobListResult.

type JobProperties

type JobProperties struct {
	// User-defined description of the job.
	Description *string `json:"description,omitempty"`

	// Schedule properties of the job.
	Schedule *JobSchedule `json:"schedule,omitempty"`

	// READ-ONLY; The job version number.
	Version *int32 `json:"version,omitempty" azure:"ro"`
}

JobProperties - Properties of a job.

type JobSchedule

type JobSchedule struct {
	// Whether or not the schedule is enabled.
	Enabled *bool `json:"enabled,omitempty"`

	// Schedule end time.
	EndTime *time.Time `json:"endTime,omitempty"`

	// Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.
	Interval *string `json:"interval,omitempty"`

	// Schedule start time.
	StartTime *time.Time `json:"startTime,omitempty"`

	// Schedule interval type
	Type *JobScheduleType `json:"type,omitempty"`
}

JobSchedule - Scheduling properties of a job.

func (JobSchedule) MarshalJSON

func (j JobSchedule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JobSchedule.

func (*JobSchedule) UnmarshalJSON

func (j *JobSchedule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type JobSchedule.

type JobScheduleType

type JobScheduleType string

JobScheduleType - Schedule interval type

const (
	JobScheduleTypeOnce      JobScheduleType = "Once"
	JobScheduleTypeRecurring JobScheduleType = "Recurring"
)

func PossibleJobScheduleTypeValues

func PossibleJobScheduleTypeValues() []JobScheduleType

PossibleJobScheduleTypeValues returns the possible values for the JobScheduleType const type.

func (JobScheduleType) ToPtr

func (c JobScheduleType) ToPtr() *JobScheduleType

ToPtr returns a *JobScheduleType pointing to the current value.

type JobStep

type JobStep struct {
	// Resource properties.
	Properties *JobStepProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

JobStep - A job step.

type JobStepAction

type JobStepAction struct {
	// REQUIRED; The action value, for example the text of the T-SQL script to execute.
	Value *string `json:"value,omitempty"`

	// The source of the action to execute.
	Source *JobStepActionSource `json:"source,omitempty"`

	// Type of action being executed by the job step.
	Type *JobStepActionType `json:"type,omitempty"`
}

JobStepAction - The action to be executed by a job step.

type JobStepActionSource

type JobStepActionSource string

JobStepActionSource - The source of the action to execute.

const (
	JobStepActionSourceInline JobStepActionSource = "Inline"
)

func PossibleJobStepActionSourceValues

func PossibleJobStepActionSourceValues() []JobStepActionSource

PossibleJobStepActionSourceValues returns the possible values for the JobStepActionSource const type.

func (JobStepActionSource) ToPtr

ToPtr returns a *JobStepActionSource pointing to the current value.

type JobStepActionType

type JobStepActionType string

JobStepActionType - Type of action being executed by the job step.

const (
	JobStepActionTypeTSQL JobStepActionType = "TSql"
)

func PossibleJobStepActionTypeValues

func PossibleJobStepActionTypeValues() []JobStepActionType

PossibleJobStepActionTypeValues returns the possible values for the JobStepActionType const type.

func (JobStepActionType) ToPtr

ToPtr returns a *JobStepActionType pointing to the current value.

type JobStepExecutionOptions

type JobStepExecutionOptions struct {
	// Initial delay between retries for job step execution.
	InitialRetryIntervalSeconds *int32 `json:"initialRetryIntervalSeconds,omitempty"`

	// The maximum amount of time to wait between retries for job step execution.
	MaximumRetryIntervalSeconds *int32 `json:"maximumRetryIntervalSeconds,omitempty"`

	// Maximum number of times the job step will be reattempted if the first attempt fails.
	RetryAttempts *int32 `json:"retryAttempts,omitempty"`

	// The backoff multiplier for the time between retries.
	RetryIntervalBackoffMultiplier *float32 `json:"retryIntervalBackoffMultiplier,omitempty"`

	// Execution timeout for the job step.
	TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
}

JobStepExecutionOptions - The execution options of a job step.

type JobStepExecutionsClient

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

JobStepExecutionsClient contains the methods for the JobStepExecutions group. Don't use this type directly, use NewJobStepExecutionsClient() instead.

func NewJobStepExecutionsClient

func NewJobStepExecutionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *JobStepExecutionsClient

NewJobStepExecutionsClient creates a new instance of JobStepExecutionsClient with the specified values. subscriptionID - The 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 (*JobStepExecutionsClient) Get

func (client *JobStepExecutionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, stepName string, options *JobStepExecutionsClientGetOptions) (JobStepExecutionsClientGetResponse, error)

Get - Gets a step execution of a job execution. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job to get. jobExecutionID - The unique id of the job execution stepName - The name of the step. options - JobStepExecutionsClientGetOptions contains the optional parameters for the JobStepExecutionsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionStep.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobStepExecutionsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		"<job-execution-id>",
		"<step-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobStepExecutionsClientGetResult)
}
Output:

func (*JobStepExecutionsClient) ListByJobExecution

func (client *JobStepExecutionsClient) ListByJobExecution(resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, options *JobStepExecutionsClientListByJobExecutionOptions) *JobStepExecutionsClientListByJobExecutionPager

ListByJobExecution - Lists the step executions of a job execution. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job to get. jobExecutionID - The id of the job execution options - JobStepExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobStepExecutionsClient.ListByJobExecution method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionSteps.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobStepExecutionsClient("<subscription-id>", cred, nil)
	pager := client.ListByJobExecution("<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		"<job-execution-id>",
		&armsql.JobStepExecutionsClientListByJobExecutionOptions{CreateTimeMin: nil,
			CreateTimeMax: nil,
			EndTimeMin:    nil,
			EndTimeMax:    nil,
			IsActive:      nil,
			Skip:          nil,
			Top:           nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type JobStepExecutionsClientGetOptions added in v0.3.0

type JobStepExecutionsClientGetOptions struct {
}

JobStepExecutionsClientGetOptions contains the optional parameters for the JobStepExecutionsClient.Get method.

type JobStepExecutionsClientGetResponse added in v0.3.0

type JobStepExecutionsClientGetResponse struct {
	JobStepExecutionsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobStepExecutionsClientGetResponse contains the response from method JobStepExecutionsClient.Get.

type JobStepExecutionsClientGetResult added in v0.3.0

type JobStepExecutionsClientGetResult struct {
	JobExecution
}

JobStepExecutionsClientGetResult contains the result from method JobStepExecutionsClient.Get.

type JobStepExecutionsClientListByJobExecutionOptions added in v0.3.0

type JobStepExecutionsClientListByJobExecutionOptions struct {
	// If specified, only job executions created before the specified time are included.
	CreateTimeMax *time.Time
	// If specified, only job executions created at or after the specified time are included.
	CreateTimeMin *time.Time
	// If specified, only job executions completed before the specified time are included.
	EndTimeMax *time.Time
	// If specified, only job executions completed at or after the specified time are included.
	EndTimeMin *time.Time
	// If specified, only active or only completed job executions are included.
	IsActive *bool
	// The number of elements in the collection to skip.
	Skip *int32
	// The number of elements to return from the collection.
	Top *int32
}

JobStepExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobStepExecutionsClient.ListByJobExecution method.

type JobStepExecutionsClientListByJobExecutionPager added in v0.3.0

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

JobStepExecutionsClientListByJobExecutionPager provides operations for iterating over paged responses.

func (*JobStepExecutionsClientListByJobExecutionPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*JobStepExecutionsClientListByJobExecutionPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*JobStepExecutionsClientListByJobExecutionPager) PageResponse added in v0.3.0

PageResponse returns the current JobStepExecutionsClientListByJobExecutionResponse page.

type JobStepExecutionsClientListByJobExecutionResponse added in v0.3.0

type JobStepExecutionsClientListByJobExecutionResponse struct {
	JobStepExecutionsClientListByJobExecutionResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobStepExecutionsClientListByJobExecutionResponse contains the response from method JobStepExecutionsClient.ListByJobExecution.

type JobStepExecutionsClientListByJobExecutionResult added in v0.3.0

type JobStepExecutionsClientListByJobExecutionResult struct {
	JobExecutionListResult
}

JobStepExecutionsClientListByJobExecutionResult contains the result from method JobStepExecutionsClient.ListByJobExecution.

type JobStepListResult

type JobStepListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*JobStep `json:"value,omitempty" azure:"ro"`
}

JobStepListResult - A list of job steps.

func (JobStepListResult) MarshalJSON

func (j JobStepListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JobStepListResult.

type JobStepOutput

type JobStepOutput struct {
	// REQUIRED; The resource ID of the credential to use to connect to the output destination.
	Credential *string `json:"credential,omitempty"`

	// REQUIRED; The output destination database.
	DatabaseName *string `json:"databaseName,omitempty"`

	// REQUIRED; The output destination server name.
	ServerName *string `json:"serverName,omitempty"`

	// REQUIRED; The output destination table.
	TableName *string `json:"tableName,omitempty"`

	// The output destination resource group.
	ResourceGroupName *string `json:"resourceGroupName,omitempty"`

	// The output destination schema.
	SchemaName *string `json:"schemaName,omitempty"`

	// The output destination subscription id.
	SubscriptionID *string `json:"subscriptionId,omitempty"`

	// The output destination type.
	Type *JobStepOutputType `json:"type,omitempty"`
}

JobStepOutput - The output configuration of a job step.

type JobStepOutputType

type JobStepOutputType string

JobStepOutputType - The output destination type.

const (
	JobStepOutputTypeSQLDatabase JobStepOutputType = "SqlDatabase"
)

func PossibleJobStepOutputTypeValues

func PossibleJobStepOutputTypeValues() []JobStepOutputType

PossibleJobStepOutputTypeValues returns the possible values for the JobStepOutputType const type.

func (JobStepOutputType) ToPtr

ToPtr returns a *JobStepOutputType pointing to the current value.

type JobStepProperties

type JobStepProperties struct {
	// REQUIRED; The action payload of the job step.
	Action *JobStepAction `json:"action,omitempty"`

	// REQUIRED; The resource ID of the job credential that will be used to connect to the targets.
	Credential *string `json:"credential,omitempty"`

	// REQUIRED; The resource ID of the target group that the job step will be executed on.
	TargetGroup *string `json:"targetGroup,omitempty"`

	// Execution options for the job step.
	ExecutionOptions *JobStepExecutionOptions `json:"executionOptions,omitempty"`

	// Output destination properties of the job step.
	Output *JobStepOutput `json:"output,omitempty"`

	// The job step's index within the job. If not specified when creating the job step, it will be created as the last step.
	// If not specified when updating the job step, the step id is not modified.
	StepID *int32 `json:"stepId,omitempty"`
}

JobStepProperties - Properties of a job step.

type JobStepsClient

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

JobStepsClient contains the methods for the JobSteps group. Don't use this type directly, use NewJobStepsClient() instead.

func NewJobStepsClient

func NewJobStepsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *JobStepsClient

NewJobStepsClient creates a new instance of JobStepsClient with the specified values. subscriptionID - The 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 (*JobStepsClient) CreateOrUpdate

func (client *JobStepsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string, parameters JobStep, options *JobStepsClientCreateOrUpdateOptions) (JobStepsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates a job step. This will implicitly create a new job version. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job. stepName - The name of the job step. parameters - The requested state of the job step. options - JobStepsClientCreateOrUpdateOptions contains the optional parameters for the JobStepsClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobStepMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobStepsClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		"<step-name>",
		armsql.JobStep{
			Properties: &armsql.JobStepProperties{
				Action: &armsql.JobStepAction{
					Type:   armsql.JobStepActionType("TSql").ToPtr(),
					Source: armsql.JobStepActionSource("Inline").ToPtr(),
					Value:  to.StringPtr("<value>"),
				},
				Credential: to.StringPtr("<credential>"),
				ExecutionOptions: &armsql.JobStepExecutionOptions{
					InitialRetryIntervalSeconds:    to.Int32Ptr(11),
					MaximumRetryIntervalSeconds:    to.Int32Ptr(222),
					RetryAttempts:                  to.Int32Ptr(42),
					RetryIntervalBackoffMultiplier: to.Float32Ptr(3),
					TimeoutSeconds:                 to.Int32Ptr(1234),
				},
				Output: &armsql.JobStepOutput{
					Type:              armsql.JobStepOutputType("SqlDatabase").ToPtr(),
					Credential:        to.StringPtr("<credential>"),
					DatabaseName:      to.StringPtr("<database-name>"),
					ResourceGroupName: to.StringPtr("<resource-group-name>"),
					SchemaName:        to.StringPtr("<schema-name>"),
					ServerName:        to.StringPtr("<server-name>"),
					SubscriptionID:    to.StringPtr("<subscription-id>"),
					TableName:         to.StringPtr("<table-name>"),
				},
				StepID:      to.Int32Ptr(1),
				TargetGroup: to.StringPtr("<target-group>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobStepsClientCreateOrUpdateResult)
}
Output:

func (*JobStepsClient) Delete

func (client *JobStepsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string, options *JobStepsClientDeleteOptions) (JobStepsClientDeleteResponse, error)

Delete - Deletes a job step. This will implicitly create a new job version. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job. stepName - The name of the job step to delete. options - JobStepsClientDeleteOptions contains the optional parameters for the JobStepsClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobStep.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobStepsClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		"<step-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*JobStepsClient) Get

func (client *JobStepsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string, options *JobStepsClientGetOptions) (JobStepsClientGetResponse, error)

Get - Gets a job step in a job's current version. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job. stepName - The name of the job step. options - JobStepsClientGetOptions contains the optional parameters for the JobStepsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByJob.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobStepsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		"<step-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobStepsClientGetResult)
}
Output:

func (*JobStepsClient) GetByVersion

func (client *JobStepsClient) GetByVersion(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32, stepName string, options *JobStepsClientGetByVersionOptions) (JobStepsClientGetByVersionResponse, error)

GetByVersion - Gets the specified version of a job step. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job. jobVersion - The version of the job to get. stepName - The name of the job step. options - JobStepsClientGetByVersionOptions contains the optional parameters for the JobStepsClient.GetByVersion method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByVersion.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobStepsClient("<subscription-id>", cred, nil)
	res, err := client.GetByVersion(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		1,
		"<step-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobStepsClientGetByVersionResult)
}
Output:

func (*JobStepsClient) ListByJob

func (client *JobStepsClient) ListByJob(resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobStepsClientListByJobOptions) *JobStepsClientListByJobPager

ListByJob - Gets all job steps for a job's current version. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job to get. options - JobStepsClientListByJobOptions contains the optional parameters for the JobStepsClient.ListByJob method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByJob.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobStepsClient("<subscription-id>", cred, nil)
	pager := client.ListByJob("<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*JobStepsClient) ListByVersion

func (client *JobStepsClient) ListByVersion(resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32, options *JobStepsClientListByVersionOptions) *JobStepsClientListByVersionPager

ListByVersion - Gets all job steps in the specified job version. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job to get. jobVersion - The version of the job to get. options - JobStepsClientListByVersionOptions contains the optional parameters for the JobStepsClient.ListByVersion method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByVersion.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobStepsClient("<subscription-id>", cred, nil)
	pager := client.ListByVersion("<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		1,
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type JobStepsClientCreateOrUpdateOptions added in v0.3.0

type JobStepsClientCreateOrUpdateOptions struct {
}

JobStepsClientCreateOrUpdateOptions contains the optional parameters for the JobStepsClient.CreateOrUpdate method.

type JobStepsClientCreateOrUpdateResponse added in v0.3.0

type JobStepsClientCreateOrUpdateResponse struct {
	JobStepsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobStepsClientCreateOrUpdateResponse contains the response from method JobStepsClient.CreateOrUpdate.

type JobStepsClientCreateOrUpdateResult added in v0.3.0

type JobStepsClientCreateOrUpdateResult struct {
	JobStep
}

JobStepsClientCreateOrUpdateResult contains the result from method JobStepsClient.CreateOrUpdate.

type JobStepsClientDeleteOptions added in v0.3.0

type JobStepsClientDeleteOptions struct {
}

JobStepsClientDeleteOptions contains the optional parameters for the JobStepsClient.Delete method.

type JobStepsClientDeleteResponse added in v0.3.0

type JobStepsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobStepsClientDeleteResponse contains the response from method JobStepsClient.Delete.

type JobStepsClientGetByVersionOptions added in v0.3.0

type JobStepsClientGetByVersionOptions struct {
}

JobStepsClientGetByVersionOptions contains the optional parameters for the JobStepsClient.GetByVersion method.

type JobStepsClientGetByVersionResponse added in v0.3.0

type JobStepsClientGetByVersionResponse struct {
	JobStepsClientGetByVersionResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobStepsClientGetByVersionResponse contains the response from method JobStepsClient.GetByVersion.

type JobStepsClientGetByVersionResult added in v0.3.0

type JobStepsClientGetByVersionResult struct {
	JobStep
}

JobStepsClientGetByVersionResult contains the result from method JobStepsClient.GetByVersion.

type JobStepsClientGetOptions added in v0.3.0

type JobStepsClientGetOptions struct {
}

JobStepsClientGetOptions contains the optional parameters for the JobStepsClient.Get method.

type JobStepsClientGetResponse added in v0.3.0

type JobStepsClientGetResponse struct {
	JobStepsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobStepsClientGetResponse contains the response from method JobStepsClient.Get.

type JobStepsClientGetResult added in v0.3.0

type JobStepsClientGetResult struct {
	JobStep
}

JobStepsClientGetResult contains the result from method JobStepsClient.Get.

type JobStepsClientListByJobOptions added in v0.3.0

type JobStepsClientListByJobOptions struct {
}

JobStepsClientListByJobOptions contains the optional parameters for the JobStepsClient.ListByJob method.

type JobStepsClientListByJobPager added in v0.3.0

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

JobStepsClientListByJobPager provides operations for iterating over paged responses.

func (*JobStepsClientListByJobPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*JobStepsClientListByJobPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*JobStepsClientListByJobPager) PageResponse added in v0.3.0

PageResponse returns the current JobStepsClientListByJobResponse page.

type JobStepsClientListByJobResponse added in v0.3.0

type JobStepsClientListByJobResponse struct {
	JobStepsClientListByJobResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobStepsClientListByJobResponse contains the response from method JobStepsClient.ListByJob.

type JobStepsClientListByJobResult added in v0.3.0

type JobStepsClientListByJobResult struct {
	JobStepListResult
}

JobStepsClientListByJobResult contains the result from method JobStepsClient.ListByJob.

type JobStepsClientListByVersionOptions added in v0.3.0

type JobStepsClientListByVersionOptions struct {
}

JobStepsClientListByVersionOptions contains the optional parameters for the JobStepsClient.ListByVersion method.

type JobStepsClientListByVersionPager added in v0.3.0

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

JobStepsClientListByVersionPager provides operations for iterating over paged responses.

func (*JobStepsClientListByVersionPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*JobStepsClientListByVersionPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*JobStepsClientListByVersionPager) PageResponse added in v0.3.0

PageResponse returns the current JobStepsClientListByVersionResponse page.

type JobStepsClientListByVersionResponse added in v0.3.0

type JobStepsClientListByVersionResponse struct {
	JobStepsClientListByVersionResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobStepsClientListByVersionResponse contains the response from method JobStepsClient.ListByVersion.

type JobStepsClientListByVersionResult added in v0.3.0

type JobStepsClientListByVersionResult struct {
	JobStepListResult
}

JobStepsClientListByVersionResult contains the result from method JobStepsClient.ListByVersion.

type JobTarget

type JobTarget struct {
	// REQUIRED; The target type.
	Type *JobTargetType `json:"type,omitempty"`

	// The target database name.
	DatabaseName *string `json:"databaseName,omitempty"`

	// The target elastic pool name.
	ElasticPoolName *string `json:"elasticPoolName,omitempty"`

	// Whether the target is included or excluded from the group.
	MembershipType *JobTargetGroupMembershipType `json:"membershipType,omitempty"`

	// The resource ID of the credential that is used during job execution to connect to the target and determine the list of
	// databases inside the target.
	RefreshCredential *string `json:"refreshCredential,omitempty"`

	// The target server name.
	ServerName *string `json:"serverName,omitempty"`

	// The target shard map.
	ShardMapName *string `json:"shardMapName,omitempty"`
}

JobTarget - A job target, for example a specific database or a container of databases that is evaluated during job execution.

type JobTargetExecutionsClient

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

JobTargetExecutionsClient contains the methods for the JobTargetExecutions group. Don't use this type directly, use NewJobTargetExecutionsClient() instead.

func NewJobTargetExecutionsClient

func NewJobTargetExecutionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *JobTargetExecutionsClient

NewJobTargetExecutionsClient creates a new instance of JobTargetExecutionsClient with the specified values. subscriptionID - The 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 (*JobTargetExecutionsClient) Get

func (client *JobTargetExecutionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, stepName string, targetID string, options *JobTargetExecutionsClientGetOptions) (JobTargetExecutionsClientGetResponse, error)

Get - Gets a target execution. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job to get. jobExecutionID - The unique id of the job execution stepName - The name of the step. targetID - The target id. options - JobTargetExecutionsClientGetOptions contains the optional parameters for the JobTargetExecutionsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionTarget.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobTargetExecutionsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		"<job-execution-id>",
		"<step-name>",
		"<target-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobTargetExecutionsClientGetResult)
}
Output:

func (*JobTargetExecutionsClient) ListByJobExecution

func (client *JobTargetExecutionsClient) ListByJobExecution(resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, options *JobTargetExecutionsClientListByJobExecutionOptions) *JobTargetExecutionsClientListByJobExecutionPager

ListByJobExecution - Lists target executions for all steps of a job execution. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job to get. jobExecutionID - The id of the job execution options - JobTargetExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobTargetExecutionsClient.ListByJobExecution method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByExecution.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobTargetExecutionsClient("<subscription-id>", cred, nil)
	pager := client.ListByJobExecution("<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		"<job-execution-id>",
		&armsql.JobTargetExecutionsClientListByJobExecutionOptions{CreateTimeMin: nil,
			CreateTimeMax: nil,
			EndTimeMin:    nil,
			EndTimeMax:    nil,
			IsActive:      nil,
			Skip:          nil,
			Top:           nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*JobTargetExecutionsClient) ListByStep

func (client *JobTargetExecutionsClient) ListByStep(resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, stepName string, options *JobTargetExecutionsClientListByStepOptions) *JobTargetExecutionsClientListByStepPager

ListByStep - Lists the target executions of a job step execution. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job to get. jobExecutionID - The id of the job execution stepName - The name of the step. options - JobTargetExecutionsClientListByStepOptions contains the optional parameters for the JobTargetExecutionsClient.ListByStep method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByStep.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobTargetExecutionsClient("<subscription-id>", cred, nil)
	pager := client.ListByStep("<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		"<job-execution-id>",
		"<step-name>",
		&armsql.JobTargetExecutionsClientListByStepOptions{CreateTimeMin: nil,
			CreateTimeMax: nil,
			EndTimeMin:    nil,
			EndTimeMax:    nil,
			IsActive:      nil,
			Skip:          nil,
			Top:           nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type JobTargetExecutionsClientGetOptions added in v0.3.0

type JobTargetExecutionsClientGetOptions struct {
}

JobTargetExecutionsClientGetOptions contains the optional parameters for the JobTargetExecutionsClient.Get method.

type JobTargetExecutionsClientGetResponse added in v0.3.0

type JobTargetExecutionsClientGetResponse struct {
	JobTargetExecutionsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobTargetExecutionsClientGetResponse contains the response from method JobTargetExecutionsClient.Get.

type JobTargetExecutionsClientGetResult added in v0.3.0

type JobTargetExecutionsClientGetResult struct {
	JobExecution
}

JobTargetExecutionsClientGetResult contains the result from method JobTargetExecutionsClient.Get.

type JobTargetExecutionsClientListByJobExecutionOptions added in v0.3.0

type JobTargetExecutionsClientListByJobExecutionOptions struct {
	// If specified, only job executions created before the specified time are included.
	CreateTimeMax *time.Time
	// If specified, only job executions created at or after the specified time are included.
	CreateTimeMin *time.Time
	// If specified, only job executions completed before the specified time are included.
	EndTimeMax *time.Time
	// If specified, only job executions completed at or after the specified time are included.
	EndTimeMin *time.Time
	// If specified, only active or only completed job executions are included.
	IsActive *bool
	// The number of elements in the collection to skip.
	Skip *int32
	// The number of elements to return from the collection.
	Top *int32
}

JobTargetExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobTargetExecutionsClient.ListByJobExecution method.

type JobTargetExecutionsClientListByJobExecutionPager added in v0.3.0

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

JobTargetExecutionsClientListByJobExecutionPager provides operations for iterating over paged responses.

func (*JobTargetExecutionsClientListByJobExecutionPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*JobTargetExecutionsClientListByJobExecutionPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*JobTargetExecutionsClientListByJobExecutionPager) PageResponse added in v0.3.0

PageResponse returns the current JobTargetExecutionsClientListByJobExecutionResponse page.

type JobTargetExecutionsClientListByJobExecutionResponse added in v0.3.0

type JobTargetExecutionsClientListByJobExecutionResponse struct {
	JobTargetExecutionsClientListByJobExecutionResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobTargetExecutionsClientListByJobExecutionResponse contains the response from method JobTargetExecutionsClient.ListByJobExecution.

type JobTargetExecutionsClientListByJobExecutionResult added in v0.3.0

type JobTargetExecutionsClientListByJobExecutionResult struct {
	JobExecutionListResult
}

JobTargetExecutionsClientListByJobExecutionResult contains the result from method JobTargetExecutionsClient.ListByJobExecution.

type JobTargetExecutionsClientListByStepOptions added in v0.3.0

type JobTargetExecutionsClientListByStepOptions struct {
	// If specified, only job executions created before the specified time are included.
	CreateTimeMax *time.Time
	// If specified, only job executions created at or after the specified time are included.
	CreateTimeMin *time.Time
	// If specified, only job executions completed before the specified time are included.
	EndTimeMax *time.Time
	// If specified, only job executions completed at or after the specified time are included.
	EndTimeMin *time.Time
	// If specified, only active or only completed job executions are included.
	IsActive *bool
	// The number of elements in the collection to skip.
	Skip *int32
	// The number of elements to return from the collection.
	Top *int32
}

JobTargetExecutionsClientListByStepOptions contains the optional parameters for the JobTargetExecutionsClient.ListByStep method.

type JobTargetExecutionsClientListByStepPager added in v0.3.0

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

JobTargetExecutionsClientListByStepPager provides operations for iterating over paged responses.

func (*JobTargetExecutionsClientListByStepPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*JobTargetExecutionsClientListByStepPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*JobTargetExecutionsClientListByStepPager) PageResponse added in v0.3.0

PageResponse returns the current JobTargetExecutionsClientListByStepResponse page.

type JobTargetExecutionsClientListByStepResponse added in v0.3.0

type JobTargetExecutionsClientListByStepResponse struct {
	JobTargetExecutionsClientListByStepResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobTargetExecutionsClientListByStepResponse contains the response from method JobTargetExecutionsClient.ListByStep.

type JobTargetExecutionsClientListByStepResult added in v0.3.0

type JobTargetExecutionsClientListByStepResult struct {
	JobExecutionListResult
}

JobTargetExecutionsClientListByStepResult contains the result from method JobTargetExecutionsClient.ListByStep.

type JobTargetGroup

type JobTargetGroup struct {
	// Resource properties.
	Properties *JobTargetGroupProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

JobTargetGroup - A group of job targets.

type JobTargetGroupListResult

type JobTargetGroupListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*JobTargetGroup `json:"value,omitempty" azure:"ro"`
}

JobTargetGroupListResult - A list of target groups.

func (JobTargetGroupListResult) MarshalJSON

func (j JobTargetGroupListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JobTargetGroupListResult.

type JobTargetGroupMembershipType

type JobTargetGroupMembershipType string

JobTargetGroupMembershipType - Whether the target is included or excluded from the group.

const (
	JobTargetGroupMembershipTypeInclude JobTargetGroupMembershipType = "Include"
	JobTargetGroupMembershipTypeExclude JobTargetGroupMembershipType = "Exclude"
)

func PossibleJobTargetGroupMembershipTypeValues

func PossibleJobTargetGroupMembershipTypeValues() []JobTargetGroupMembershipType

PossibleJobTargetGroupMembershipTypeValues returns the possible values for the JobTargetGroupMembershipType const type.

func (JobTargetGroupMembershipType) ToPtr

ToPtr returns a *JobTargetGroupMembershipType pointing to the current value.

type JobTargetGroupProperties

type JobTargetGroupProperties struct {
	// REQUIRED; Members of the target group.
	Members []*JobTarget `json:"members,omitempty"`
}

JobTargetGroupProperties - Properties of job target group.

func (JobTargetGroupProperties) MarshalJSON

func (j JobTargetGroupProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JobTargetGroupProperties.

type JobTargetGroupsClient

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

JobTargetGroupsClient contains the methods for the JobTargetGroups group. Don't use this type directly, use NewJobTargetGroupsClient() instead.

func NewJobTargetGroupsClient

func NewJobTargetGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *JobTargetGroupsClient

NewJobTargetGroupsClient creates a new instance of JobTargetGroupsClient with the specified values. subscriptionID - The 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 (*JobTargetGroupsClient) CreateOrUpdate

func (client *JobTargetGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string, parameters JobTargetGroup, options *JobTargetGroupsClientCreateOrUpdateOptions) (JobTargetGroupsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates a target group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. targetGroupName - The name of the target group. parameters - The requested state of the target group. options - JobTargetGroupsClientCreateOrUpdateOptions contains the optional parameters for the JobTargetGroupsClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobTargetGroupMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobTargetGroupsClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<target-group-name>",
		armsql.JobTargetGroup{
			Properties: &armsql.JobTargetGroupProperties{
				Members: []*armsql.JobTarget{
					{
						Type:           armsql.JobTargetType("SqlDatabase").ToPtr(),
						DatabaseName:   to.StringPtr("<database-name>"),
						MembershipType: armsql.JobTargetGroupMembershipTypeExclude.ToPtr(),
						ServerName:     to.StringPtr("<server-name>"),
					},
					{
						Type:              armsql.JobTargetType("SqlServer").ToPtr(),
						MembershipType:    armsql.JobTargetGroupMembershipTypeInclude.ToPtr(),
						RefreshCredential: to.StringPtr("<refresh-credential>"),
						ServerName:        to.StringPtr("<server-name>"),
					},
					{
						Type:              armsql.JobTargetType("SqlElasticPool").ToPtr(),
						ElasticPoolName:   to.StringPtr("<elastic-pool-name>"),
						MembershipType:    armsql.JobTargetGroupMembershipTypeInclude.ToPtr(),
						RefreshCredential: to.StringPtr("<refresh-credential>"),
						ServerName:        to.StringPtr("<server-name>"),
					},
					{
						Type:              armsql.JobTargetType("SqlShardMap").ToPtr(),
						MembershipType:    armsql.JobTargetGroupMembershipTypeInclude.ToPtr(),
						RefreshCredential: to.StringPtr("<refresh-credential>"),
						ServerName:        to.StringPtr("<server-name>"),
						ShardMapName:      to.StringPtr("<shard-map-name>"),
					}},
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobTargetGroupsClientCreateOrUpdateResult)
}
Output:

func (*JobTargetGroupsClient) Delete

func (client *JobTargetGroupsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string, options *JobTargetGroupsClientDeleteOptions) (JobTargetGroupsClientDeleteResponse, error)

Delete - Deletes a target group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. targetGroupName - The name of the target group. options - JobTargetGroupsClientDeleteOptions contains the optional parameters for the JobTargetGroupsClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobTargetGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobTargetGroupsClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<target-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*JobTargetGroupsClient) Get

func (client *JobTargetGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string, options *JobTargetGroupsClientGetOptions) (JobTargetGroupsClientGetResponse, error)

Get - Gets a target group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. targetGroupName - The name of the target group. options - JobTargetGroupsClientGetOptions contains the optional parameters for the JobTargetGroupsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobTargetGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobTargetGroupsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<target-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobTargetGroupsClientGetResult)
}
Output:

func (*JobTargetGroupsClient) ListByAgent

func (client *JobTargetGroupsClient) ListByAgent(resourceGroupName string, serverName string, jobAgentName string, options *JobTargetGroupsClientListByAgentOptions) *JobTargetGroupsClientListByAgentPager

ListByAgent - Gets all target groups in an agent. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. options - JobTargetGroupsClientListByAgentOptions contains the optional parameters for the JobTargetGroupsClient.ListByAgent method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobTargetGroups.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobTargetGroupsClient("<subscription-id>", cred, nil)
	pager := client.ListByAgent("<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type JobTargetGroupsClientCreateOrUpdateOptions added in v0.3.0

type JobTargetGroupsClientCreateOrUpdateOptions struct {
}

JobTargetGroupsClientCreateOrUpdateOptions contains the optional parameters for the JobTargetGroupsClient.CreateOrUpdate method.

type JobTargetGroupsClientCreateOrUpdateResponse added in v0.3.0

type JobTargetGroupsClientCreateOrUpdateResponse struct {
	JobTargetGroupsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobTargetGroupsClientCreateOrUpdateResponse contains the response from method JobTargetGroupsClient.CreateOrUpdate.

type JobTargetGroupsClientCreateOrUpdateResult added in v0.3.0

type JobTargetGroupsClientCreateOrUpdateResult struct {
	JobTargetGroup
}

JobTargetGroupsClientCreateOrUpdateResult contains the result from method JobTargetGroupsClient.CreateOrUpdate.

type JobTargetGroupsClientDeleteOptions added in v0.3.0

type JobTargetGroupsClientDeleteOptions struct {
}

JobTargetGroupsClientDeleteOptions contains the optional parameters for the JobTargetGroupsClient.Delete method.

type JobTargetGroupsClientDeleteResponse added in v0.3.0

type JobTargetGroupsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobTargetGroupsClientDeleteResponse contains the response from method JobTargetGroupsClient.Delete.

type JobTargetGroupsClientGetOptions added in v0.3.0

type JobTargetGroupsClientGetOptions struct {
}

JobTargetGroupsClientGetOptions contains the optional parameters for the JobTargetGroupsClient.Get method.

type JobTargetGroupsClientGetResponse added in v0.3.0

type JobTargetGroupsClientGetResponse struct {
	JobTargetGroupsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobTargetGroupsClientGetResponse contains the response from method JobTargetGroupsClient.Get.

type JobTargetGroupsClientGetResult added in v0.3.0

type JobTargetGroupsClientGetResult struct {
	JobTargetGroup
}

JobTargetGroupsClientGetResult contains the result from method JobTargetGroupsClient.Get.

type JobTargetGroupsClientListByAgentOptions added in v0.3.0

type JobTargetGroupsClientListByAgentOptions struct {
}

JobTargetGroupsClientListByAgentOptions contains the optional parameters for the JobTargetGroupsClient.ListByAgent method.

type JobTargetGroupsClientListByAgentPager added in v0.3.0

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

JobTargetGroupsClientListByAgentPager provides operations for iterating over paged responses.

func (*JobTargetGroupsClientListByAgentPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*JobTargetGroupsClientListByAgentPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*JobTargetGroupsClientListByAgentPager) PageResponse added in v0.3.0

PageResponse returns the current JobTargetGroupsClientListByAgentResponse page.

type JobTargetGroupsClientListByAgentResponse added in v0.3.0

type JobTargetGroupsClientListByAgentResponse struct {
	JobTargetGroupsClientListByAgentResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobTargetGroupsClientListByAgentResponse contains the response from method JobTargetGroupsClient.ListByAgent.

type JobTargetGroupsClientListByAgentResult added in v0.3.0

type JobTargetGroupsClientListByAgentResult struct {
	JobTargetGroupListResult
}

JobTargetGroupsClientListByAgentResult contains the result from method JobTargetGroupsClient.ListByAgent.

type JobTargetType

type JobTargetType string

JobTargetType - The type of the target.

const (
	JobTargetTypeSQLDatabase    JobTargetType = "SqlDatabase"
	JobTargetTypeSQLElasticPool JobTargetType = "SqlElasticPool"
	JobTargetTypeSQLServer      JobTargetType = "SqlServer"
	JobTargetTypeSQLShardMap    JobTargetType = "SqlShardMap"
	JobTargetTypeTargetGroup    JobTargetType = "TargetGroup"
)

func PossibleJobTargetTypeValues

func PossibleJobTargetTypeValues() []JobTargetType

PossibleJobTargetTypeValues returns the possible values for the JobTargetType const type.

func (JobTargetType) ToPtr

func (c JobTargetType) ToPtr() *JobTargetType

ToPtr returns a *JobTargetType pointing to the current value.

type JobVersion

type JobVersion struct {
	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

JobVersion - A job version.

type JobVersionListResult

type JobVersionListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*JobVersion `json:"value,omitempty" azure:"ro"`
}

JobVersionListResult - A list of job versions.

func (JobVersionListResult) MarshalJSON

func (j JobVersionListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JobVersionListResult.

type JobVersionsClient

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

JobVersionsClient contains the methods for the JobVersions group. Don't use this type directly, use NewJobVersionsClient() instead.

func NewJobVersionsClient

func NewJobVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *JobVersionsClient

NewJobVersionsClient creates a new instance of JobVersionsClient with the specified values. subscriptionID - The 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 (*JobVersionsClient) Get

func (client *JobVersionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32, options *JobVersionsClientGetOptions) (JobVersionsClientGetResponse, error)

Get - Gets a job version. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job. jobVersion - The version of the job to get. options - JobVersionsClientGetOptions contains the optional parameters for the JobVersionsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobVersion.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobVersionsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		1,
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobVersionsClientGetResult)
}
Output:

func (*JobVersionsClient) ListByJob

func (client *JobVersionsClient) ListByJob(resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobVersionsClientListByJobOptions) *JobVersionsClientListByJobPager

ListByJob - Gets all versions of a job. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job to get. options - JobVersionsClientListByJobOptions contains the optional parameters for the JobVersionsClient.ListByJob method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobVersions.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobVersionsClient("<subscription-id>", cred, nil)
	pager := client.ListByJob("<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type JobVersionsClientGetOptions added in v0.3.0

type JobVersionsClientGetOptions struct {
}

JobVersionsClientGetOptions contains the optional parameters for the JobVersionsClient.Get method.

type JobVersionsClientGetResponse added in v0.3.0

type JobVersionsClientGetResponse struct {
	JobVersionsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobVersionsClientGetResponse contains the response from method JobVersionsClient.Get.

type JobVersionsClientGetResult added in v0.3.0

type JobVersionsClientGetResult struct {
	JobVersion
}

JobVersionsClientGetResult contains the result from method JobVersionsClient.Get.

type JobVersionsClientListByJobOptions added in v0.3.0

type JobVersionsClientListByJobOptions struct {
}

JobVersionsClientListByJobOptions contains the optional parameters for the JobVersionsClient.ListByJob method.

type JobVersionsClientListByJobPager added in v0.3.0

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

JobVersionsClientListByJobPager provides operations for iterating over paged responses.

func (*JobVersionsClientListByJobPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*JobVersionsClientListByJobPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*JobVersionsClientListByJobPager) PageResponse added in v0.3.0

PageResponse returns the current JobVersionsClientListByJobResponse page.

type JobVersionsClientListByJobResponse added in v0.3.0

type JobVersionsClientListByJobResponse struct {
	JobVersionsClientListByJobResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobVersionsClientListByJobResponse contains the response from method JobVersionsClient.ListByJob.

type JobVersionsClientListByJobResult added in v0.3.0

type JobVersionsClientListByJobResult struct {
	JobVersionListResult
}

JobVersionsClientListByJobResult contains the result from method JobVersionsClient.ListByJob.

type JobsClient

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

JobsClient contains the methods for the Jobs group. Don't use this type directly, use NewJobsClient() instead.

func NewJobsClient

func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *JobsClient

NewJobsClient creates a new instance of JobsClient with the specified values. subscriptionID - The 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 (*JobsClient) CreateOrUpdate

func (client *JobsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, parameters Job, options *JobsClientCreateOrUpdateOptions) (JobsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates a job. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job to get. parameters - The requested job state. options - JobsClientCreateOrUpdateOptions contains the optional parameters for the JobsClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobsClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		armsql.Job{
			Properties: &armsql.JobProperties{
				Description: to.StringPtr("<description>"),
				Schedule: &armsql.JobSchedule{
					Type:      armsql.JobScheduleTypeRecurring.ToPtr(),
					Enabled:   to.BoolPtr(true),
					EndTime:   to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T23:59:59Z"); return t }()),
					Interval:  to.StringPtr("<interval>"),
					StartTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T18:30:01Z"); return t }()),
				},
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobsClientCreateOrUpdateResult)
}
Output:

func (*JobsClient) Delete

func (client *JobsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobsClientDeleteOptions) (JobsClientDeleteResponse, error)

Delete - Deletes a job. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job to delete. options - JobsClientDeleteOptions contains the optional parameters for the JobsClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJob.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobsClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*JobsClient) Get

func (client *JobsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobsClientGetOptions) (JobsClientGetResponse, error)

Get - Gets a job. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. jobName - The name of the job to get. options - JobsClientGetOptions contains the optional parameters for the JobsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJob.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		"<job-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.JobsClientGetResult)
}
Output:

func (*JobsClient) ListByAgent

func (client *JobsClient) ListByAgent(resourceGroupName string, serverName string, jobAgentName string, options *JobsClientListByAgentOptions) *JobsClientListByAgentPager

ListByAgent - Gets a list of jobs. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. jobAgentName - The name of the job agent. options - JobsClientListByAgentOptions contains the optional parameters for the JobsClient.ListByAgent method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobsByAgent.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewJobsClient("<subscription-id>", cred, nil)
	pager := client.ListByAgent("<resource-group-name>",
		"<server-name>",
		"<job-agent-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type JobsClientCreateOrUpdateOptions added in v0.3.0

type JobsClientCreateOrUpdateOptions struct {
}

JobsClientCreateOrUpdateOptions contains the optional parameters for the JobsClient.CreateOrUpdate method.

type JobsClientCreateOrUpdateResponse added in v0.3.0

type JobsClientCreateOrUpdateResponse struct {
	JobsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobsClientCreateOrUpdateResponse contains the response from method JobsClient.CreateOrUpdate.

type JobsClientCreateOrUpdateResult added in v0.3.0

type JobsClientCreateOrUpdateResult struct {
	Job
}

JobsClientCreateOrUpdateResult contains the result from method JobsClient.CreateOrUpdate.

type JobsClientDeleteOptions added in v0.3.0

type JobsClientDeleteOptions struct {
}

JobsClientDeleteOptions contains the optional parameters for the JobsClient.Delete method.

type JobsClientDeleteResponse added in v0.3.0

type JobsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobsClientDeleteResponse contains the response from method JobsClient.Delete.

type JobsClientGetOptions added in v0.3.0

type JobsClientGetOptions struct {
}

JobsClientGetOptions contains the optional parameters for the JobsClient.Get method.

type JobsClientGetResponse added in v0.3.0

type JobsClientGetResponse struct {
	JobsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobsClientGetResponse contains the response from method JobsClient.Get.

type JobsClientGetResult added in v0.3.0

type JobsClientGetResult struct {
	Job
}

JobsClientGetResult contains the result from method JobsClient.Get.

type JobsClientListByAgentOptions added in v0.3.0

type JobsClientListByAgentOptions struct {
}

JobsClientListByAgentOptions contains the optional parameters for the JobsClient.ListByAgent method.

type JobsClientListByAgentPager added in v0.3.0

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

JobsClientListByAgentPager provides operations for iterating over paged responses.

func (*JobsClientListByAgentPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*JobsClientListByAgentPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*JobsClientListByAgentPager) PageResponse added in v0.3.0

PageResponse returns the current JobsClientListByAgentResponse page.

type JobsClientListByAgentResponse added in v0.3.0

type JobsClientListByAgentResponse struct {
	JobsClientListByAgentResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

JobsClientListByAgentResponse contains the response from method JobsClient.ListByAgent.

type JobsClientListByAgentResult added in v0.3.0

type JobsClientListByAgentResult struct {
	JobListResult
}

JobsClientListByAgentResult contains the result from method JobsClient.ListByAgent.

type LedgerDigestUploads

type LedgerDigestUploads struct {
	// Resource properties.
	Properties *LedgerDigestUploadsProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

LedgerDigestUploads - Azure SQL Database ledger digest upload settings.

type LedgerDigestUploadsClient

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

LedgerDigestUploadsClient contains the methods for the LedgerDigestUploads group. Don't use this type directly, use NewLedgerDigestUploadsClient() instead.

func NewLedgerDigestUploadsClient

func NewLedgerDigestUploadsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *LedgerDigestUploadsClient

NewLedgerDigestUploadsClient creates a new instance of LedgerDigestUploadsClient with the specified values. subscriptionID - The 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 (*LedgerDigestUploadsClient) BeginCreateOrUpdate

func (client *LedgerDigestUploadsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ledgerDigestUploads LedgerDigestUploadsName, parameters LedgerDigestUploads, options *LedgerDigestUploadsClientBeginCreateOrUpdateOptions) (LedgerDigestUploadsClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - LedgerDigestUploadsClientBeginCreateOrUpdateOptions contains the optional parameters for the LedgerDigestUploadsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsEnable.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLedgerDigestUploadsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.LedgerDigestUploadsName("current"),
		armsql.LedgerDigestUploads{
			Properties: &armsql.LedgerDigestUploadsProperties{
				DigestStorageEndpoint: to.StringPtr("<digest-storage-endpoint>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.LedgerDigestUploadsClientCreateOrUpdateResult)
}
Output:

func (*LedgerDigestUploadsClient) BeginDisable

func (client *LedgerDigestUploadsClient) BeginDisable(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ledgerDigestUploads LedgerDigestUploadsName, options *LedgerDigestUploadsClientBeginDisableOptions) (LedgerDigestUploadsClientDisablePollerResponse, error)

BeginDisable - Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - LedgerDigestUploadsClientBeginDisableOptions contains the optional parameters for the LedgerDigestUploadsClient.BeginDisable method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsDisable.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLedgerDigestUploadsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDisable(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.LedgerDigestUploadsName("current"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.LedgerDigestUploadsClientDisableResult)
}
Output:

func (*LedgerDigestUploadsClient) Get

func (client *LedgerDigestUploadsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ledgerDigestUploads LedgerDigestUploadsName, options *LedgerDigestUploadsClientGetOptions) (LedgerDigestUploadsClientGetResponse, error)

Get - Gets the current ledger digest upload configuration for a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - LedgerDigestUploadsClientGetOptions contains the optional parameters for the LedgerDigestUploadsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLedgerDigestUploadsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.LedgerDigestUploadsName("current"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.LedgerDigestUploadsClientGetResult)
}
Output:

func (*LedgerDigestUploadsClient) ListByDatabase

func (client *LedgerDigestUploadsClient) ListByDatabase(resourceGroupName string, serverName string, databaseName string, options *LedgerDigestUploadsClientListByDatabaseOptions) *LedgerDigestUploadsClientListByDatabasePager

ListByDatabase - Gets all ledger digest upload settings on a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - LedgerDigestUploadsClientListByDatabaseOptions contains the optional parameters for the LedgerDigestUploadsClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLedgerDigestUploadsClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type LedgerDigestUploadsClientBeginCreateOrUpdateOptions added in v0.3.0

type LedgerDigestUploadsClientBeginCreateOrUpdateOptions struct {
}

LedgerDigestUploadsClientBeginCreateOrUpdateOptions contains the optional parameters for the LedgerDigestUploadsClient.BeginCreateOrUpdate method.

type LedgerDigestUploadsClientBeginDisableOptions added in v0.3.0

type LedgerDigestUploadsClientBeginDisableOptions struct {
}

LedgerDigestUploadsClientBeginDisableOptions contains the optional parameters for the LedgerDigestUploadsClient.BeginDisable method.

type LedgerDigestUploadsClientCreateOrUpdatePoller added in v0.3.0

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

LedgerDigestUploadsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*LedgerDigestUploadsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*LedgerDigestUploadsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final LedgerDigestUploadsClientCreateOrUpdateResponse will be returned.

func (*LedgerDigestUploadsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*LedgerDigestUploadsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type LedgerDigestUploadsClientCreateOrUpdatePollerResponse added in v0.3.0

type LedgerDigestUploadsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *LedgerDigestUploadsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LedgerDigestUploadsClientCreateOrUpdatePollerResponse contains the response from method LedgerDigestUploadsClient.CreateOrUpdate.

func (LedgerDigestUploadsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*LedgerDigestUploadsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a LedgerDigestUploadsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type LedgerDigestUploadsClientCreateOrUpdateResponse added in v0.3.0

type LedgerDigestUploadsClientCreateOrUpdateResponse struct {
	LedgerDigestUploadsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LedgerDigestUploadsClientCreateOrUpdateResponse contains the response from method LedgerDigestUploadsClient.CreateOrUpdate.

type LedgerDigestUploadsClientCreateOrUpdateResult added in v0.3.0

type LedgerDigestUploadsClientCreateOrUpdateResult struct {
	LedgerDigestUploads
}

LedgerDigestUploadsClientCreateOrUpdateResult contains the result from method LedgerDigestUploadsClient.CreateOrUpdate.

type LedgerDigestUploadsClientDisablePoller added in v0.3.0

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

LedgerDigestUploadsClientDisablePoller provides polling facilities until the operation reaches a terminal state.

func (*LedgerDigestUploadsClientDisablePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*LedgerDigestUploadsClientDisablePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final LedgerDigestUploadsClientDisableResponse will be returned.

func (*LedgerDigestUploadsClientDisablePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*LedgerDigestUploadsClientDisablePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type LedgerDigestUploadsClientDisablePollerResponse added in v0.3.0

type LedgerDigestUploadsClientDisablePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *LedgerDigestUploadsClientDisablePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LedgerDigestUploadsClientDisablePollerResponse contains the response from method LedgerDigestUploadsClient.Disable.

func (LedgerDigestUploadsClientDisablePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*LedgerDigestUploadsClientDisablePollerResponse) Resume added in v0.3.0

Resume rehydrates a LedgerDigestUploadsClientDisablePollerResponse from the provided client and resume token.

type LedgerDigestUploadsClientDisableResponse added in v0.3.0

type LedgerDigestUploadsClientDisableResponse struct {
	LedgerDigestUploadsClientDisableResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LedgerDigestUploadsClientDisableResponse contains the response from method LedgerDigestUploadsClient.Disable.

type LedgerDigestUploadsClientDisableResult added in v0.3.0

type LedgerDigestUploadsClientDisableResult struct {
	LedgerDigestUploads
}

LedgerDigestUploadsClientDisableResult contains the result from method LedgerDigestUploadsClient.Disable.

type LedgerDigestUploadsClientGetOptions added in v0.3.0

type LedgerDigestUploadsClientGetOptions struct {
}

LedgerDigestUploadsClientGetOptions contains the optional parameters for the LedgerDigestUploadsClient.Get method.

type LedgerDigestUploadsClientGetResponse added in v0.3.0

type LedgerDigestUploadsClientGetResponse struct {
	LedgerDigestUploadsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LedgerDigestUploadsClientGetResponse contains the response from method LedgerDigestUploadsClient.Get.

type LedgerDigestUploadsClientGetResult added in v0.3.0

type LedgerDigestUploadsClientGetResult struct {
	LedgerDigestUploads
}

LedgerDigestUploadsClientGetResult contains the result from method LedgerDigestUploadsClient.Get.

type LedgerDigestUploadsClientListByDatabaseOptions added in v0.3.0

type LedgerDigestUploadsClientListByDatabaseOptions struct {
}

LedgerDigestUploadsClientListByDatabaseOptions contains the optional parameters for the LedgerDigestUploadsClient.ListByDatabase method.

type LedgerDigestUploadsClientListByDatabasePager added in v0.3.0

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

LedgerDigestUploadsClientListByDatabasePager provides operations for iterating over paged responses.

func (*LedgerDigestUploadsClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*LedgerDigestUploadsClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LedgerDigestUploadsClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current LedgerDigestUploadsClientListByDatabaseResponse page.

type LedgerDigestUploadsClientListByDatabaseResponse added in v0.3.0

type LedgerDigestUploadsClientListByDatabaseResponse struct {
	LedgerDigestUploadsClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LedgerDigestUploadsClientListByDatabaseResponse contains the response from method LedgerDigestUploadsClient.ListByDatabase.

type LedgerDigestUploadsClientListByDatabaseResult added in v0.3.0

type LedgerDigestUploadsClientListByDatabaseResult struct {
	LedgerDigestUploadsListResult
}

LedgerDigestUploadsClientListByDatabaseResult contains the result from method LedgerDigestUploadsClient.ListByDatabase.

type LedgerDigestUploadsListResult

type LedgerDigestUploadsListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*LedgerDigestUploads `json:"value,omitempty" azure:"ro"`
}

LedgerDigestUploadsListResult - A list of ledger digest upload settings.

func (LedgerDigestUploadsListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LedgerDigestUploadsListResult.

type LedgerDigestUploadsName

type LedgerDigestUploadsName string
const (
	LedgerDigestUploadsNameCurrent LedgerDigestUploadsName = "current"
)

func PossibleLedgerDigestUploadsNameValues

func PossibleLedgerDigestUploadsNameValues() []LedgerDigestUploadsName

PossibleLedgerDigestUploadsNameValues returns the possible values for the LedgerDigestUploadsName const type.

func (LedgerDigestUploadsName) ToPtr

ToPtr returns a *LedgerDigestUploadsName pointing to the current value.

type LedgerDigestUploadsProperties

type LedgerDigestUploadsProperties struct {
	// The digest storage endpoint, which must be either an Azure blob storage endpoint or an URI for Azure Confidential Ledger.
	DigestStorageEndpoint *string `json:"digestStorageEndpoint,omitempty"`

	// READ-ONLY; Specifies the state of ledger digest upload.
	State *LedgerDigestUploadsState `json:"state,omitempty" azure:"ro"`
}

LedgerDigestUploadsProperties - The properties of a database ledger digest upload settings.

type LedgerDigestUploadsState

type LedgerDigestUploadsState string

LedgerDigestUploadsState - Specifies the state of ledger digest upload.

const (
	LedgerDigestUploadsStateEnabled  LedgerDigestUploadsState = "Enabled"
	LedgerDigestUploadsStateDisabled LedgerDigestUploadsState = "Disabled"
)

func PossibleLedgerDigestUploadsStateValues

func PossibleLedgerDigestUploadsStateValues() []LedgerDigestUploadsState

PossibleLedgerDigestUploadsStateValues returns the possible values for the LedgerDigestUploadsState const type.

func (LedgerDigestUploadsState) ToPtr

ToPtr returns a *LedgerDigestUploadsState pointing to the current value.

type LicenseTypeCapability

type LicenseTypeCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; License type identifier.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`
}

LicenseTypeCapability - The license type capability

type LocationCapabilities

type LocationCapabilities struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; The location name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; The list of supported managed instance versions.
	SupportedManagedInstanceVersions []*ManagedInstanceVersionCapability `json:"supportedManagedInstanceVersions,omitempty" azure:"ro"`

	// READ-ONLY; The list of supported server versions.
	SupportedServerVersions []*ServerVersionCapability `json:"supportedServerVersions,omitempty" azure:"ro"`
}

LocationCapabilities - The location capability.

func (LocationCapabilities) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LocationCapabilities.

type LogSizeCapability

type LogSizeCapability struct {
	// READ-ONLY; The log size limit (see 'unit' for the units).
	Limit *int32 `json:"limit,omitempty" azure:"ro"`

	// READ-ONLY; The units that the limit is expressed in.
	Unit *LogSizeUnit `json:"unit,omitempty" azure:"ro"`
}

LogSizeCapability - The log size capability.

type LogSizeUnit

type LogSizeUnit string

LogSizeUnit - The units that the limit is expressed in.

const (
	LogSizeUnitGigabytes LogSizeUnit = "Gigabytes"
	LogSizeUnitMegabytes LogSizeUnit = "Megabytes"
	LogSizeUnitPercent   LogSizeUnit = "Percent"
	LogSizeUnitPetabytes LogSizeUnit = "Petabytes"
	LogSizeUnitTerabytes LogSizeUnit = "Terabytes"
)

func PossibleLogSizeUnitValues

func PossibleLogSizeUnitValues() []LogSizeUnit

PossibleLogSizeUnitValues returns the possible values for the LogSizeUnit const type.

func (LogSizeUnit) ToPtr

func (c LogSizeUnit) ToPtr() *LogSizeUnit

ToPtr returns a *LogSizeUnit pointing to the current value.

type LogicalDatabaseTransparentDataEncryption

type LogicalDatabaseTransparentDataEncryption struct {
	// Resource properties.
	Properties *TransparentDataEncryptionProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

LogicalDatabaseTransparentDataEncryption - A logical database transparent data encryption state.

type LogicalDatabaseTransparentDataEncryptionListResult

type LogicalDatabaseTransparentDataEncryptionListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*LogicalDatabaseTransparentDataEncryption `json:"value,omitempty" azure:"ro"`
}

LogicalDatabaseTransparentDataEncryptionListResult - A list of transparent data encryptions

func (LogicalDatabaseTransparentDataEncryptionListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type LogicalDatabaseTransparentDataEncryptionListResult.

type LogicalServerSecurityAlertPolicyListResult

type LogicalServerSecurityAlertPolicyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ServerSecurityAlertPolicy `json:"value,omitempty" azure:"ro"`
}

LogicalServerSecurityAlertPolicyListResult - A list of the server's security alert policies.

func (LogicalServerSecurityAlertPolicyListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type LogicalServerSecurityAlertPolicyListResult.

type LongTermRetentionBackup

type LongTermRetentionBackup struct {
	// Resource properties.
	Properties *LongTermRetentionBackupProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

LongTermRetentionBackup - A long term retention backup.

type LongTermRetentionBackupListResult

type LongTermRetentionBackupListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*LongTermRetentionBackup `json:"value,omitempty" azure:"ro"`
}

LongTermRetentionBackupListResult - A list of long term retention backups.

func (LongTermRetentionBackupListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackupListResult.

type LongTermRetentionBackupOperationResult

type LongTermRetentionBackupOperationResult struct {
	// Resource properties.
	Properties *LongTermRetentionOperationResultProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

LongTermRetentionBackupOperationResult - A LongTermRetentionBackup operation result resource.

type LongTermRetentionBackupProperties

type LongTermRetentionBackupProperties struct {
	// The storage redundancy type of the backup
	RequestedBackupStorageRedundancy *BackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"`

	// READ-ONLY; The time the long term retention backup will expire.
	BackupExpirationTime *time.Time `json:"backupExpirationTime,omitempty" azure:"ro"`

	// READ-ONLY; The storage redundancy type of the backup
	BackupStorageRedundancy *BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty" azure:"ro"`

	// READ-ONLY; The time the backup was taken
	BackupTime *time.Time `json:"backupTime,omitempty" azure:"ro"`

	// READ-ONLY; The delete time of the database
	DatabaseDeletionTime *time.Time `json:"databaseDeletionTime,omitempty" azure:"ro"`

	// READ-ONLY; The name of the database the backup belong to
	DatabaseName *string `json:"databaseName,omitempty" azure:"ro"`

	// READ-ONLY; The create time of the server.
	ServerCreateTime *time.Time `json:"serverCreateTime,omitempty" azure:"ro"`

	// READ-ONLY; The server name that the backup database belong to.
	ServerName *string `json:"serverName,omitempty" azure:"ro"`
}

LongTermRetentionBackupProperties - Properties of a long term retention backup

func (LongTermRetentionBackupProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackupProperties.

func (*LongTermRetentionBackupProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionBackupProperties.

type LongTermRetentionBackupsClient

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

LongTermRetentionBackupsClient contains the methods for the LongTermRetentionBackups group. Don't use this type directly, use NewLongTermRetentionBackupsClient() instead.

func NewLongTermRetentionBackupsClient

func NewLongTermRetentionBackupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *LongTermRetentionBackupsClient

NewLongTermRetentionBackupsClient creates a new instance of LongTermRetentionBackupsClient with the specified values. subscriptionID - The 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 (*LongTermRetentionBackupsClient) BeginCopy

func (client *LongTermRetentionBackupsClient) BeginCopy(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters CopyLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginCopyOptions) (LongTermRetentionBackupsClientCopyPollerResponse, error)

BeginCopy - Copy an existing long term retention backup. If the operation fails it returns an *azcore.ResponseError type. locationName - The location of the database. longTermRetentionServerName - The name of the server longTermRetentionDatabaseName - The name of the database backupName - The backup name. parameters - The parameters needed for long term retention copy request options - LongTermRetentionBackupsClientBeginCopyOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginCopy method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupCopy.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionBackupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCopy(ctx,
		"<location-name>",
		"<long-term-retention-server-name>",
		"<long-term-retention-database-name>",
		"<backup-name>",
		armsql.CopyLongTermRetentionBackupParameters{
			Properties: &armsql.CopyLongTermRetentionBackupParametersProperties{
				TargetBackupStorageRedundancy: armsql.BackupStorageRedundancy("Geo").ToPtr(),
				TargetDatabaseName:            to.StringPtr("<target-database-name>"),
				TargetServerResourceID:        to.StringPtr("<target-server-resource-id>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.LongTermRetentionBackupsClientCopyResult)
}
Output:

func (*LongTermRetentionBackupsClient) BeginCopyByResourceGroup

func (client *LongTermRetentionBackupsClient) BeginCopyByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters CopyLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginCopyByResourceGroupOptions) (LongTermRetentionBackupsClientCopyByResourceGroupPollerResponse, error)

BeginCopyByResourceGroup - Copy an existing long term retention backup to a different server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The location of the database. longTermRetentionServerName - The name of the server longTermRetentionDatabaseName - The name of the database backupName - The backup name. parameters - The parameters needed for long term retention copy request options - LongTermRetentionBackupsClientBeginCopyByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginCopyByResourceGroup method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupCopy.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionBackupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCopyByResourceGroup(ctx,
		"<resource-group-name>",
		"<location-name>",
		"<long-term-retention-server-name>",
		"<long-term-retention-database-name>",
		"<backup-name>",
		armsql.CopyLongTermRetentionBackupParameters{
			Properties: &armsql.CopyLongTermRetentionBackupParametersProperties{
				TargetBackupStorageRedundancy: armsql.BackupStorageRedundancy("Geo").ToPtr(),
				TargetDatabaseName:            to.StringPtr("<target-database-name>"),
				TargetServerResourceID:        to.StringPtr("<target-server-resource-id>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.LongTermRetentionBackupsClientCopyByResourceGroupResult)
}
Output:

func (*LongTermRetentionBackupsClient) BeginDelete

func (client *LongTermRetentionBackupsClient) BeginDelete(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientBeginDeleteOptions) (LongTermRetentionBackupsClientDeletePollerResponse, error)

BeginDelete - Deletes a long term retention backup. If the operation fails it returns an *azcore.ResponseError type. locationName - The location of the database longTermRetentionServerName - The name of the server longTermRetentionDatabaseName - The name of the database backupName - The backup name. options - LongTermRetentionBackupsClientBeginDeleteOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionBackupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<location-name>",
		"<long-term-retention-server-name>",
		"<long-term-retention-database-name>",
		"<backup-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*LongTermRetentionBackupsClient) BeginDeleteByResourceGroup

func (client *LongTermRetentionBackupsClient) BeginDeleteByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientBeginDeleteByResourceGroupOptions) (LongTermRetentionBackupsClientDeleteByResourceGroupPollerResponse, error)

BeginDeleteByResourceGroup - Deletes a long term retention backup. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The location of the database longTermRetentionServerName - The name of the server longTermRetentionDatabaseName - The name of the database backupName - The backup name. options - LongTermRetentionBackupsClientBeginDeleteByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginDeleteByResourceGroup method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionBackupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDeleteByResourceGroup(ctx,
		"<resource-group-name>",
		"<location-name>",
		"<long-term-retention-server-name>",
		"<long-term-retention-database-name>",
		"<backup-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*LongTermRetentionBackupsClient) BeginUpdate

func (client *LongTermRetentionBackupsClient) BeginUpdate(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters UpdateLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginUpdateOptions) (LongTermRetentionBackupsClientUpdatePollerResponse, error)

BeginUpdate - Updates an existing long term retention backup. If the operation fails it returns an *azcore.ResponseError type. locationName - The location of the database. longTermRetentionServerName - The name of the server longTermRetentionDatabaseName - The name of the database backupName - The backup name. parameters - The requested backup resource state options - LongTermRetentionBackupsClientBeginUpdateOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupUpdate.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionBackupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdate(ctx,
		"<location-name>",
		"<long-term-retention-server-name>",
		"<long-term-retention-database-name>",
		"<backup-name>",
		armsql.UpdateLongTermRetentionBackupParameters{
			Properties: &armsql.UpdateLongTermRetentionBackupParametersProperties{
				RequestedBackupStorageRedundancy: armsql.BackupStorageRedundancy("Geo").ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.LongTermRetentionBackupsClientUpdateResult)
}
Output:

func (*LongTermRetentionBackupsClient) BeginUpdateByResourceGroup

func (client *LongTermRetentionBackupsClient) BeginUpdateByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters UpdateLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginUpdateByResourceGroupOptions) (LongTermRetentionBackupsClientUpdateByResourceGroupPollerResponse, error)

BeginUpdateByResourceGroup - Updates an existing long term retention backup. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The location of the database. longTermRetentionServerName - The name of the server longTermRetentionDatabaseName - The name of the database backupName - The backup name. parameters - The requested backup resource state options - LongTermRetentionBackupsClientBeginUpdateByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginUpdateByResourceGroup method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupUpdate.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionBackupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdateByResourceGroup(ctx,
		"<resource-group-name>",
		"<location-name>",
		"<long-term-retention-server-name>",
		"<long-term-retention-database-name>",
		"<backup-name>",
		armsql.UpdateLongTermRetentionBackupParameters{
			Properties: &armsql.UpdateLongTermRetentionBackupParametersProperties{
				RequestedBackupStorageRedundancy: armsql.BackupStorageRedundancy("Geo").ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.LongTermRetentionBackupsClientUpdateByResourceGroupResult)
}
Output:

func (*LongTermRetentionBackupsClient) Get

func (client *LongTermRetentionBackupsClient) Get(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientGetOptions) (LongTermRetentionBackupsClientGetResponse, error)

Get - Gets a long term retention backup. If the operation fails it returns an *azcore.ResponseError type. locationName - The location of the database. longTermRetentionServerName - The name of the server longTermRetentionDatabaseName - The name of the database backupName - The backup name. options - LongTermRetentionBackupsClientGetOptions contains the optional parameters for the LongTermRetentionBackupsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionBackupsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<location-name>",
		"<long-term-retention-server-name>",
		"<long-term-retention-database-name>",
		"<backup-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.LongTermRetentionBackupsClientGetResult)
}
Output:

func (*LongTermRetentionBackupsClient) GetByResourceGroup

func (client *LongTermRetentionBackupsClient) GetByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientGetByResourceGroupOptions) (LongTermRetentionBackupsClientGetByResourceGroupResponse, error)

GetByResourceGroup - Gets a long term retention backup. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The location of the database. longTermRetentionServerName - The name of the server longTermRetentionDatabaseName - The name of the database backupName - The backup name. options - LongTermRetentionBackupsClientGetByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.GetByResourceGroup method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionBackupsClient("<subscription-id>", cred, nil)
	res, err := client.GetByResourceGroup(ctx,
		"<resource-group-name>",
		"<location-name>",
		"<long-term-retention-server-name>",
		"<long-term-retention-database-name>",
		"<backup-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.LongTermRetentionBackupsClientGetByResourceGroupResult)
}
Output:

func (*LongTermRetentionBackupsClient) ListByDatabase

func (client *LongTermRetentionBackupsClient) ListByDatabase(locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, options *LongTermRetentionBackupsClientListByDatabaseOptions) *LongTermRetentionBackupsClientListByDatabasePager

ListByDatabase - Lists all long term retention backups for a database. If the operation fails it returns an *azcore.ResponseError type. locationName - The location of the database longTermRetentionServerName - The name of the server longTermRetentionDatabaseName - The name of the database options - LongTermRetentionBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionBackupsClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<location-name>",
		"<long-term-retention-server-name>",
		"<long-term-retention-database-name>",
		&armsql.LongTermRetentionBackupsClientListByDatabaseOptions{OnlyLatestPerDatabase: nil,
			DatabaseState: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*LongTermRetentionBackupsClient) ListByLocation

ListByLocation - Lists the long term retention backups for a given location. If the operation fails it returns an *azcore.ResponseError type. locationName - The location of the database options - LongTermRetentionBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByLocation method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByLocation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionBackupsClient("<subscription-id>", cred, nil)
	pager := client.ListByLocation("<location-name>",
		&armsql.LongTermRetentionBackupsClientListByLocationOptions{OnlyLatestPerDatabase: nil,
			DatabaseState: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*LongTermRetentionBackupsClient) ListByResourceGroupDatabase

func (client *LongTermRetentionBackupsClient) ListByResourceGroupDatabase(resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, options *LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions) *LongTermRetentionBackupsClientListByResourceGroupDatabasePager

ListByResourceGroupDatabase - Lists all long term retention backups for a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The location of the database longTermRetentionServerName - The name of the server longTermRetentionDatabaseName - The name of the database options - LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByResourceGroupDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionBackupsClient("<subscription-id>", cred, nil)
	pager := client.ListByResourceGroupDatabase("<resource-group-name>",
		"<location-name>",
		"<long-term-retention-server-name>",
		"<long-term-retention-database-name>",
		&armsql.LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions{OnlyLatestPerDatabase: nil,
			DatabaseState: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*LongTermRetentionBackupsClient) ListByResourceGroupLocation

ListByResourceGroupLocation - Lists the long term retention backups for a given location. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The location of the database options - LongTermRetentionBackupsClientListByResourceGroupLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByResourceGroupLocation method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByLocation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionBackupsClient("<subscription-id>", cred, nil)
	pager := client.ListByResourceGroupLocation("<resource-group-name>",
		"<location-name>",
		&armsql.LongTermRetentionBackupsClientListByResourceGroupLocationOptions{OnlyLatestPerDatabase: nil,
			DatabaseState: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*LongTermRetentionBackupsClient) ListByResourceGroupServer

func (client *LongTermRetentionBackupsClient) ListByResourceGroupServer(resourceGroupName string, locationName string, longTermRetentionServerName string, options *LongTermRetentionBackupsClientListByResourceGroupServerOptions) *LongTermRetentionBackupsClientListByResourceGroupServerPager

ListByResourceGroupServer - Lists the long term retention backups for a given server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The location of the database longTermRetentionServerName - The name of the server options - LongTermRetentionBackupsClientListByResourceGroupServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByResourceGroupServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionBackupsClient("<subscription-id>", cred, nil)
	pager := client.ListByResourceGroupServer("<resource-group-name>",
		"<location-name>",
		"<long-term-retention-server-name>",
		&armsql.LongTermRetentionBackupsClientListByResourceGroupServerOptions{OnlyLatestPerDatabase: nil,
			DatabaseState: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*LongTermRetentionBackupsClient) ListByServer

ListByServer - Lists the long term retention backups for a given server. If the operation fails it returns an *azcore.ResponseError type. locationName - The location of the database longTermRetentionServerName - The name of the server options - LongTermRetentionBackupsClientListByServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionBackupsClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<location-name>",
		"<long-term-retention-server-name>",
		&armsql.LongTermRetentionBackupsClientListByServerOptions{OnlyLatestPerDatabase: nil,
			DatabaseState: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type LongTermRetentionBackupsClientBeginCopyByResourceGroupOptions added in v0.3.0

type LongTermRetentionBackupsClientBeginCopyByResourceGroupOptions struct {
}

LongTermRetentionBackupsClientBeginCopyByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginCopyByResourceGroup method.

type LongTermRetentionBackupsClientBeginCopyOptions added in v0.3.0

type LongTermRetentionBackupsClientBeginCopyOptions struct {
}

LongTermRetentionBackupsClientBeginCopyOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginCopy method.

type LongTermRetentionBackupsClientBeginDeleteByResourceGroupOptions added in v0.3.0

type LongTermRetentionBackupsClientBeginDeleteByResourceGroupOptions struct {
}

LongTermRetentionBackupsClientBeginDeleteByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginDeleteByResourceGroup method.

type LongTermRetentionBackupsClientBeginDeleteOptions added in v0.3.0

type LongTermRetentionBackupsClientBeginDeleteOptions struct {
}

LongTermRetentionBackupsClientBeginDeleteOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginDelete method.

type LongTermRetentionBackupsClientBeginUpdateByResourceGroupOptions added in v0.3.0

type LongTermRetentionBackupsClientBeginUpdateByResourceGroupOptions struct {
}

LongTermRetentionBackupsClientBeginUpdateByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginUpdateByResourceGroup method.

type LongTermRetentionBackupsClientBeginUpdateOptions added in v0.3.0

type LongTermRetentionBackupsClientBeginUpdateOptions struct {
}

LongTermRetentionBackupsClientBeginUpdateOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginUpdate method.

type LongTermRetentionBackupsClientCopyByResourceGroupPoller added in v0.3.0

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

LongTermRetentionBackupsClientCopyByResourceGroupPoller provides polling facilities until the operation reaches a terminal state.

func (*LongTermRetentionBackupsClientCopyByResourceGroupPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*LongTermRetentionBackupsClientCopyByResourceGroupPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final LongTermRetentionBackupsClientCopyByResourceGroupResponse will be returned.

func (*LongTermRetentionBackupsClientCopyByResourceGroupPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*LongTermRetentionBackupsClientCopyByResourceGroupPoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type LongTermRetentionBackupsClientCopyByResourceGroupPollerResponse added in v0.3.0

type LongTermRetentionBackupsClientCopyByResourceGroupPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *LongTermRetentionBackupsClientCopyByResourceGroupPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientCopyByResourceGroupPollerResponse contains the response from method LongTermRetentionBackupsClient.CopyByResourceGroup.

func (LongTermRetentionBackupsClientCopyByResourceGroupPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*LongTermRetentionBackupsClientCopyByResourceGroupPollerResponse) Resume added in v0.3.0

Resume rehydrates a LongTermRetentionBackupsClientCopyByResourceGroupPollerResponse from the provided client and resume token.

type LongTermRetentionBackupsClientCopyByResourceGroupResponse added in v0.3.0

type LongTermRetentionBackupsClientCopyByResourceGroupResponse struct {
	LongTermRetentionBackupsClientCopyByResourceGroupResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientCopyByResourceGroupResponse contains the response from method LongTermRetentionBackupsClient.CopyByResourceGroup.

type LongTermRetentionBackupsClientCopyByResourceGroupResult added in v0.3.0

type LongTermRetentionBackupsClientCopyByResourceGroupResult struct {
	LongTermRetentionBackupOperationResult
}

LongTermRetentionBackupsClientCopyByResourceGroupResult contains the result from method LongTermRetentionBackupsClient.CopyByResourceGroup.

type LongTermRetentionBackupsClientCopyPoller added in v0.3.0

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

LongTermRetentionBackupsClientCopyPoller provides polling facilities until the operation reaches a terminal state.

func (*LongTermRetentionBackupsClientCopyPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*LongTermRetentionBackupsClientCopyPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final LongTermRetentionBackupsClientCopyResponse will be returned.

func (*LongTermRetentionBackupsClientCopyPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*LongTermRetentionBackupsClientCopyPoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type LongTermRetentionBackupsClientCopyPollerResponse added in v0.3.0

type LongTermRetentionBackupsClientCopyPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *LongTermRetentionBackupsClientCopyPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientCopyPollerResponse contains the response from method LongTermRetentionBackupsClient.Copy.

func (LongTermRetentionBackupsClientCopyPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*LongTermRetentionBackupsClientCopyPollerResponse) Resume added in v0.3.0

Resume rehydrates a LongTermRetentionBackupsClientCopyPollerResponse from the provided client and resume token.

type LongTermRetentionBackupsClientCopyResponse added in v0.3.0

type LongTermRetentionBackupsClientCopyResponse struct {
	LongTermRetentionBackupsClientCopyResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientCopyResponse contains the response from method LongTermRetentionBackupsClient.Copy.

type LongTermRetentionBackupsClientCopyResult added in v0.3.0

type LongTermRetentionBackupsClientCopyResult struct {
	LongTermRetentionBackupOperationResult
}

LongTermRetentionBackupsClientCopyResult contains the result from method LongTermRetentionBackupsClient.Copy.

type LongTermRetentionBackupsClientDeleteByResourceGroupPoller added in v0.3.0

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

LongTermRetentionBackupsClientDeleteByResourceGroupPoller provides polling facilities until the operation reaches a terminal state.

func (*LongTermRetentionBackupsClientDeleteByResourceGroupPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*LongTermRetentionBackupsClientDeleteByResourceGroupPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final LongTermRetentionBackupsClientDeleteByResourceGroupResponse will be returned.

func (*LongTermRetentionBackupsClientDeleteByResourceGroupPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*LongTermRetentionBackupsClientDeleteByResourceGroupPoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type LongTermRetentionBackupsClientDeleteByResourceGroupPollerResponse added in v0.3.0

type LongTermRetentionBackupsClientDeleteByResourceGroupPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *LongTermRetentionBackupsClientDeleteByResourceGroupPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientDeleteByResourceGroupPollerResponse contains the response from method LongTermRetentionBackupsClient.DeleteByResourceGroup.

func (LongTermRetentionBackupsClientDeleteByResourceGroupPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*LongTermRetentionBackupsClientDeleteByResourceGroupPollerResponse) Resume added in v0.3.0

Resume rehydrates a LongTermRetentionBackupsClientDeleteByResourceGroupPollerResponse from the provided client and resume token.

type LongTermRetentionBackupsClientDeleteByResourceGroupResponse added in v0.3.0

type LongTermRetentionBackupsClientDeleteByResourceGroupResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientDeleteByResourceGroupResponse contains the response from method LongTermRetentionBackupsClient.DeleteByResourceGroup.

type LongTermRetentionBackupsClientDeletePoller added in v0.3.0

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

LongTermRetentionBackupsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*LongTermRetentionBackupsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*LongTermRetentionBackupsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final LongTermRetentionBackupsClientDeleteResponse will be returned.

func (*LongTermRetentionBackupsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*LongTermRetentionBackupsClientDeletePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type LongTermRetentionBackupsClientDeletePollerResponse added in v0.3.0

type LongTermRetentionBackupsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *LongTermRetentionBackupsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientDeletePollerResponse contains the response from method LongTermRetentionBackupsClient.Delete.

func (LongTermRetentionBackupsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*LongTermRetentionBackupsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a LongTermRetentionBackupsClientDeletePollerResponse from the provided client and resume token.

type LongTermRetentionBackupsClientDeleteResponse added in v0.3.0

type LongTermRetentionBackupsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientDeleteResponse contains the response from method LongTermRetentionBackupsClient.Delete.

type LongTermRetentionBackupsClientGetByResourceGroupOptions added in v0.3.0

type LongTermRetentionBackupsClientGetByResourceGroupOptions struct {
}

LongTermRetentionBackupsClientGetByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.GetByResourceGroup method.

type LongTermRetentionBackupsClientGetByResourceGroupResponse added in v0.3.0

type LongTermRetentionBackupsClientGetByResourceGroupResponse struct {
	LongTermRetentionBackupsClientGetByResourceGroupResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientGetByResourceGroupResponse contains the response from method LongTermRetentionBackupsClient.GetByResourceGroup.

type LongTermRetentionBackupsClientGetByResourceGroupResult added in v0.3.0

type LongTermRetentionBackupsClientGetByResourceGroupResult struct {
	LongTermRetentionBackup
}

LongTermRetentionBackupsClientGetByResourceGroupResult contains the result from method LongTermRetentionBackupsClient.GetByResourceGroup.

type LongTermRetentionBackupsClientGetOptions added in v0.3.0

type LongTermRetentionBackupsClientGetOptions struct {
}

LongTermRetentionBackupsClientGetOptions contains the optional parameters for the LongTermRetentionBackupsClient.Get method.

type LongTermRetentionBackupsClientGetResponse added in v0.3.0

type LongTermRetentionBackupsClientGetResponse struct {
	LongTermRetentionBackupsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientGetResponse contains the response from method LongTermRetentionBackupsClient.Get.

type LongTermRetentionBackupsClientGetResult added in v0.3.0

type LongTermRetentionBackupsClientGetResult struct {
	LongTermRetentionBackup
}

LongTermRetentionBackupsClientGetResult contains the result from method LongTermRetentionBackupsClient.Get.

type LongTermRetentionBackupsClientListByDatabaseOptions added in v0.3.0

type LongTermRetentionBackupsClientListByDatabaseOptions struct {
	// Whether to query against just live databases, just deleted databases, or all databases.
	DatabaseState *DatabaseState
	// Whether or not to only get the latest backup for each database.
	OnlyLatestPerDatabase *bool
}

LongTermRetentionBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByDatabase method.

type LongTermRetentionBackupsClientListByDatabasePager added in v0.3.0

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

LongTermRetentionBackupsClientListByDatabasePager provides operations for iterating over paged responses.

func (*LongTermRetentionBackupsClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*LongTermRetentionBackupsClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LongTermRetentionBackupsClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current LongTermRetentionBackupsClientListByDatabaseResponse page.

type LongTermRetentionBackupsClientListByDatabaseResponse added in v0.3.0

type LongTermRetentionBackupsClientListByDatabaseResponse struct {
	LongTermRetentionBackupsClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientListByDatabaseResponse contains the response from method LongTermRetentionBackupsClient.ListByDatabase.

type LongTermRetentionBackupsClientListByDatabaseResult added in v0.3.0

type LongTermRetentionBackupsClientListByDatabaseResult struct {
	LongTermRetentionBackupListResult
}

LongTermRetentionBackupsClientListByDatabaseResult contains the result from method LongTermRetentionBackupsClient.ListByDatabase.

type LongTermRetentionBackupsClientListByLocationOptions added in v0.3.0

type LongTermRetentionBackupsClientListByLocationOptions struct {
	// Whether to query against just live databases, just deleted databases, or all databases.
	DatabaseState *DatabaseState
	// Whether or not to only get the latest backup for each database.
	OnlyLatestPerDatabase *bool
}

LongTermRetentionBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByLocation method.

type LongTermRetentionBackupsClientListByLocationPager added in v0.3.0

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

LongTermRetentionBackupsClientListByLocationPager provides operations for iterating over paged responses.

func (*LongTermRetentionBackupsClientListByLocationPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*LongTermRetentionBackupsClientListByLocationPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LongTermRetentionBackupsClientListByLocationPager) PageResponse added in v0.3.0

PageResponse returns the current LongTermRetentionBackupsClientListByLocationResponse page.

type LongTermRetentionBackupsClientListByLocationResponse added in v0.3.0

type LongTermRetentionBackupsClientListByLocationResponse struct {
	LongTermRetentionBackupsClientListByLocationResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientListByLocationResponse contains the response from method LongTermRetentionBackupsClient.ListByLocation.

type LongTermRetentionBackupsClientListByLocationResult added in v0.3.0

type LongTermRetentionBackupsClientListByLocationResult struct {
	LongTermRetentionBackupListResult
}

LongTermRetentionBackupsClientListByLocationResult contains the result from method LongTermRetentionBackupsClient.ListByLocation.

type LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions added in v0.3.0

type LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions struct {
	// Whether to query against just live databases, just deleted databases, or all databases.
	DatabaseState *DatabaseState
	// Whether or not to only get the latest backup for each database.
	OnlyLatestPerDatabase *bool
}

LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByResourceGroupDatabase method.

type LongTermRetentionBackupsClientListByResourceGroupDatabasePager added in v0.3.0

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

LongTermRetentionBackupsClientListByResourceGroupDatabasePager provides operations for iterating over paged responses.

func (*LongTermRetentionBackupsClientListByResourceGroupDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*LongTermRetentionBackupsClientListByResourceGroupDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LongTermRetentionBackupsClientListByResourceGroupDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current LongTermRetentionBackupsClientListByResourceGroupDatabaseResponse page.

type LongTermRetentionBackupsClientListByResourceGroupDatabaseResponse added in v0.3.0

type LongTermRetentionBackupsClientListByResourceGroupDatabaseResponse struct {
	LongTermRetentionBackupsClientListByResourceGroupDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientListByResourceGroupDatabaseResponse contains the response from method LongTermRetentionBackupsClient.ListByResourceGroupDatabase.

type LongTermRetentionBackupsClientListByResourceGroupDatabaseResult added in v0.3.0

type LongTermRetentionBackupsClientListByResourceGroupDatabaseResult struct {
	LongTermRetentionBackupListResult
}

LongTermRetentionBackupsClientListByResourceGroupDatabaseResult contains the result from method LongTermRetentionBackupsClient.ListByResourceGroupDatabase.

type LongTermRetentionBackupsClientListByResourceGroupLocationOptions added in v0.3.0

type LongTermRetentionBackupsClientListByResourceGroupLocationOptions struct {
	// Whether to query against just live databases, just deleted databases, or all databases.
	DatabaseState *DatabaseState
	// Whether or not to only get the latest backup for each database.
	OnlyLatestPerDatabase *bool
}

LongTermRetentionBackupsClientListByResourceGroupLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByResourceGroupLocation method.

type LongTermRetentionBackupsClientListByResourceGroupLocationPager added in v0.3.0

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

LongTermRetentionBackupsClientListByResourceGroupLocationPager provides operations for iterating over paged responses.

func (*LongTermRetentionBackupsClientListByResourceGroupLocationPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*LongTermRetentionBackupsClientListByResourceGroupLocationPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LongTermRetentionBackupsClientListByResourceGroupLocationPager) PageResponse added in v0.3.0

PageResponse returns the current LongTermRetentionBackupsClientListByResourceGroupLocationResponse page.

type LongTermRetentionBackupsClientListByResourceGroupLocationResponse added in v0.3.0

type LongTermRetentionBackupsClientListByResourceGroupLocationResponse struct {
	LongTermRetentionBackupsClientListByResourceGroupLocationResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientListByResourceGroupLocationResponse contains the response from method LongTermRetentionBackupsClient.ListByResourceGroupLocation.

type LongTermRetentionBackupsClientListByResourceGroupLocationResult added in v0.3.0

type LongTermRetentionBackupsClientListByResourceGroupLocationResult struct {
	LongTermRetentionBackupListResult
}

LongTermRetentionBackupsClientListByResourceGroupLocationResult contains the result from method LongTermRetentionBackupsClient.ListByResourceGroupLocation.

type LongTermRetentionBackupsClientListByResourceGroupServerOptions added in v0.3.0

type LongTermRetentionBackupsClientListByResourceGroupServerOptions struct {
	// Whether to query against just live databases, just deleted databases, or all databases.
	DatabaseState *DatabaseState
	// Whether or not to only get the latest backup for each database.
	OnlyLatestPerDatabase *bool
}

LongTermRetentionBackupsClientListByResourceGroupServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByResourceGroupServer method.

type LongTermRetentionBackupsClientListByResourceGroupServerPager added in v0.3.0

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

LongTermRetentionBackupsClientListByResourceGroupServerPager provides operations for iterating over paged responses.

func (*LongTermRetentionBackupsClientListByResourceGroupServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*LongTermRetentionBackupsClientListByResourceGroupServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LongTermRetentionBackupsClientListByResourceGroupServerPager) PageResponse added in v0.3.0

PageResponse returns the current LongTermRetentionBackupsClientListByResourceGroupServerResponse page.

type LongTermRetentionBackupsClientListByResourceGroupServerResponse added in v0.3.0

type LongTermRetentionBackupsClientListByResourceGroupServerResponse struct {
	LongTermRetentionBackupsClientListByResourceGroupServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientListByResourceGroupServerResponse contains the response from method LongTermRetentionBackupsClient.ListByResourceGroupServer.

type LongTermRetentionBackupsClientListByResourceGroupServerResult added in v0.3.0

type LongTermRetentionBackupsClientListByResourceGroupServerResult struct {
	LongTermRetentionBackupListResult
}

LongTermRetentionBackupsClientListByResourceGroupServerResult contains the result from method LongTermRetentionBackupsClient.ListByResourceGroupServer.

type LongTermRetentionBackupsClientListByServerOptions added in v0.3.0

type LongTermRetentionBackupsClientListByServerOptions struct {
	// Whether to query against just live databases, just deleted databases, or all databases.
	DatabaseState *DatabaseState
	// Whether or not to only get the latest backup for each database.
	OnlyLatestPerDatabase *bool
}

LongTermRetentionBackupsClientListByServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByServer method.

type LongTermRetentionBackupsClientListByServerPager added in v0.3.0

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

LongTermRetentionBackupsClientListByServerPager provides operations for iterating over paged responses.

func (*LongTermRetentionBackupsClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*LongTermRetentionBackupsClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LongTermRetentionBackupsClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current LongTermRetentionBackupsClientListByServerResponse page.

type LongTermRetentionBackupsClientListByServerResponse added in v0.3.0

type LongTermRetentionBackupsClientListByServerResponse struct {
	LongTermRetentionBackupsClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientListByServerResponse contains the response from method LongTermRetentionBackupsClient.ListByServer.

type LongTermRetentionBackupsClientListByServerResult added in v0.3.0

type LongTermRetentionBackupsClientListByServerResult struct {
	LongTermRetentionBackupListResult
}

LongTermRetentionBackupsClientListByServerResult contains the result from method LongTermRetentionBackupsClient.ListByServer.

type LongTermRetentionBackupsClientUpdateByResourceGroupPoller added in v0.3.0

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

LongTermRetentionBackupsClientUpdateByResourceGroupPoller provides polling facilities until the operation reaches a terminal state.

func (*LongTermRetentionBackupsClientUpdateByResourceGroupPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*LongTermRetentionBackupsClientUpdateByResourceGroupPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final LongTermRetentionBackupsClientUpdateByResourceGroupResponse will be returned.

func (*LongTermRetentionBackupsClientUpdateByResourceGroupPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*LongTermRetentionBackupsClientUpdateByResourceGroupPoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type LongTermRetentionBackupsClientUpdateByResourceGroupPollerResponse added in v0.3.0

type LongTermRetentionBackupsClientUpdateByResourceGroupPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *LongTermRetentionBackupsClientUpdateByResourceGroupPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientUpdateByResourceGroupPollerResponse contains the response from method LongTermRetentionBackupsClient.UpdateByResourceGroup.

func (LongTermRetentionBackupsClientUpdateByResourceGroupPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*LongTermRetentionBackupsClientUpdateByResourceGroupPollerResponse) Resume added in v0.3.0

Resume rehydrates a LongTermRetentionBackupsClientUpdateByResourceGroupPollerResponse from the provided client and resume token.

type LongTermRetentionBackupsClientUpdateByResourceGroupResponse added in v0.3.0

type LongTermRetentionBackupsClientUpdateByResourceGroupResponse struct {
	LongTermRetentionBackupsClientUpdateByResourceGroupResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientUpdateByResourceGroupResponse contains the response from method LongTermRetentionBackupsClient.UpdateByResourceGroup.

type LongTermRetentionBackupsClientUpdateByResourceGroupResult added in v0.3.0

type LongTermRetentionBackupsClientUpdateByResourceGroupResult struct {
	LongTermRetentionBackupOperationResult
}

LongTermRetentionBackupsClientUpdateByResourceGroupResult contains the result from method LongTermRetentionBackupsClient.UpdateByResourceGroup.

type LongTermRetentionBackupsClientUpdatePoller added in v0.3.0

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

LongTermRetentionBackupsClientUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*LongTermRetentionBackupsClientUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*LongTermRetentionBackupsClientUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final LongTermRetentionBackupsClientUpdateResponse will be returned.

func (*LongTermRetentionBackupsClientUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*LongTermRetentionBackupsClientUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type LongTermRetentionBackupsClientUpdatePollerResponse added in v0.3.0

type LongTermRetentionBackupsClientUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *LongTermRetentionBackupsClientUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientUpdatePollerResponse contains the response from method LongTermRetentionBackupsClient.Update.

func (LongTermRetentionBackupsClientUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*LongTermRetentionBackupsClientUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a LongTermRetentionBackupsClientUpdatePollerResponse from the provided client and resume token.

type LongTermRetentionBackupsClientUpdateResponse added in v0.3.0

type LongTermRetentionBackupsClientUpdateResponse struct {
	LongTermRetentionBackupsClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionBackupsClientUpdateResponse contains the response from method LongTermRetentionBackupsClient.Update.

type LongTermRetentionBackupsClientUpdateResult added in v0.3.0

type LongTermRetentionBackupsClientUpdateResult struct {
	LongTermRetentionBackupOperationResult
}

LongTermRetentionBackupsClientUpdateResult contains the result from method LongTermRetentionBackupsClient.Update.

type LongTermRetentionManagedInstanceBackupsClient

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

LongTermRetentionManagedInstanceBackupsClient contains the methods for the LongTermRetentionManagedInstanceBackups group. Don't use this type directly, use NewLongTermRetentionManagedInstanceBackupsClient() instead.

func NewLongTermRetentionManagedInstanceBackupsClient

func NewLongTermRetentionManagedInstanceBackupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *LongTermRetentionManagedInstanceBackupsClient

NewLongTermRetentionManagedInstanceBackupsClient creates a new instance of LongTermRetentionManagedInstanceBackupsClient with the specified values. subscriptionID - The 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 (*LongTermRetentionManagedInstanceBackupsClient) BeginDelete

BeginDelete - Deletes a long term retention backup. If the operation fails it returns an *azcore.ResponseError type. locationName - The location of the database. managedInstanceName - The name of the managed instance. databaseName - The name of the managed database. backupName - The backup name. options - LongTermRetentionManagedInstanceBackupsClientBeginDeleteOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionManagedInstanceBackupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<location-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<backup-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*LongTermRetentionManagedInstanceBackupsClient) BeginDeleteByResourceGroup

BeginDeleteByResourceGroup - Deletes a long term retention backup. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The location of the database managedInstanceName - The name of the managed instance. databaseName - The name of the managed database. backupName - The backup name. options - LongTermRetentionManagedInstanceBackupsClientBeginDeleteByResourceGroupOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.BeginDeleteByResourceGroup method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionManagedInstanceBackupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDeleteByResourceGroup(ctx,
		"<resource-group-name>",
		"<location-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<backup-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*LongTermRetentionManagedInstanceBackupsClient) Get

Get - Gets a long term retention backup for a managed database. If the operation fails it returns an *azcore.ResponseError type. locationName - The location of the database. managedInstanceName - The name of the managed instance. databaseName - The name of the managed database. backupName - The backup name. options - LongTermRetentionManagedInstanceBackupsClientGetOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionManagedInstanceBackupsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<location-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<backup-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.LongTermRetentionManagedInstanceBackupsClientGetResult)
}
Output:

func (*LongTermRetentionManagedInstanceBackupsClient) GetByResourceGroup

GetByResourceGroup - Gets a long term retention backup for a managed database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The location of the database. managedInstanceName - The name of the managed instance. databaseName - The name of the managed database. backupName - The backup name. options - LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.GetByResourceGroup method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionManagedInstanceBackupsClient("<subscription-id>", cred, nil)
	res, err := client.GetByResourceGroup(ctx,
		"<resource-group-name>",
		"<location-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<backup-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResult)
}
Output:

func (*LongTermRetentionManagedInstanceBackupsClient) ListByDatabase

ListByDatabase - Lists all long term retention backups for a managed database. If the operation fails it returns an *azcore.ResponseError type. locationName - The location of the database. managedInstanceName - The name of the managed instance. databaseName - The name of the managed database. options - LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionManagedInstanceBackupsClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<location-name>",
		"<managed-instance-name>",
		"<database-name>",
		&armsql.LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions{OnlyLatestPerDatabase: nil,
			DatabaseState: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*LongTermRetentionManagedInstanceBackupsClient) ListByInstance

ListByInstance - Lists the long term retention backups for a given managed instance. If the operation fails it returns an *azcore.ResponseError type. locationName - The location of the database managedInstanceName - The name of the managed instance. options - LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByInstance.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionManagedInstanceBackupsClient("<subscription-id>", cred, nil)
	pager := client.ListByInstance("<location-name>",
		"<managed-instance-name>",
		&armsql.LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions{OnlyLatestPerDatabase: nil,
			DatabaseState: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*LongTermRetentionManagedInstanceBackupsClient) ListByLocation

ListByLocation - Lists the long term retention backups for managed databases in a given location. If the operation fails it returns an *azcore.ResponseError type. locationName - The location of the database. options - LongTermRetentionManagedInstanceBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByLocation method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByLocation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionManagedInstanceBackupsClient("<subscription-id>", cred, nil)
	pager := client.ListByLocation("<location-name>",
		&armsql.LongTermRetentionManagedInstanceBackupsClientListByLocationOptions{OnlyLatestPerDatabase: nil,
			DatabaseState: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupDatabase

ListByResourceGroupDatabase - Lists all long term retention backups for a managed database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The location of the database managedInstanceName - The name of the managed instance. databaseName - The name of the managed database. options - LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionManagedInstanceBackupsClient("<subscription-id>", cred, nil)
	pager := client.ListByResourceGroupDatabase("<resource-group-name>",
		"<location-name>",
		"<managed-instance-name>",
		"<database-name>",
		&armsql.LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions{OnlyLatestPerDatabase: nil,
			DatabaseState: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupInstance

ListByResourceGroupInstance - Lists the long term retention backups for a given managed instance. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The location of the database. managedInstanceName - The name of the managed instance. options - LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByInstance.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionManagedInstanceBackupsClient("<subscription-id>", cred, nil)
	pager := client.ListByResourceGroupInstance("<resource-group-name>",
		"<location-name>",
		"<managed-instance-name>",
		&armsql.LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions{OnlyLatestPerDatabase: nil,
			DatabaseState: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*LongTermRetentionManagedInstanceBackupsClient) ListByResourceGroupLocation

ListByResourceGroupLocation - Lists the long term retention backups for managed databases in a given location. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The location of the database. options - LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupLocation method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByLocation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionManagedInstanceBackupsClient("<subscription-id>", cred, nil)
	pager := client.ListByResourceGroupLocation("<resource-group-name>",
		"<location-name>",
		&armsql.LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions{OnlyLatestPerDatabase: nil,
			DatabaseState: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type LongTermRetentionManagedInstanceBackupsClientBeginDeleteByResourceGroupOptions added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientBeginDeleteByResourceGroupOptions struct {
}

LongTermRetentionManagedInstanceBackupsClientBeginDeleteByResourceGroupOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.BeginDeleteByResourceGroup method.

type LongTermRetentionManagedInstanceBackupsClientBeginDeleteOptions added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientBeginDeleteOptions struct {
}

LongTermRetentionManagedInstanceBackupsClientBeginDeleteOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.BeginDelete method.

type LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupPoller added in v0.3.0

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

LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupPoller provides polling facilities until the operation reaches a terminal state.

func (*LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupResponse will be returned.

func (*LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupPoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupPollerResponse added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupPollerResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.DeleteByResourceGroup.

func (LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupPollerResponse) Resume added in v0.3.0

Resume rehydrates a LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupPollerResponse from the provided client and resume token.

type LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupResponse added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.DeleteByResourceGroup.

type LongTermRetentionManagedInstanceBackupsClientDeletePoller added in v0.3.0

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

LongTermRetentionManagedInstanceBackupsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*LongTermRetentionManagedInstanceBackupsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*LongTermRetentionManagedInstanceBackupsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final LongTermRetentionManagedInstanceBackupsClientDeleteResponse will be returned.

func (*LongTermRetentionManagedInstanceBackupsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*LongTermRetentionManagedInstanceBackupsClientDeletePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type LongTermRetentionManagedInstanceBackupsClientDeletePollerResponse added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *LongTermRetentionManagedInstanceBackupsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionManagedInstanceBackupsClientDeletePollerResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.Delete.

func (LongTermRetentionManagedInstanceBackupsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*LongTermRetentionManagedInstanceBackupsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a LongTermRetentionManagedInstanceBackupsClientDeletePollerResponse from the provided client and resume token.

type LongTermRetentionManagedInstanceBackupsClientDeleteResponse added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionManagedInstanceBackupsClientDeleteResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.Delete.

type LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupOptions added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupOptions struct {
}

LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.GetByResourceGroup method.

type LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResponse added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResponse struct {
	LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.GetByResourceGroup.

type LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResult added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResult struct {
	ManagedInstanceLongTermRetentionBackup
}

LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResult contains the result from method LongTermRetentionManagedInstanceBackupsClient.GetByResourceGroup.

type LongTermRetentionManagedInstanceBackupsClientGetOptions added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientGetOptions struct {
}

LongTermRetentionManagedInstanceBackupsClientGetOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.Get method.

type LongTermRetentionManagedInstanceBackupsClientGetResponse added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientGetResponse struct {
	LongTermRetentionManagedInstanceBackupsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionManagedInstanceBackupsClientGetResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.Get.

type LongTermRetentionManagedInstanceBackupsClientGetResult added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientGetResult struct {
	ManagedInstanceLongTermRetentionBackup
}

LongTermRetentionManagedInstanceBackupsClientGetResult contains the result from method LongTermRetentionManagedInstanceBackupsClient.Get.

type LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions struct {
	// Whether to query against just live databases, just deleted databases, or all databases.
	DatabaseState *DatabaseState
	// Whether or not to only get the latest backup for each database.
	OnlyLatestPerDatabase *bool
}

LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByDatabase method.

type LongTermRetentionManagedInstanceBackupsClientListByDatabasePager added in v0.3.0

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

LongTermRetentionManagedInstanceBackupsClientListByDatabasePager provides operations for iterating over paged responses.

func (*LongTermRetentionManagedInstanceBackupsClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*LongTermRetentionManagedInstanceBackupsClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LongTermRetentionManagedInstanceBackupsClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current LongTermRetentionManagedInstanceBackupsClientListByDatabaseResponse page.

type LongTermRetentionManagedInstanceBackupsClientListByDatabaseResponse added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByDatabaseResponse struct {
	LongTermRetentionManagedInstanceBackupsClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionManagedInstanceBackupsClientListByDatabaseResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.ListByDatabase.

type LongTermRetentionManagedInstanceBackupsClientListByDatabaseResult added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByDatabaseResult struct {
	ManagedInstanceLongTermRetentionBackupListResult
}

LongTermRetentionManagedInstanceBackupsClientListByDatabaseResult contains the result from method LongTermRetentionManagedInstanceBackupsClient.ListByDatabase.

type LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions struct {
	// Whether to query against just live databases, just deleted databases, or all databases.
	DatabaseState *DatabaseState
	// Whether or not to only get the latest backup for each database.
	OnlyLatestPerDatabase *bool
}

LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByInstance method.

type LongTermRetentionManagedInstanceBackupsClientListByInstancePager added in v0.3.0

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

LongTermRetentionManagedInstanceBackupsClientListByInstancePager provides operations for iterating over paged responses.

func (*LongTermRetentionManagedInstanceBackupsClientListByInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*LongTermRetentionManagedInstanceBackupsClientListByInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LongTermRetentionManagedInstanceBackupsClientListByInstancePager) PageResponse added in v0.3.0

PageResponse returns the current LongTermRetentionManagedInstanceBackupsClientListByInstanceResponse page.

type LongTermRetentionManagedInstanceBackupsClientListByInstanceResponse added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByInstanceResponse struct {
	LongTermRetentionManagedInstanceBackupsClientListByInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionManagedInstanceBackupsClientListByInstanceResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.ListByInstance.

type LongTermRetentionManagedInstanceBackupsClientListByInstanceResult added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByInstanceResult struct {
	ManagedInstanceLongTermRetentionBackupListResult
}

LongTermRetentionManagedInstanceBackupsClientListByInstanceResult contains the result from method LongTermRetentionManagedInstanceBackupsClient.ListByInstance.

type LongTermRetentionManagedInstanceBackupsClientListByLocationOptions added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByLocationOptions struct {
	// Whether to query against just live databases, just deleted databases, or all databases.
	DatabaseState *DatabaseState
	// Whether or not to only get the latest backup for each database.
	OnlyLatestPerDatabase *bool
}

LongTermRetentionManagedInstanceBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByLocation method.

type LongTermRetentionManagedInstanceBackupsClientListByLocationPager added in v0.3.0

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

LongTermRetentionManagedInstanceBackupsClientListByLocationPager provides operations for iterating over paged responses.

func (*LongTermRetentionManagedInstanceBackupsClientListByLocationPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*LongTermRetentionManagedInstanceBackupsClientListByLocationPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LongTermRetentionManagedInstanceBackupsClientListByLocationPager) PageResponse added in v0.3.0

PageResponse returns the current LongTermRetentionManagedInstanceBackupsClientListByLocationResponse page.

type LongTermRetentionManagedInstanceBackupsClientListByLocationResponse added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByLocationResponse struct {
	LongTermRetentionManagedInstanceBackupsClientListByLocationResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionManagedInstanceBackupsClientListByLocationResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.ListByLocation.

type LongTermRetentionManagedInstanceBackupsClientListByLocationResult added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByLocationResult struct {
	ManagedInstanceLongTermRetentionBackupListResult
}

LongTermRetentionManagedInstanceBackupsClientListByLocationResult contains the result from method LongTermRetentionManagedInstanceBackupsClient.ListByLocation.

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions struct {
	// Whether to query against just live databases, just deleted databases, or all databases.
	DatabaseState *DatabaseState
	// Whether or not to only get the latest backup for each database.
	OnlyLatestPerDatabase *bool
}

LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupDatabase method.

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabasePager added in v0.3.0

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

LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabasePager provides operations for iterating over paged responses.

func (*LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResponse page.

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResponse added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResponse struct {
	LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupDatabase.

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResult added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResult struct {
	ManagedInstanceLongTermRetentionBackupListResult
}

LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResult contains the result from method LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupDatabase.

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions struct {
	// Whether to query against just live databases, just deleted databases, or all databases.
	DatabaseState *DatabaseState
	// Whether or not to only get the latest backup for each database.
	OnlyLatestPerDatabase *bool
}

LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupInstance method.

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstancePager added in v0.3.0

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

LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstancePager provides operations for iterating over paged responses.

func (*LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstancePager) PageResponse added in v0.3.0

PageResponse returns the current LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResponse page.

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResponse added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResponse struct {
	LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupInstance.

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResult added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResult struct {
	ManagedInstanceLongTermRetentionBackupListResult
}

LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResult contains the result from method LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupInstance.

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions struct {
	// Whether to query against just live databases, just deleted databases, or all databases.
	DatabaseState *DatabaseState
	// Whether or not to only get the latest backup for each database.
	OnlyLatestPerDatabase *bool
}

LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupLocation method.

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationPager added in v0.3.0

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

LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationPager provides operations for iterating over paged responses.

func (*LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationPager) PageResponse added in v0.3.0

PageResponse returns the current LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResponse page.

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResponse added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResponse struct {
	LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupLocation.

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResult added in v0.3.0

type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResult struct {
	ManagedInstanceLongTermRetentionBackupListResult
}

LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResult contains the result from method LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupLocation.

type LongTermRetentionOperationResultProperties

type LongTermRetentionOperationResultProperties struct {
	// READ-ONLY; Source backup resource id
	FromBackupResourceID *string `json:"fromBackupResourceId,omitempty" azure:"ro"`

	// READ-ONLY; Progress message
	Message *string `json:"message,omitempty" azure:"ro"`

	// READ-ONLY; Operation type.
	OperationType *string `json:"operationType,omitempty" azure:"ro"`

	// READ-ONLY; Request Id.
	RequestID *string `json:"requestId,omitempty" azure:"ro"`

	// READ-ONLY; Operation status
	Status *string `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; The storage redundancy type of the copied backup
	TargetBackupStorageRedundancy *BackupStorageRedundancy `json:"targetBackupStorageRedundancy,omitempty" azure:"ro"`

	// READ-ONLY; Target backup resource id
	ToBackupResourceID *string `json:"toBackupResourceId,omitempty" azure:"ro"`
}

LongTermRetentionOperationResultProperties - Contains the operation result properties for long term retention backup operation.

type LongTermRetentionPoliciesClient

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

LongTermRetentionPoliciesClient contains the methods for the LongTermRetentionPolicies group. Don't use this type directly, use NewLongTermRetentionPoliciesClient() instead.

func NewLongTermRetentionPoliciesClient

func NewLongTermRetentionPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *LongTermRetentionPoliciesClient

NewLongTermRetentionPoliciesClient creates a new instance of LongTermRetentionPoliciesClient with the specified values. subscriptionID - The 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 (*LongTermRetentionPoliciesClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Sets a database's long term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. policyName - The policy name. Should always be Default. parameters - The long term retention policy info. options - LongTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the LongTermRetentionPoliciesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.LongTermRetentionPolicyName("default"),
		armsql.LongTermRetentionPolicy{
			Properties: &armsql.BaseLongTermRetentionPolicyProperties{
				MonthlyRetention: to.StringPtr("<monthly-retention>"),
				WeekOfYear:       to.Int32Ptr(5),
				WeeklyRetention:  to.StringPtr("<weekly-retention>"),
				YearlyRetention:  to.StringPtr("<yearly-retention>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.LongTermRetentionPoliciesClientCreateOrUpdateResult)
}
Output:

func (*LongTermRetentionPoliciesClient) Get

Get - Gets a database's long term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. policyName - The policy name. Should always be Default. options - LongTermRetentionPoliciesClientGetOptions contains the optional parameters for the LongTermRetentionPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.LongTermRetentionPolicyName("default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.LongTermRetentionPoliciesClientGetResult)
}
Output:

func (*LongTermRetentionPoliciesClient) ListByDatabase

ListByDatabase - Gets a database's long term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - LongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionPoliciesClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewLongTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type LongTermRetentionPoliciesClientBeginCreateOrUpdateOptions added in v0.3.0

type LongTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct {
}

LongTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the LongTermRetentionPoliciesClient.BeginCreateOrUpdate method.

type LongTermRetentionPoliciesClientCreateOrUpdatePoller added in v0.3.0

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

LongTermRetentionPoliciesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*LongTermRetentionPoliciesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*LongTermRetentionPoliciesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final LongTermRetentionPoliciesClientCreateOrUpdateResponse will be returned.

func (*LongTermRetentionPoliciesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*LongTermRetentionPoliciesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type LongTermRetentionPoliciesClientCreateOrUpdatePollerResponse added in v0.3.0

type LongTermRetentionPoliciesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *LongTermRetentionPoliciesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionPoliciesClientCreateOrUpdatePollerResponse contains the response from method LongTermRetentionPoliciesClient.CreateOrUpdate.

func (LongTermRetentionPoliciesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*LongTermRetentionPoliciesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a LongTermRetentionPoliciesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type LongTermRetentionPoliciesClientCreateOrUpdateResponse added in v0.3.0

type LongTermRetentionPoliciesClientCreateOrUpdateResponse struct {
	LongTermRetentionPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method LongTermRetentionPoliciesClient.CreateOrUpdate.

type LongTermRetentionPoliciesClientCreateOrUpdateResult added in v0.3.0

type LongTermRetentionPoliciesClientCreateOrUpdateResult struct {
	LongTermRetentionPolicy
}

LongTermRetentionPoliciesClientCreateOrUpdateResult contains the result from method LongTermRetentionPoliciesClient.CreateOrUpdate.

type LongTermRetentionPoliciesClientGetOptions added in v0.3.0

type LongTermRetentionPoliciesClientGetOptions struct {
}

LongTermRetentionPoliciesClientGetOptions contains the optional parameters for the LongTermRetentionPoliciesClient.Get method.

type LongTermRetentionPoliciesClientGetResponse added in v0.3.0

type LongTermRetentionPoliciesClientGetResponse struct {
	LongTermRetentionPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionPoliciesClientGetResponse contains the response from method LongTermRetentionPoliciesClient.Get.

type LongTermRetentionPoliciesClientGetResult added in v0.3.0

type LongTermRetentionPoliciesClientGetResult struct {
	LongTermRetentionPolicy
}

LongTermRetentionPoliciesClientGetResult contains the result from method LongTermRetentionPoliciesClient.Get.

type LongTermRetentionPoliciesClientListByDatabaseOptions added in v0.3.0

type LongTermRetentionPoliciesClientListByDatabaseOptions struct {
}

LongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionPoliciesClient.ListByDatabase method.

type LongTermRetentionPoliciesClientListByDatabasePager added in v0.3.0

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

LongTermRetentionPoliciesClientListByDatabasePager provides operations for iterating over paged responses.

func (*LongTermRetentionPoliciesClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*LongTermRetentionPoliciesClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*LongTermRetentionPoliciesClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current LongTermRetentionPoliciesClientListByDatabaseResponse page.

type LongTermRetentionPoliciesClientListByDatabaseResponse added in v0.3.0

type LongTermRetentionPoliciesClientListByDatabaseResponse struct {
	LongTermRetentionPoliciesClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

LongTermRetentionPoliciesClientListByDatabaseResponse contains the response from method LongTermRetentionPoliciesClient.ListByDatabase.

type LongTermRetentionPoliciesClientListByDatabaseResult added in v0.3.0

type LongTermRetentionPoliciesClientListByDatabaseResult struct {
	LongTermRetentionPolicyListResult
}

LongTermRetentionPoliciesClientListByDatabaseResult contains the result from method LongTermRetentionPoliciesClient.ListByDatabase.

type LongTermRetentionPolicy

type LongTermRetentionPolicy struct {
	// Resource properties.
	Properties *BaseLongTermRetentionPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

LongTermRetentionPolicy - A long term retention policy.

type LongTermRetentionPolicyListResult

type LongTermRetentionPolicyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*LongTermRetentionPolicy `json:"value,omitempty" azure:"ro"`
}

LongTermRetentionPolicyListResult - A list of long term retention policies.

func (LongTermRetentionPolicyListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LongTermRetentionPolicyListResult.

type LongTermRetentionPolicyName

type LongTermRetentionPolicyName string
const (
	LongTermRetentionPolicyNameDefault LongTermRetentionPolicyName = "default"
)

func PossibleLongTermRetentionPolicyNameValues

func PossibleLongTermRetentionPolicyNameValues() []LongTermRetentionPolicyName

PossibleLongTermRetentionPolicyNameValues returns the possible values for the LongTermRetentionPolicyName const type.

func (LongTermRetentionPolicyName) ToPtr

ToPtr returns a *LongTermRetentionPolicyName pointing to the current value.

type MaintenanceConfigurationCapability

type MaintenanceConfigurationCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; Maintenance configuration name
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; Whether or not zone redundancy is supported for the maintenance configuration.
	ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"`
}

MaintenanceConfigurationCapability - The maintenance configuration capability

type MaintenanceWindowOptions

type MaintenanceWindowOptions struct {
	// Resource properties.
	Properties *MaintenanceWindowOptionsProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

MaintenanceWindowOptions - Maintenance window options.

type MaintenanceWindowOptionsClient

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

MaintenanceWindowOptionsClient contains the methods for the MaintenanceWindowOptions group. Don't use this type directly, use NewMaintenanceWindowOptionsClient() instead.

func NewMaintenanceWindowOptionsClient

func NewMaintenanceWindowOptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *MaintenanceWindowOptionsClient

NewMaintenanceWindowOptionsClient creates a new instance of MaintenanceWindowOptionsClient with the specified values. subscriptionID - The 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 (*MaintenanceWindowOptionsClient) Get

func (client *MaintenanceWindowOptionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, maintenanceWindowOptionsName string, options *MaintenanceWindowOptionsClientGetOptions) (MaintenanceWindowOptionsClientGetResponse, error)

Get - Gets a list of available maintenance windows. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database to get maintenance windows options for. maintenanceWindowOptionsName - Maintenance window options name. options - MaintenanceWindowOptionsClientGetOptions contains the optional parameters for the MaintenanceWindowOptionsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindowOptions.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewMaintenanceWindowOptionsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<maintenance-window-options-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.MaintenanceWindowOptionsClientGetResult)
}
Output:

type MaintenanceWindowOptionsClientGetOptions added in v0.3.0

type MaintenanceWindowOptionsClientGetOptions struct {
}

MaintenanceWindowOptionsClientGetOptions contains the optional parameters for the MaintenanceWindowOptionsClient.Get method.

type MaintenanceWindowOptionsClientGetResponse added in v0.3.0

type MaintenanceWindowOptionsClientGetResponse struct {
	MaintenanceWindowOptionsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

MaintenanceWindowOptionsClientGetResponse contains the response from method MaintenanceWindowOptionsClient.Get.

type MaintenanceWindowOptionsClientGetResult added in v0.3.0

type MaintenanceWindowOptionsClientGetResult struct {
	MaintenanceWindowOptions
}

MaintenanceWindowOptionsClientGetResult contains the result from method MaintenanceWindowOptionsClient.Get.

type MaintenanceWindowOptionsProperties

type MaintenanceWindowOptionsProperties struct {
	// Whether we allow multiple maintenance windows per cycle.
	AllowMultipleMaintenanceWindowsPerCycle *bool `json:"allowMultipleMaintenanceWindowsPerCycle,omitempty"`

	// Default duration for maintenance window.
	DefaultDurationInMinutes *int32 `json:"defaultDurationInMinutes,omitempty"`

	// Whether maintenance windows are enabled for the database.
	IsEnabled *bool `json:"isEnabled,omitempty"`

	// Available maintenance cycles e.g. {Saturday, 0, 4860}, {Wednesday, 0, 2460}.
	MaintenanceWindowCycles []*MaintenanceWindowTimeRange `json:"maintenanceWindowCycles,omitempty"`

	// Minimum number of maintenance windows cycles to be set on the database.
	MinCycles *int32 `json:"minCycles,omitempty"`

	// Minimum duration of maintenance window.
	MinDurationInMinutes *int32 `json:"minDurationInMinutes,omitempty"`

	// Time granularity in minutes for maintenance windows.
	TimeGranularityInMinutes *int32 `json:"timeGranularityInMinutes,omitempty"`
}

MaintenanceWindowOptionsProperties - Maintenance window options properties.

func (MaintenanceWindowOptionsProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowOptionsProperties.

type MaintenanceWindowTimeRange

type MaintenanceWindowTimeRange struct {
	// Day of maintenance window.
	DayOfWeek *DayOfWeek `json:"dayOfWeek,omitempty"`

	// Duration of maintenance window in minutes.
	Duration *string `json:"duration,omitempty"`

	// Start time minutes offset from 12am.
	StartTime *string `json:"startTime,omitempty"`
}

MaintenanceWindowTimeRange - Maintenance window time range.

type MaintenanceWindows

type MaintenanceWindows struct {
	// Resource properties.
	Properties *MaintenanceWindowsProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

MaintenanceWindows - Maintenance windows.

type MaintenanceWindowsClient

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

MaintenanceWindowsClient contains the methods for the MaintenanceWindows group. Don't use this type directly, use NewMaintenanceWindowsClient() instead.

func NewMaintenanceWindowsClient

func NewMaintenanceWindowsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *MaintenanceWindowsClient

NewMaintenanceWindowsClient creates a new instance of MaintenanceWindowsClient with the specified values. subscriptionID - The 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 (*MaintenanceWindowsClient) CreateOrUpdate

func (client *MaintenanceWindowsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, maintenanceWindowName string, parameters MaintenanceWindows, options *MaintenanceWindowsClientCreateOrUpdateOptions) (MaintenanceWindowsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Sets maintenance windows settings for a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database to set maintenance windows for. maintenanceWindowName - Maintenance window name. options - MaintenanceWindowsClientCreateOrUpdateOptions contains the optional parameters for the MaintenanceWindowsClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateMaintenanceWindows.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewMaintenanceWindowsClient("<subscription-id>", cred, nil)
	_, err = client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<maintenance-window-name>",
		armsql.MaintenanceWindows{
			Properties: &armsql.MaintenanceWindowsProperties{
				TimeRanges: []*armsql.MaintenanceWindowTimeRange{
					{
						DayOfWeek: armsql.DayOfWeek("Saturday").ToPtr(),
						Duration:  to.StringPtr("<duration>"),
						StartTime: to.StringPtr("<start-time>"),
					}},
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*MaintenanceWindowsClient) Get

func (client *MaintenanceWindowsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, maintenanceWindowName string, options *MaintenanceWindowsClientGetOptions) (MaintenanceWindowsClientGetResponse, error)

Get - Gets maintenance windows settings for a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database to get maintenance windows for. maintenanceWindowName - Maintenance window name. options - MaintenanceWindowsClientGetOptions contains the optional parameters for the MaintenanceWindowsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindows.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewMaintenanceWindowsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<maintenance-window-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.MaintenanceWindowsClientGetResult)
}
Output:

type MaintenanceWindowsClientCreateOrUpdateOptions added in v0.3.0

type MaintenanceWindowsClientCreateOrUpdateOptions struct {
}

MaintenanceWindowsClientCreateOrUpdateOptions contains the optional parameters for the MaintenanceWindowsClient.CreateOrUpdate method.

type MaintenanceWindowsClientCreateOrUpdateResponse added in v0.3.0

type MaintenanceWindowsClientCreateOrUpdateResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

MaintenanceWindowsClientCreateOrUpdateResponse contains the response from method MaintenanceWindowsClient.CreateOrUpdate.

type MaintenanceWindowsClientGetOptions added in v0.3.0

type MaintenanceWindowsClientGetOptions struct {
}

MaintenanceWindowsClientGetOptions contains the optional parameters for the MaintenanceWindowsClient.Get method.

type MaintenanceWindowsClientGetResponse added in v0.3.0

type MaintenanceWindowsClientGetResponse struct {
	MaintenanceWindowsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

MaintenanceWindowsClientGetResponse contains the response from method MaintenanceWindowsClient.Get.

type MaintenanceWindowsClientGetResult added in v0.3.0

type MaintenanceWindowsClientGetResult struct {
	MaintenanceWindows
}

MaintenanceWindowsClientGetResult contains the result from method MaintenanceWindowsClient.Get.

type MaintenanceWindowsProperties

type MaintenanceWindowsProperties struct {
	TimeRanges []*MaintenanceWindowTimeRange `json:"timeRanges,omitempty"`
}

MaintenanceWindowsProperties - Maintenance windows resource properties.

func (MaintenanceWindowsProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowsProperties.

type ManagedBackupShortTermRetentionPoliciesClient

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

ManagedBackupShortTermRetentionPoliciesClient contains the methods for the ManagedBackupShortTermRetentionPolicies group. Don't use this type directly, use NewManagedBackupShortTermRetentionPoliciesClient() instead.

func NewManagedBackupShortTermRetentionPoliciesClient

func NewManagedBackupShortTermRetentionPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedBackupShortTermRetentionPoliciesClient

NewManagedBackupShortTermRetentionPoliciesClient creates a new instance of ManagedBackupShortTermRetentionPoliciesClient with the specified values. subscriptionID - The 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 (*ManagedBackupShortTermRetentionPoliciesClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Updates a managed database's short term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. policyName - The policy name. Should always be "default". parameters - The short term retention policy info. options - ManagedBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicy.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedBackupShortTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.ManagedShortTermRetentionPolicyName("default"),
		armsql.ManagedBackupShortTermRetentionPolicy{
			Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{
				RetentionDays: to.Int32Ptr(14),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResult)
}
Output:

func (*ManagedBackupShortTermRetentionPoliciesClient) BeginUpdate

BeginUpdate - Updates a managed database's short term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. policyName - The policy name. Should always be "default". parameters - The short term retention policy info. options - ManagedBackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.BeginUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicy.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedBackupShortTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.ManagedShortTermRetentionPolicyName("default"),
		armsql.ManagedBackupShortTermRetentionPolicy{
			Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{
				RetentionDays: to.Int32Ptr(14),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedBackupShortTermRetentionPoliciesClientUpdateResult)
}
Output:

func (*ManagedBackupShortTermRetentionPoliciesClient) Get

Get - Gets a managed database's short term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. policyName - The policy name. options - ManagedBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedBackupShortTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.ManagedShortTermRetentionPolicyName("default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedBackupShortTermRetentionPoliciesClientGetResult)
}
Output:

func (*ManagedBackupShortTermRetentionPoliciesClient) ListByDatabase

ListByDatabase - Gets a managed database's short term retention policy list. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. options - ManagedBackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedBackupShortTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions added in v0.3.0

type ManagedBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct {
}

ManagedBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate method.

type ManagedBackupShortTermRetentionPoliciesClientBeginUpdateOptions added in v0.3.0

type ManagedBackupShortTermRetentionPoliciesClientBeginUpdateOptions struct {
}

ManagedBackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.BeginUpdate method.

type ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdatePoller added in v0.3.0

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

ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse will be returned.

func (*ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse added in v0.3.0

type ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.CreateOrUpdate.

func (ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse added in v0.3.0

type ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse struct {
	ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.CreateOrUpdate.

type ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResult added in v0.3.0

type ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResult struct {
	ManagedBackupShortTermRetentionPolicy
}

ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResult contains the result from method ManagedBackupShortTermRetentionPoliciesClient.CreateOrUpdate.

type ManagedBackupShortTermRetentionPoliciesClientGetOptions added in v0.3.0

type ManagedBackupShortTermRetentionPoliciesClientGetOptions struct {
}

ManagedBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.Get method.

type ManagedBackupShortTermRetentionPoliciesClientGetResponse added in v0.3.0

type ManagedBackupShortTermRetentionPoliciesClientGetResponse struct {
	ManagedBackupShortTermRetentionPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedBackupShortTermRetentionPoliciesClientGetResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.Get.

type ManagedBackupShortTermRetentionPoliciesClientGetResult added in v0.3.0

type ManagedBackupShortTermRetentionPoliciesClientGetResult struct {
	ManagedBackupShortTermRetentionPolicy
}

ManagedBackupShortTermRetentionPoliciesClientGetResult contains the result from method ManagedBackupShortTermRetentionPoliciesClient.Get.

type ManagedBackupShortTermRetentionPoliciesClientListByDatabaseOptions added in v0.3.0

type ManagedBackupShortTermRetentionPoliciesClientListByDatabaseOptions struct {
}

ManagedBackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.ListByDatabase method.

type ManagedBackupShortTermRetentionPoliciesClientListByDatabasePager added in v0.3.0

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

ManagedBackupShortTermRetentionPoliciesClientListByDatabasePager provides operations for iterating over paged responses.

func (*ManagedBackupShortTermRetentionPoliciesClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedBackupShortTermRetentionPoliciesClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedBackupShortTermRetentionPoliciesClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResponse page.

type ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResponse added in v0.3.0

type ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResponse struct {
	ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.ListByDatabase.

type ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResult added in v0.3.0

type ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResult struct {
	ManagedBackupShortTermRetentionPolicyListResult
}

ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResult contains the result from method ManagedBackupShortTermRetentionPoliciesClient.ListByDatabase.

type ManagedBackupShortTermRetentionPoliciesClientUpdatePoller added in v0.3.0

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

ManagedBackupShortTermRetentionPoliciesClientUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedBackupShortTermRetentionPoliciesClientUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedBackupShortTermRetentionPoliciesClientUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedBackupShortTermRetentionPoliciesClientUpdateResponse will be returned.

func (*ManagedBackupShortTermRetentionPoliciesClientUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedBackupShortTermRetentionPoliciesClientUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedBackupShortTermRetentionPoliciesClientUpdatePollerResponse added in v0.3.0

type ManagedBackupShortTermRetentionPoliciesClientUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedBackupShortTermRetentionPoliciesClientUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedBackupShortTermRetentionPoliciesClientUpdatePollerResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.Update.

func (ManagedBackupShortTermRetentionPoliciesClientUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedBackupShortTermRetentionPoliciesClientUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedBackupShortTermRetentionPoliciesClientUpdatePollerResponse from the provided client and resume token.

type ManagedBackupShortTermRetentionPoliciesClientUpdateResponse added in v0.3.0

type ManagedBackupShortTermRetentionPoliciesClientUpdateResponse struct {
	ManagedBackupShortTermRetentionPoliciesClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedBackupShortTermRetentionPoliciesClientUpdateResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.Update.

type ManagedBackupShortTermRetentionPoliciesClientUpdateResult added in v0.3.0

type ManagedBackupShortTermRetentionPoliciesClientUpdateResult struct {
	ManagedBackupShortTermRetentionPolicy
}

ManagedBackupShortTermRetentionPoliciesClientUpdateResult contains the result from method ManagedBackupShortTermRetentionPoliciesClient.Update.

type ManagedBackupShortTermRetentionPolicy

type ManagedBackupShortTermRetentionPolicy struct {
	// Resource properties.
	Properties *ManagedBackupShortTermRetentionPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedBackupShortTermRetentionPolicy - A short term retention policy.

func (ManagedBackupShortTermRetentionPolicy) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedBackupShortTermRetentionPolicy.

type ManagedBackupShortTermRetentionPolicyListResult

type ManagedBackupShortTermRetentionPolicyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedBackupShortTermRetentionPolicy `json:"value,omitempty" azure:"ro"`
}

ManagedBackupShortTermRetentionPolicyListResult - A list of short term retention policies.

func (ManagedBackupShortTermRetentionPolicyListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ManagedBackupShortTermRetentionPolicyListResult.

type ManagedBackupShortTermRetentionPolicyProperties

type ManagedBackupShortTermRetentionPolicyProperties struct {
	// The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
	RetentionDays *int32 `json:"retentionDays,omitempty"`
}

ManagedBackupShortTermRetentionPolicyProperties - Properties of a short term retention policy

type ManagedDatabase

type ManagedDatabase struct {
	// REQUIRED; Resource location.
	Location *string `json:"location,omitempty"`

	// Resource properties.
	Properties *ManagedDatabaseProperties `json:"properties,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedDatabase - A managed database resource.

func (ManagedDatabase) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedDatabase.

type ManagedDatabaseColumnsClient

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

ManagedDatabaseColumnsClient contains the methods for the ManagedDatabaseColumns group. Don't use this type directly, use NewManagedDatabaseColumnsClient() instead.

func NewManagedDatabaseColumnsClient

func NewManagedDatabaseColumnsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedDatabaseColumnsClient

NewManagedDatabaseColumnsClient creates a new instance of ManagedDatabaseColumnsClient with the specified values. subscriptionID - The 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 (*ManagedDatabaseColumnsClient) Get

func (client *ManagedDatabaseColumnsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, options *ManagedDatabaseColumnsClientGetOptions) (ManagedDatabaseColumnsClientGetResponse, error)

Get - Get managed database column If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. columnName - The name of the column. options - ManagedDatabaseColumnsClientGetOptions contains the optional parameters for the ManagedDatabaseColumnsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseColumnsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		"<column-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseColumnsClientGetResult)
}
Output:

func (*ManagedDatabaseColumnsClient) ListByDatabase

func (client *ManagedDatabaseColumnsClient) ListByDatabase(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseColumnsClientListByDatabaseOptions) *ManagedDatabaseColumnsClientListByDatabasePager

ListByDatabase - List managed database columns If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. options - ManagedDatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseColumnsClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMax.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseColumnsClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		&armsql.ManagedDatabaseColumnsClientListByDatabaseOptions{Schema: []string{
			"dbo"},
			Table: []string{
				"customer",
				"address"},
			Column: []string{
				"username"},
			OrderBy: []string{
				"schema asc",
				"table",
				"column desc"},
			Skiptoken: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*ManagedDatabaseColumnsClient) ListByTable

func (client *ManagedDatabaseColumnsClient) ListByTable(resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, options *ManagedDatabaseColumnsClientListByTableOptions) *ManagedDatabaseColumnsClientListByTablePager

ListByTable - List managed database columns If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. options - ManagedDatabaseColumnsClientListByTableOptions contains the optional parameters for the ManagedDatabaseColumnsClient.ListByTable method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnListByTable.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseColumnsClient("<subscription-id>", cred, nil)
	pager := client.ListByTable("<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		&armsql.ManagedDatabaseColumnsClientListByTableOptions{Filter: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedDatabaseColumnsClientGetOptions added in v0.3.0

type ManagedDatabaseColumnsClientGetOptions struct {
}

ManagedDatabaseColumnsClientGetOptions contains the optional parameters for the ManagedDatabaseColumnsClient.Get method.

type ManagedDatabaseColumnsClientGetResponse added in v0.3.0

type ManagedDatabaseColumnsClientGetResponse struct {
	ManagedDatabaseColumnsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseColumnsClientGetResponse contains the response from method ManagedDatabaseColumnsClient.Get.

type ManagedDatabaseColumnsClientGetResult added in v0.3.0

type ManagedDatabaseColumnsClientGetResult struct {
	DatabaseColumn
}

ManagedDatabaseColumnsClientGetResult contains the result from method ManagedDatabaseColumnsClient.Get.

type ManagedDatabaseColumnsClientListByDatabaseOptions added in v0.3.0

type ManagedDatabaseColumnsClientListByDatabaseOptions struct {
	Column  []string
	OrderBy []string
	Schema  []string
	// An opaque token that identifies a starting point in the collection.
	Skiptoken *string
	Table     []string
}

ManagedDatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseColumnsClient.ListByDatabase method.

type ManagedDatabaseColumnsClientListByDatabasePager added in v0.3.0

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

ManagedDatabaseColumnsClientListByDatabasePager provides operations for iterating over paged responses.

func (*ManagedDatabaseColumnsClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedDatabaseColumnsClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedDatabaseColumnsClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedDatabaseColumnsClientListByDatabaseResponse page.

type ManagedDatabaseColumnsClientListByDatabaseResponse added in v0.3.0

type ManagedDatabaseColumnsClientListByDatabaseResponse struct {
	ManagedDatabaseColumnsClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseColumnsClientListByDatabaseResponse contains the response from method ManagedDatabaseColumnsClient.ListByDatabase.

type ManagedDatabaseColumnsClientListByDatabaseResult added in v0.3.0

type ManagedDatabaseColumnsClientListByDatabaseResult struct {
	DatabaseColumnListResult
}

ManagedDatabaseColumnsClientListByDatabaseResult contains the result from method ManagedDatabaseColumnsClient.ListByDatabase.

type ManagedDatabaseColumnsClientListByTableOptions added in v0.3.0

type ManagedDatabaseColumnsClientListByTableOptions struct {
	// An OData filter expression that filters elements in the collection.
	Filter *string
}

ManagedDatabaseColumnsClientListByTableOptions contains the optional parameters for the ManagedDatabaseColumnsClient.ListByTable method.

type ManagedDatabaseColumnsClientListByTablePager added in v0.3.0

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

ManagedDatabaseColumnsClientListByTablePager provides operations for iterating over paged responses.

func (*ManagedDatabaseColumnsClientListByTablePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedDatabaseColumnsClientListByTablePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedDatabaseColumnsClientListByTablePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedDatabaseColumnsClientListByTableResponse page.

type ManagedDatabaseColumnsClientListByTableResponse added in v0.3.0

type ManagedDatabaseColumnsClientListByTableResponse struct {
	ManagedDatabaseColumnsClientListByTableResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseColumnsClientListByTableResponse contains the response from method ManagedDatabaseColumnsClient.ListByTable.

type ManagedDatabaseColumnsClientListByTableResult added in v0.3.0

type ManagedDatabaseColumnsClientListByTableResult struct {
	DatabaseColumnListResult
}

ManagedDatabaseColumnsClientListByTableResult contains the result from method ManagedDatabaseColumnsClient.ListByTable.

type ManagedDatabaseCreateMode

type ManagedDatabaseCreateMode string

ManagedDatabaseCreateMode - Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention backup (longTermRetentionBackupResourceId required).

const (
	ManagedDatabaseCreateModeDefault                        ManagedDatabaseCreateMode = "Default"
	ManagedDatabaseCreateModePointInTimeRestore             ManagedDatabaseCreateMode = "PointInTimeRestore"
	ManagedDatabaseCreateModeRecovery                       ManagedDatabaseCreateMode = "Recovery"
	ManagedDatabaseCreateModeRestoreExternalBackup          ManagedDatabaseCreateMode = "RestoreExternalBackup"
	ManagedDatabaseCreateModeRestoreLongTermRetentionBackup ManagedDatabaseCreateMode = "RestoreLongTermRetentionBackup"
)

func PossibleManagedDatabaseCreateModeValues

func PossibleManagedDatabaseCreateModeValues() []ManagedDatabaseCreateMode

PossibleManagedDatabaseCreateModeValues returns the possible values for the ManagedDatabaseCreateMode const type.

func (ManagedDatabaseCreateMode) ToPtr

ToPtr returns a *ManagedDatabaseCreateMode pointing to the current value.

type ManagedDatabaseListResult

type ManagedDatabaseListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedDatabase `json:"value,omitempty" azure:"ro"`
}

ManagedDatabaseListResult - A list of managed databases.

func (ManagedDatabaseListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseListResult.

type ManagedDatabaseProperties

type ManagedDatabaseProperties struct {
	// Whether to auto complete restore of this managed database.
	AutoCompleteRestore *bool `json:"autoCompleteRestore,omitempty"`

	// Collation of the metadata catalog.
	CatalogCollation *CatalogCollationType `json:"catalogCollation,omitempty"`

	// Collation of the managed database.
	Collation *string `json:"collation,omitempty"`

	// Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing
	// database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be
	// specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri
	// and StorageContainerSasToken must be specified. Recovery: Creates a database
	// by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to
	// restore. RestoreLongTermRetentionBackup: Create a database by restoring from a
	// long term retention backup (longTermRetentionBackupResourceId required).
	CreateMode *ManagedDatabaseCreateMode `json:"createMode,omitempty"`

	// Last backup file name for restore of this managed database.
	LastBackupName *string `json:"lastBackupName,omitempty"`

	// The name of the Long Term Retention backup to be used for restore of this managed database.
	LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"`

	// The resource identifier of the recoverable database associated with create operation of this database.
	RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"`

	// The restorable dropped database resource id to restore when creating this database.
	RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"`

	// Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point in time (ISO8601 format)
	// of the source database that will be restored to create the new database.
	RestorePointInTime *time.Time `json:"restorePointInTime,omitempty"`

	// The resource identifier of the source database associated with create operation of this database.
	SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"`

	// Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the storage container sas token.
	StorageContainerSasToken *string `json:"storageContainerSasToken,omitempty"`

	// Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container
	// where backups for this restore are stored.
	StorageContainerURI *string `json:"storageContainerUri,omitempty"`

	// READ-ONLY; Creation date of the database.
	CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"`

	// READ-ONLY; Geo paired region.
	DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty" azure:"ro"`

	// READ-ONLY; Earliest restore point in time for point in time restore.
	EarliestRestorePoint *time.Time `json:"earliestRestorePoint,omitempty" azure:"ro"`

	// READ-ONLY; Instance Failover Group resource identifier that this managed database belongs to.
	FailoverGroupID *string `json:"failoverGroupId,omitempty" azure:"ro"`

	// READ-ONLY; Status of the database.
	Status *ManagedDatabaseStatus `json:"status,omitempty" azure:"ro"`
}

ManagedDatabaseProperties - The managed database's properties.

func (ManagedDatabaseProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseProperties.

func (*ManagedDatabaseProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseProperties.

type ManagedDatabaseQueriesClient

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

ManagedDatabaseQueriesClient contains the methods for the ManagedDatabaseQueries group. Don't use this type directly, use NewManagedDatabaseQueriesClient() instead.

func NewManagedDatabaseQueriesClient

func NewManagedDatabaseQueriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedDatabaseQueriesClient

NewManagedDatabaseQueriesClient creates a new instance of ManagedDatabaseQueriesClient with the specified values. subscriptionID - The 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 (*ManagedDatabaseQueriesClient) Get

func (client *ManagedDatabaseQueriesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, queryID string, options *ManagedDatabaseQueriesClientGetOptions) (ManagedDatabaseQueriesClientGetResponse, error)

Get - Get query by query id. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. options - ManagedDatabaseQueriesClientGetOptions contains the optional parameters for the ManagedDatabaseQueriesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseQueriesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<query-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseQueriesClientGetResult)
}
Output:

func (*ManagedDatabaseQueriesClient) ListByQuery

func (client *ManagedDatabaseQueriesClient) ListByQuery(resourceGroupName string, managedInstanceName string, databaseName string, queryID string, options *ManagedDatabaseQueriesClientListByQueryOptions) *ManagedDatabaseQueriesClientListByQueryPager

ListByQuery - Get query execution statistics by query id. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. options - ManagedDatabaseQueriesClientListByQueryOptions contains the optional parameters for the ManagedDatabaseQueriesClient.ListByQuery method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseQueriesClient("<subscription-id>", cred, nil)
	pager := client.ListByQuery("<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<query-id>",
		&armsql.ManagedDatabaseQueriesClientListByQueryOptions{StartTime: nil,
			EndTime:  nil,
			Interval: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedDatabaseQueriesClientGetOptions added in v0.3.0

type ManagedDatabaseQueriesClientGetOptions struct {
}

ManagedDatabaseQueriesClientGetOptions contains the optional parameters for the ManagedDatabaseQueriesClient.Get method.

type ManagedDatabaseQueriesClientGetResponse added in v0.3.0

type ManagedDatabaseQueriesClientGetResponse struct {
	ManagedDatabaseQueriesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseQueriesClientGetResponse contains the response from method ManagedDatabaseQueriesClient.Get.

type ManagedDatabaseQueriesClientGetResult added in v0.3.0

type ManagedDatabaseQueriesClientGetResult struct {
	ManagedInstanceQuery
}

ManagedDatabaseQueriesClientGetResult contains the result from method ManagedDatabaseQueriesClient.Get.

type ManagedDatabaseQueriesClientListByQueryOptions added in v0.3.0

type ManagedDatabaseQueriesClientListByQueryOptions struct {
	// End time for observed period.
	EndTime *string
	// The time step to be used to summarize the metric values.
	Interval *QueryTimeGrainType
	// Start time for observed period.
	StartTime *string
}

ManagedDatabaseQueriesClientListByQueryOptions contains the optional parameters for the ManagedDatabaseQueriesClient.ListByQuery method.

type ManagedDatabaseQueriesClientListByQueryPager added in v0.3.0

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

ManagedDatabaseQueriesClientListByQueryPager provides operations for iterating over paged responses.

func (*ManagedDatabaseQueriesClientListByQueryPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedDatabaseQueriesClientListByQueryPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedDatabaseQueriesClientListByQueryPager) PageResponse added in v0.3.0

PageResponse returns the current ManagedDatabaseQueriesClientListByQueryResponse page.

type ManagedDatabaseQueriesClientListByQueryResponse added in v0.3.0

type ManagedDatabaseQueriesClientListByQueryResponse struct {
	ManagedDatabaseQueriesClientListByQueryResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseQueriesClientListByQueryResponse contains the response from method ManagedDatabaseQueriesClient.ListByQuery.

type ManagedDatabaseQueriesClientListByQueryResult added in v0.3.0

type ManagedDatabaseQueriesClientListByQueryResult struct {
	ManagedInstanceQueryStatistics
}

ManagedDatabaseQueriesClientListByQueryResult contains the result from method ManagedDatabaseQueriesClient.ListByQuery.

type ManagedDatabaseRecommendedSensitivityLabelsClient

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

ManagedDatabaseRecommendedSensitivityLabelsClient contains the methods for the ManagedDatabaseRecommendedSensitivityLabels group. Don't use this type directly, use NewManagedDatabaseRecommendedSensitivityLabelsClient() instead.

func NewManagedDatabaseRecommendedSensitivityLabelsClient

func NewManagedDatabaseRecommendedSensitivityLabelsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedDatabaseRecommendedSensitivityLabelsClient

NewManagedDatabaseRecommendedSensitivityLabelsClient creates a new instance of ManagedDatabaseRecommendedSensitivityLabelsClient with the specified values. subscriptionID - The 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 (*ManagedDatabaseRecommendedSensitivityLabelsClient) Update

Update - Update recommended sensitivity labels states of a given database using an operations batch. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. options - ManagedDatabaseRecommendedSensitivityLabelsClientUpdateOptions contains the optional parameters for the ManagedDatabaseRecommendedSensitivityLabelsClient.Update method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsRecommendedUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseRecommendedSensitivityLabelsClient("<subscription-id>", cred, nil)
	_, err = client.Update(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.RecommendedSensitivityLabelUpdateList{
			Operations: []*armsql.RecommendedSensitivityLabelUpdate{
				{
					Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{
						Schema: to.StringPtr("<schema>"),
						Column: to.StringPtr("<column>"),
						Op:     armsql.RecommendedSensitivityLabelUpdateKindEnable.ToPtr(),
						Table:  to.StringPtr("<table>"),
					},
				},
				{
					Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{
						Schema: to.StringPtr("<schema>"),
						Column: to.StringPtr("<column>"),
						Op:     armsql.RecommendedSensitivityLabelUpdateKindDisable.ToPtr(),
						Table:  to.StringPtr("<table>"),
					},
				},
				{
					Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{
						Schema: to.StringPtr("<schema>"),
						Column: to.StringPtr("<column>"),
						Op:     armsql.RecommendedSensitivityLabelUpdateKindDisable.ToPtr(),
						Table:  to.StringPtr("<table>"),
					},
				}},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

type ManagedDatabaseRecommendedSensitivityLabelsClientUpdateOptions added in v0.3.0

type ManagedDatabaseRecommendedSensitivityLabelsClientUpdateOptions struct {
}

ManagedDatabaseRecommendedSensitivityLabelsClientUpdateOptions contains the optional parameters for the ManagedDatabaseRecommendedSensitivityLabelsClient.Update method.

type ManagedDatabaseRecommendedSensitivityLabelsClientUpdateResponse added in v0.3.0

type ManagedDatabaseRecommendedSensitivityLabelsClientUpdateResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseRecommendedSensitivityLabelsClientUpdateResponse contains the response from method ManagedDatabaseRecommendedSensitivityLabelsClient.Update.

type ManagedDatabaseRestoreDetailsClient

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

ManagedDatabaseRestoreDetailsClient contains the methods for the ManagedDatabaseRestoreDetails group. Don't use this type directly, use NewManagedDatabaseRestoreDetailsClient() instead.

func NewManagedDatabaseRestoreDetailsClient

func NewManagedDatabaseRestoreDetailsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedDatabaseRestoreDetailsClient

NewManagedDatabaseRestoreDetailsClient creates a new instance of ManagedDatabaseRestoreDetailsClient with the specified values. subscriptionID - The 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 (*ManagedDatabaseRestoreDetailsClient) Get

func (client *ManagedDatabaseRestoreDetailsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, restoreDetailsName RestoreDetailsName, options *ManagedDatabaseRestoreDetailsClientGetOptions) (ManagedDatabaseRestoreDetailsClientGetResponse, error)

Get - Gets managed database restore details. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. restoreDetailsName - The name of the restore details to retrieve. options - ManagedDatabaseRestoreDetailsClientGetOptions contains the optional parameters for the ManagedDatabaseRestoreDetailsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRestoreDetails.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseRestoreDetailsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.RestoreDetailsName("Default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseRestoreDetailsClientGetResult)
}
Output:

type ManagedDatabaseRestoreDetailsClientGetOptions added in v0.3.0

type ManagedDatabaseRestoreDetailsClientGetOptions struct {
}

ManagedDatabaseRestoreDetailsClientGetOptions contains the optional parameters for the ManagedDatabaseRestoreDetailsClient.Get method.

type ManagedDatabaseRestoreDetailsClientGetResponse added in v0.3.0

type ManagedDatabaseRestoreDetailsClientGetResponse struct {
	ManagedDatabaseRestoreDetailsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseRestoreDetailsClientGetResponse contains the response from method ManagedDatabaseRestoreDetailsClient.Get.

type ManagedDatabaseRestoreDetailsClientGetResult added in v0.3.0

type ManagedDatabaseRestoreDetailsClientGetResult struct {
	ManagedDatabaseRestoreDetailsResult
}

ManagedDatabaseRestoreDetailsClientGetResult contains the result from method ManagedDatabaseRestoreDetailsClient.Get.

type ManagedDatabaseRestoreDetailsProperties

type ManagedDatabaseRestoreDetailsProperties struct {
	// READ-ONLY; The reason why restore is in Blocked state.
	BlockReason *string `json:"blockReason,omitempty" azure:"ro"`

	// READ-ONLY; Current restoring file name.
	CurrentRestoringFileName *string `json:"currentRestoringFileName,omitempty" azure:"ro"`

	// READ-ONLY; Last restored file name.
	LastRestoredFileName *string `json:"lastRestoredFileName,omitempty" azure:"ro"`

	// READ-ONLY; Last restored file time.
	LastRestoredFileTime *time.Time `json:"lastRestoredFileTime,omitempty" azure:"ro"`

	// READ-ONLY; Last uploaded file name.
	LastUploadedFileName *string `json:"lastUploadedFileName,omitempty" azure:"ro"`

	// READ-ONLY; Last uploaded file time.
	LastUploadedFileTime *time.Time `json:"lastUploadedFileTime,omitempty" azure:"ro"`

	// READ-ONLY; Number of files detected.
	NumberOfFilesDetected *int64 `json:"numberOfFilesDetected,omitempty" azure:"ro"`

	// READ-ONLY; Percent completed.
	PercentCompleted *float64 `json:"percentCompleted,omitempty" azure:"ro"`

	// READ-ONLY; Restore status.
	Status *string `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; List of unrestorable files.
	UnrestorableFiles []*string `json:"unrestorableFiles,omitempty" azure:"ro"`
}

ManagedDatabaseRestoreDetailsProperties - The managed database's restore details properties.

func (ManagedDatabaseRestoreDetailsProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseRestoreDetailsProperties.

func (*ManagedDatabaseRestoreDetailsProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseRestoreDetailsProperties.

type ManagedDatabaseRestoreDetailsResult

type ManagedDatabaseRestoreDetailsResult struct {
	// Resource properties.
	Properties *ManagedDatabaseRestoreDetailsProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedDatabaseRestoreDetailsResult - A managed database restore details.

type ManagedDatabaseSchemasClient

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

ManagedDatabaseSchemasClient contains the methods for the ManagedDatabaseSchemas group. Don't use this type directly, use NewManagedDatabaseSchemasClient() instead.

func NewManagedDatabaseSchemasClient

func NewManagedDatabaseSchemasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedDatabaseSchemasClient

NewManagedDatabaseSchemasClient creates a new instance of ManagedDatabaseSchemasClient with the specified values. subscriptionID - The 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 (*ManagedDatabaseSchemasClient) Get

func (client *ManagedDatabaseSchemasClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, options *ManagedDatabaseSchemasClientGetOptions) (ManagedDatabaseSchemasClientGetResponse, error)

Get - Get managed database schema If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. schemaName - The name of the schema. options - ManagedDatabaseSchemasClientGetOptions contains the optional parameters for the ManagedDatabaseSchemasClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseSchemasClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<schema-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseSchemasClientGetResult)
}
Output:

func (*ManagedDatabaseSchemasClient) ListByDatabase

func (client *ManagedDatabaseSchemasClient) ListByDatabase(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseSchemasClientListByDatabaseOptions) *ManagedDatabaseSchemasClientListByDatabasePager

ListByDatabase - List managed database schemas If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. options - ManagedDatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSchemasClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseSchemasClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		&armsql.ManagedDatabaseSchemasClientListByDatabaseOptions{Filter: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedDatabaseSchemasClientGetOptions added in v0.3.0

type ManagedDatabaseSchemasClientGetOptions struct {
}

ManagedDatabaseSchemasClientGetOptions contains the optional parameters for the ManagedDatabaseSchemasClient.Get method.

type ManagedDatabaseSchemasClientGetResponse added in v0.3.0

type ManagedDatabaseSchemasClientGetResponse struct {
	ManagedDatabaseSchemasClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseSchemasClientGetResponse contains the response from method ManagedDatabaseSchemasClient.Get.

type ManagedDatabaseSchemasClientGetResult added in v0.3.0

type ManagedDatabaseSchemasClientGetResult struct {
	DatabaseSchema
}

ManagedDatabaseSchemasClientGetResult contains the result from method ManagedDatabaseSchemasClient.Get.

type ManagedDatabaseSchemasClientListByDatabaseOptions added in v0.3.0

type ManagedDatabaseSchemasClientListByDatabaseOptions struct {
	// An OData filter expression that filters elements in the collection.
	Filter *string
}

ManagedDatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSchemasClient.ListByDatabase method.

type ManagedDatabaseSchemasClientListByDatabasePager added in v0.3.0

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

ManagedDatabaseSchemasClientListByDatabasePager provides operations for iterating over paged responses.

func (*ManagedDatabaseSchemasClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedDatabaseSchemasClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedDatabaseSchemasClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedDatabaseSchemasClientListByDatabaseResponse page.

type ManagedDatabaseSchemasClientListByDatabaseResponse added in v0.3.0

type ManagedDatabaseSchemasClientListByDatabaseResponse struct {
	ManagedDatabaseSchemasClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseSchemasClientListByDatabaseResponse contains the response from method ManagedDatabaseSchemasClient.ListByDatabase.

type ManagedDatabaseSchemasClientListByDatabaseResult added in v0.3.0

type ManagedDatabaseSchemasClientListByDatabaseResult struct {
	DatabaseSchemaListResult
}

ManagedDatabaseSchemasClientListByDatabaseResult contains the result from method ManagedDatabaseSchemasClient.ListByDatabase.

type ManagedDatabaseSecurityAlertPoliciesClient

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

ManagedDatabaseSecurityAlertPoliciesClient contains the methods for the ManagedDatabaseSecurityAlertPolicies group. Don't use this type directly, use NewManagedDatabaseSecurityAlertPoliciesClient() instead.

func NewManagedDatabaseSecurityAlertPoliciesClient

func NewManagedDatabaseSecurityAlertPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedDatabaseSecurityAlertPoliciesClient

NewManagedDatabaseSecurityAlertPoliciesClient creates a new instance of ManagedDatabaseSecurityAlertPoliciesClient with the specified values. subscriptionID - The 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 (*ManagedDatabaseSecurityAlertPoliciesClient) CreateOrUpdate

CreateOrUpdate - Creates or updates a database's security alert policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the managed database for which the security alert policy is defined. securityAlertPolicyName - The name of the security alert policy. parameters - The database security alert policy. options - ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertCreateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseSecurityAlertPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.SecurityAlertPolicyName("Default"),
		armsql.ManagedDatabaseSecurityAlertPolicy{
			Properties: &armsql.SecurityAlertPolicyProperties{
				DisabledAlerts: []*string{
					to.StringPtr("Sql_Injection"),
					to.StringPtr("Usage_Anomaly")},
				EmailAccountAdmins: to.BoolPtr(true),
				EmailAddresses: []*string{
					to.StringPtr("test@contoso.com"),
					to.StringPtr("user@contoso.com")},
				RetentionDays:           to.Int32Ptr(6),
				State:                   armsql.SecurityAlertPolicyStateEnabled.ToPtr(),
				StorageAccountAccessKey: to.StringPtr("<storage-account-access-key>"),
				StorageEndpoint:         to.StringPtr("<storage-endpoint>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResult)
}
Output:

func (*ManagedDatabaseSecurityAlertPoliciesClient) Get

Get - Gets a managed database's security alert policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the managed database for which the security alert policy is defined. securityAlertPolicyName - The name of the security alert policy. options - ManagedDatabaseSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseSecurityAlertPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.SecurityAlertPolicyName("Default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseSecurityAlertPoliciesClientGetResult)
}
Output:

func (*ManagedDatabaseSecurityAlertPoliciesClient) ListByDatabase

ListByDatabase - Gets a list of managed database's security alert policies. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the managed database for which the security alert policies are defined. options - ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseSecurityAlertPoliciesClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions added in v0.3.0

type ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions struct {
}

ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.CreateOrUpdate method.

type ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse added in v0.3.0

type ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse struct {
	ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method ManagedDatabaseSecurityAlertPoliciesClient.CreateOrUpdate.

type ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResult added in v0.3.0

type ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResult struct {
	ManagedDatabaseSecurityAlertPolicy
}

ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResult contains the result from method ManagedDatabaseSecurityAlertPoliciesClient.CreateOrUpdate.

type ManagedDatabaseSecurityAlertPoliciesClientGetOptions added in v0.3.0

type ManagedDatabaseSecurityAlertPoliciesClientGetOptions struct {
}

ManagedDatabaseSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.Get method.

type ManagedDatabaseSecurityAlertPoliciesClientGetResponse added in v0.3.0

type ManagedDatabaseSecurityAlertPoliciesClientGetResponse struct {
	ManagedDatabaseSecurityAlertPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseSecurityAlertPoliciesClientGetResponse contains the response from method ManagedDatabaseSecurityAlertPoliciesClient.Get.

type ManagedDatabaseSecurityAlertPoliciesClientGetResult added in v0.3.0

type ManagedDatabaseSecurityAlertPoliciesClientGetResult struct {
	ManagedDatabaseSecurityAlertPolicy
}

ManagedDatabaseSecurityAlertPoliciesClientGetResult contains the result from method ManagedDatabaseSecurityAlertPoliciesClient.Get.

type ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseOptions added in v0.3.0

type ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseOptions struct {
}

ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.ListByDatabase method.

type ManagedDatabaseSecurityAlertPoliciesClientListByDatabasePager added in v0.3.0

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

ManagedDatabaseSecurityAlertPoliciesClientListByDatabasePager provides operations for iterating over paged responses.

func (*ManagedDatabaseSecurityAlertPoliciesClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedDatabaseSecurityAlertPoliciesClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedDatabaseSecurityAlertPoliciesClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResponse page.

type ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResponse added in v0.3.0

type ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResponse struct {
	ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResponse contains the response from method ManagedDatabaseSecurityAlertPoliciesClient.ListByDatabase.

type ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResult added in v0.3.0

type ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResult struct {
	ManagedDatabaseSecurityAlertPolicyListResult
}

ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResult contains the result from method ManagedDatabaseSecurityAlertPoliciesClient.ListByDatabase.

type ManagedDatabaseSecurityAlertPolicy

type ManagedDatabaseSecurityAlertPolicy struct {
	// Resource properties.
	Properties *SecurityAlertPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedDatabaseSecurityAlertPolicy - A managed database security alert policy.

type ManagedDatabaseSecurityAlertPolicyListResult

type ManagedDatabaseSecurityAlertPolicyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedDatabaseSecurityAlertPolicy `json:"value,omitempty" azure:"ro"`
}

ManagedDatabaseSecurityAlertPolicyListResult - A list of the managed database's security alert policies.

func (ManagedDatabaseSecurityAlertPolicyListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseSecurityAlertPolicyListResult.

type ManagedDatabaseSecurityEventsClient

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

ManagedDatabaseSecurityEventsClient contains the methods for the ManagedDatabaseSecurityEvents group. Don't use this type directly, use NewManagedDatabaseSecurityEventsClient() instead.

func NewManagedDatabaseSecurityEventsClient

func NewManagedDatabaseSecurityEventsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedDatabaseSecurityEventsClient

NewManagedDatabaseSecurityEventsClient creates a new instance of ManagedDatabaseSecurityEventsClient with the specified values. subscriptionID - The 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 (*ManagedDatabaseSecurityEventsClient) ListByDatabase

ListByDatabase - Gets a list of security events. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the managed database for which the security events are retrieved. options - ManagedDatabaseSecurityEventsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityEventsClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseSecurityEventsClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		&armsql.ManagedDatabaseSecurityEventsClientListByDatabaseOptions{Filter: to.StringPtr("<filter>"),
			Skip:      to.Int32Ptr(0),
			Top:       to.Int32Ptr(1),
			Skiptoken: to.StringPtr("<skiptoken>"),
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedDatabaseSecurityEventsClientListByDatabaseOptions added in v0.3.0

type ManagedDatabaseSecurityEventsClientListByDatabaseOptions struct {
	// An OData filter expression that filters elements in the collection.
	Filter *string
	// The number of elements in the collection to skip.
	Skip *int32
	// An opaque token that identifies a starting point in the collection.
	Skiptoken *string
	// The number of elements to return from the collection.
	Top *int32
}

ManagedDatabaseSecurityEventsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityEventsClient.ListByDatabase method.

type ManagedDatabaseSecurityEventsClientListByDatabasePager added in v0.3.0

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

ManagedDatabaseSecurityEventsClientListByDatabasePager provides operations for iterating over paged responses.

func (*ManagedDatabaseSecurityEventsClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedDatabaseSecurityEventsClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedDatabaseSecurityEventsClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedDatabaseSecurityEventsClientListByDatabaseResponse page.

type ManagedDatabaseSecurityEventsClientListByDatabaseResponse added in v0.3.0

type ManagedDatabaseSecurityEventsClientListByDatabaseResponse struct {
	ManagedDatabaseSecurityEventsClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseSecurityEventsClientListByDatabaseResponse contains the response from method ManagedDatabaseSecurityEventsClient.ListByDatabase.

type ManagedDatabaseSecurityEventsClientListByDatabaseResult added in v0.3.0

type ManagedDatabaseSecurityEventsClientListByDatabaseResult struct {
	SecurityEventCollection
}

ManagedDatabaseSecurityEventsClientListByDatabaseResult contains the result from method ManagedDatabaseSecurityEventsClient.ListByDatabase.

type ManagedDatabaseSensitivityLabelsClient

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

ManagedDatabaseSensitivityLabelsClient contains the methods for the ManagedDatabaseSensitivityLabels group. Don't use this type directly, use NewManagedDatabaseSensitivityLabelsClient() instead.

func NewManagedDatabaseSensitivityLabelsClient

func NewManagedDatabaseSensitivityLabelsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedDatabaseSensitivityLabelsClient

NewManagedDatabaseSensitivityLabelsClient creates a new instance of ManagedDatabaseSensitivityLabelsClient with the specified values. subscriptionID - The 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 (*ManagedDatabaseSensitivityLabelsClient) CreateOrUpdate

func (client *ManagedDatabaseSensitivityLabelsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, parameters SensitivityLabel, options *ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions) (ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates the sensitivity label of a given column If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. columnName - The name of the column. parameters - The column sensitivity label resource. options - ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelCreate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseSensitivityLabelsClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		"<column-name>",
		armsql.SensitivityLabel{
			Properties: &armsql.SensitivityLabelProperties{
				InformationType:   to.StringPtr("<information-type>"),
				InformationTypeID: to.StringPtr("<information-type-id>"),
				LabelID:           to.StringPtr("<label-id>"),
				LabelName:         to.StringPtr("<label-name>"),
				Rank:              armsql.SensitivityLabelRankHigh.ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResult)
}
Output:

func (*ManagedDatabaseSensitivityLabelsClient) Delete

func (client *ManagedDatabaseSensitivityLabelsClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, options *ManagedDatabaseSensitivityLabelsClientDeleteOptions) (ManagedDatabaseSensitivityLabelsClientDeleteResponse, error)

Delete - Deletes the sensitivity label of a given column If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. columnName - The name of the column. options - ManagedDatabaseSensitivityLabelsClientDeleteOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseSensitivityLabelsClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		"<column-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedDatabaseSensitivityLabelsClient) DisableRecommendation

func (client *ManagedDatabaseSensitivityLabelsClient) DisableRecommendation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, options *ManagedDatabaseSensitivityLabelsClientDisableRecommendationOptions) (ManagedDatabaseSensitivityLabelsClientDisableRecommendationResponse, error)

DisableRecommendation - Disables sensitivity recommendations on a given column If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. columnName - The name of the column. options - ManagedDatabaseSensitivityLabelsClientDisableRecommendationOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.DisableRecommendation method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelDisable.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseSensitivityLabelsClient("<subscription-id>", cred, nil)
	_, err = client.DisableRecommendation(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		"<column-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedDatabaseSensitivityLabelsClient) EnableRecommendation

func (client *ManagedDatabaseSensitivityLabelsClient) EnableRecommendation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, options *ManagedDatabaseSensitivityLabelsClientEnableRecommendationOptions) (ManagedDatabaseSensitivityLabelsClientEnableRecommendationResponse, error)

EnableRecommendation - Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns) If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. columnName - The name of the column. options - ManagedDatabaseSensitivityLabelsClientEnableRecommendationOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.EnableRecommendation method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelEnable.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseSensitivityLabelsClient("<subscription-id>", cred, nil)
	_, err = client.EnableRecommendation(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		"<column-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedDatabaseSensitivityLabelsClient) Get

func (client *ManagedDatabaseSensitivityLabelsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource SensitivityLabelSource, options *ManagedDatabaseSensitivityLabelsClientGetOptions) (ManagedDatabaseSensitivityLabelsClientGetResponse, error)

Get - Gets the sensitivity label of a given column If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. columnName - The name of the column. sensitivityLabelSource - The source of the sensitivity label. options - ManagedDatabaseSensitivityLabelsClientGetOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseSensitivityLabelsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		"<column-name>",
		armsql.SensitivityLabelSourceCurrent,
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseSensitivityLabelsClientGetResult)
}
Output:

func (*ManagedDatabaseSensitivityLabelsClient) ListCurrentByDatabase

ListCurrentByDatabase - Gets the sensitivity labels of a given database If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. options - ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.ListCurrentByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseCurrent.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseSensitivityLabelsClient("<subscription-id>", cred, nil)
	pager := client.ListCurrentByDatabase("<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		&armsql.ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions{SkipToken: nil,
			Count:  nil,
			Filter: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*ManagedDatabaseSensitivityLabelsClient) ListRecommendedByDatabase

ListRecommendedByDatabase - Gets the sensitivity labels of a given database If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. options - ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.ListRecommendedByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseRecommended.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseSensitivityLabelsClient("<subscription-id>", cred, nil)
	pager := client.ListRecommendedByDatabase("<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		&armsql.ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions{SkipToken: nil,
			IncludeDisabledRecommendations: nil,
			Filter:                         nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*ManagedDatabaseSensitivityLabelsClient) Update

Update - Update sensitivity labels of a given database using an operations batch. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. options - ManagedDatabaseSensitivityLabelsClientUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Update method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsCurrentUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseSensitivityLabelsClient("<subscription-id>", cred, nil)
	_, err = client.Update(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.SensitivityLabelUpdateList{
			Operations: []*armsql.SensitivityLabelUpdate{
				{
					Properties: &armsql.SensitivityLabelUpdateProperties{
						Schema: to.StringPtr("<schema>"),
						Column: to.StringPtr("<column>"),
						Op:     armsql.SensitivityLabelUpdateKindSet.ToPtr(),
						SensitivityLabel: &armsql.SensitivityLabel{
							Properties: &armsql.SensitivityLabelProperties{
								InformationType:   to.StringPtr("<information-type>"),
								InformationTypeID: to.StringPtr("<information-type-id>"),
								LabelID:           to.StringPtr("<label-id>"),
								LabelName:         to.StringPtr("<label-name>"),
							},
						},
						Table: to.StringPtr("<table>"),
					},
				},
				{
					Properties: &armsql.SensitivityLabelUpdateProperties{
						Schema: to.StringPtr("<schema>"),
						Column: to.StringPtr("<column>"),
						Op:     armsql.SensitivityLabelUpdateKindSet.ToPtr(),
						SensitivityLabel: &armsql.SensitivityLabel{
							Properties: &armsql.SensitivityLabelProperties{
								InformationType:   to.StringPtr("<information-type>"),
								InformationTypeID: to.StringPtr("<information-type-id>"),
								LabelID:           to.StringPtr("<label-id>"),
								LabelName:         to.StringPtr("<label-name>"),
							},
						},
						Table: to.StringPtr("<table>"),
					},
				},
				{
					Properties: &armsql.SensitivityLabelUpdateProperties{
						Schema: to.StringPtr("<schema>"),
						Column: to.StringPtr("<column>"),
						Op:     armsql.SensitivityLabelUpdateKindRemove.ToPtr(),
						Table:  to.StringPtr("<table>"),
					},
				}},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

type ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions struct {
}

ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.CreateOrUpdate method.

type ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResponse added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResponse struct {
	ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.CreateOrUpdate.

type ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResult added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResult struct {
	SensitivityLabel
}

ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResult contains the result from method ManagedDatabaseSensitivityLabelsClient.CreateOrUpdate.

type ManagedDatabaseSensitivityLabelsClientDeleteOptions added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientDeleteOptions struct {
}

ManagedDatabaseSensitivityLabelsClientDeleteOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Delete method.

type ManagedDatabaseSensitivityLabelsClientDeleteResponse added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseSensitivityLabelsClientDeleteResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.Delete.

type ManagedDatabaseSensitivityLabelsClientDisableRecommendationOptions added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientDisableRecommendationOptions struct {
}

ManagedDatabaseSensitivityLabelsClientDisableRecommendationOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.DisableRecommendation method.

type ManagedDatabaseSensitivityLabelsClientDisableRecommendationResponse added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientDisableRecommendationResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseSensitivityLabelsClientDisableRecommendationResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.DisableRecommendation.

type ManagedDatabaseSensitivityLabelsClientEnableRecommendationOptions added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientEnableRecommendationOptions struct {
}

ManagedDatabaseSensitivityLabelsClientEnableRecommendationOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.EnableRecommendation method.

type ManagedDatabaseSensitivityLabelsClientEnableRecommendationResponse added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientEnableRecommendationResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseSensitivityLabelsClientEnableRecommendationResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.EnableRecommendation.

type ManagedDatabaseSensitivityLabelsClientGetOptions added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientGetOptions struct {
}

ManagedDatabaseSensitivityLabelsClientGetOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Get method.

type ManagedDatabaseSensitivityLabelsClientGetResponse added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientGetResponse struct {
	ManagedDatabaseSensitivityLabelsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseSensitivityLabelsClientGetResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.Get.

type ManagedDatabaseSensitivityLabelsClientGetResult added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientGetResult struct {
	SensitivityLabel
}

ManagedDatabaseSensitivityLabelsClientGetResult contains the result from method ManagedDatabaseSensitivityLabelsClient.Get.

type ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions struct {
	Count *bool
	// An OData filter expression that filters elements in the collection.
	Filter    *string
	SkipToken *string
}

ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.ListCurrentByDatabase method.

type ManagedDatabaseSensitivityLabelsClientListCurrentByDatabasePager added in v0.3.0

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

ManagedDatabaseSensitivityLabelsClientListCurrentByDatabasePager provides operations for iterating over paged responses.

func (*ManagedDatabaseSensitivityLabelsClientListCurrentByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedDatabaseSensitivityLabelsClientListCurrentByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedDatabaseSensitivityLabelsClientListCurrentByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResponse page.

type ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResponse added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResponse struct {
	ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.ListCurrentByDatabase.

type ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResult added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResult struct {
	SensitivityLabelListResult
}

ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResult contains the result from method ManagedDatabaseSensitivityLabelsClient.ListCurrentByDatabase.

type ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions struct {
	// An OData filter expression that filters elements in the collection.
	Filter *string
	// Specifies whether to include disabled recommendations or not.
	IncludeDisabledRecommendations *bool
	SkipToken                      *string
}

ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.ListRecommendedByDatabase method.

type ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabasePager added in v0.3.0

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

ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabasePager provides operations for iterating over paged responses.

func (*ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResponse page.

type ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResponse added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResponse struct {
	ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.ListRecommendedByDatabase.

type ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResult added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResult struct {
	SensitivityLabelListResult
}

ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResult contains the result from method ManagedDatabaseSensitivityLabelsClient.ListRecommendedByDatabase.

type ManagedDatabaseSensitivityLabelsClientUpdateOptions added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientUpdateOptions struct {
}

ManagedDatabaseSensitivityLabelsClientUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Update method.

type ManagedDatabaseSensitivityLabelsClientUpdateResponse added in v0.3.0

type ManagedDatabaseSensitivityLabelsClientUpdateResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseSensitivityLabelsClientUpdateResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.Update.

type ManagedDatabaseStatus

type ManagedDatabaseStatus string

ManagedDatabaseStatus - Status of the database.

const (
	ManagedDatabaseStatusCreating     ManagedDatabaseStatus = "Creating"
	ManagedDatabaseStatusInaccessible ManagedDatabaseStatus = "Inaccessible"
	ManagedDatabaseStatusOffline      ManagedDatabaseStatus = "Offline"
	ManagedDatabaseStatusOnline       ManagedDatabaseStatus = "Online"
	ManagedDatabaseStatusRestoring    ManagedDatabaseStatus = "Restoring"
	ManagedDatabaseStatusShutdown     ManagedDatabaseStatus = "Shutdown"
	ManagedDatabaseStatusUpdating     ManagedDatabaseStatus = "Updating"
)

func PossibleManagedDatabaseStatusValues

func PossibleManagedDatabaseStatusValues() []ManagedDatabaseStatus

PossibleManagedDatabaseStatusValues returns the possible values for the ManagedDatabaseStatus const type.

func (ManagedDatabaseStatus) ToPtr

ToPtr returns a *ManagedDatabaseStatus pointing to the current value.

type ManagedDatabaseTablesClient

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

ManagedDatabaseTablesClient contains the methods for the ManagedDatabaseTables group. Don't use this type directly, use NewManagedDatabaseTablesClient() instead.

func NewManagedDatabaseTablesClient

func NewManagedDatabaseTablesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedDatabaseTablesClient

NewManagedDatabaseTablesClient creates a new instance of ManagedDatabaseTablesClient with the specified values. subscriptionID - The 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 (*ManagedDatabaseTablesClient) Get

func (client *ManagedDatabaseTablesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, options *ManagedDatabaseTablesClientGetOptions) (ManagedDatabaseTablesClientGetResponse, error)

Get - Get managed database table If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. options - ManagedDatabaseTablesClientGetOptions contains the optional parameters for the ManagedDatabaseTablesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseTablesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseTablesClientGetResult)
}
Output:

func (*ManagedDatabaseTablesClient) ListBySchema

func (client *ManagedDatabaseTablesClient) ListBySchema(resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, options *ManagedDatabaseTablesClientListBySchemaOptions) *ManagedDatabaseTablesClientListBySchemaPager

ListBySchema - List managed database tables If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. schemaName - The name of the schema. options - ManagedDatabaseTablesClientListBySchemaOptions contains the optional parameters for the ManagedDatabaseTablesClient.ListBySchema method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableListBySchema.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseTablesClient("<subscription-id>", cred, nil)
	pager := client.ListBySchema("<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		"<schema-name>",
		&armsql.ManagedDatabaseTablesClientListBySchemaOptions{Filter: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedDatabaseTablesClientGetOptions added in v0.3.0

type ManagedDatabaseTablesClientGetOptions struct {
}

ManagedDatabaseTablesClientGetOptions contains the optional parameters for the ManagedDatabaseTablesClient.Get method.

type ManagedDatabaseTablesClientGetResponse added in v0.3.0

type ManagedDatabaseTablesClientGetResponse struct {
	ManagedDatabaseTablesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseTablesClientGetResponse contains the response from method ManagedDatabaseTablesClient.Get.

type ManagedDatabaseTablesClientGetResult added in v0.3.0

type ManagedDatabaseTablesClientGetResult struct {
	DatabaseTable
}

ManagedDatabaseTablesClientGetResult contains the result from method ManagedDatabaseTablesClient.Get.

type ManagedDatabaseTablesClientListBySchemaOptions added in v0.3.0

type ManagedDatabaseTablesClientListBySchemaOptions struct {
	// An OData filter expression that filters elements in the collection.
	Filter *string
}

ManagedDatabaseTablesClientListBySchemaOptions contains the optional parameters for the ManagedDatabaseTablesClient.ListBySchema method.

type ManagedDatabaseTablesClientListBySchemaPager added in v0.3.0

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

ManagedDatabaseTablesClientListBySchemaPager provides operations for iterating over paged responses.

func (*ManagedDatabaseTablesClientListBySchemaPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedDatabaseTablesClientListBySchemaPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedDatabaseTablesClientListBySchemaPager) PageResponse added in v0.3.0

PageResponse returns the current ManagedDatabaseTablesClientListBySchemaResponse page.

type ManagedDatabaseTablesClientListBySchemaResponse added in v0.3.0

type ManagedDatabaseTablesClientListBySchemaResponse struct {
	ManagedDatabaseTablesClientListBySchemaResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseTablesClientListBySchemaResponse contains the response from method ManagedDatabaseTablesClient.ListBySchema.

type ManagedDatabaseTablesClientListBySchemaResult added in v0.3.0

type ManagedDatabaseTablesClientListBySchemaResult struct {
	DatabaseTableListResult
}

ManagedDatabaseTablesClientListBySchemaResult contains the result from method ManagedDatabaseTablesClient.ListBySchema.

type ManagedDatabaseTransparentDataEncryptionClient

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

ManagedDatabaseTransparentDataEncryptionClient contains the methods for the ManagedDatabaseTransparentDataEncryption group. Don't use this type directly, use NewManagedDatabaseTransparentDataEncryptionClient() instead.

func NewManagedDatabaseTransparentDataEncryptionClient

func NewManagedDatabaseTransparentDataEncryptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedDatabaseTransparentDataEncryptionClient

NewManagedDatabaseTransparentDataEncryptionClient creates a new instance of ManagedDatabaseTransparentDataEncryptionClient with the specified values. subscriptionID - The 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 (*ManagedDatabaseTransparentDataEncryptionClient) CreateOrUpdate

CreateOrUpdate - Updates a database's transparent data encryption configuration. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the managed database for which the security alert policy is defined. tdeName - The name of the transparent data encryption configuration. parameters - The database transparent data encryption. options - ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseTransparentDataEncryptionClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.TransparentDataEncryptionName("current"),
		armsql.ManagedTransparentDataEncryption{
			Properties: &armsql.ManagedTransparentDataEncryptionProperties{
				State: armsql.TransparentDataEncryptionStateEnabled.ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResult)
}
Output:

func (*ManagedDatabaseTransparentDataEncryptionClient) Get

Get - Gets a managed database's transparent data encryption. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the managed database for which the transparent data encryption is defined. tdeName - The name of the transparent data encryption configuration. options - ManagedDatabaseTransparentDataEncryptionClientGetOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseTransparentDataEncryptionClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.TransparentDataEncryptionName("current"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseTransparentDataEncryptionClientGetResult)
}
Output:

func (*ManagedDatabaseTransparentDataEncryptionClient) ListByDatabase

ListByDatabase - Gets a list of managed database's transparent data encryptions. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the managed database for which the transparent data encryption is defined. options - ManagedDatabaseTransparentDataEncryptionClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseTransparentDataEncryptionClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateOptions added in v0.3.0

type ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateOptions struct {
}

ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.CreateOrUpdate method.

type ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResponse added in v0.3.0

type ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResponse struct {
	ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResponse contains the response from method ManagedDatabaseTransparentDataEncryptionClient.CreateOrUpdate.

type ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResult added in v0.3.0

type ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResult struct {
	ManagedTransparentDataEncryption
}

ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResult contains the result from method ManagedDatabaseTransparentDataEncryptionClient.CreateOrUpdate.

type ManagedDatabaseTransparentDataEncryptionClientGetOptions added in v0.3.0

type ManagedDatabaseTransparentDataEncryptionClientGetOptions struct {
}

ManagedDatabaseTransparentDataEncryptionClientGetOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.Get method.

type ManagedDatabaseTransparentDataEncryptionClientGetResponse added in v0.3.0

type ManagedDatabaseTransparentDataEncryptionClientGetResponse struct {
	ManagedDatabaseTransparentDataEncryptionClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseTransparentDataEncryptionClientGetResponse contains the response from method ManagedDatabaseTransparentDataEncryptionClient.Get.

type ManagedDatabaseTransparentDataEncryptionClientGetResult added in v0.3.0

type ManagedDatabaseTransparentDataEncryptionClientGetResult struct {
	ManagedTransparentDataEncryption
}

ManagedDatabaseTransparentDataEncryptionClientGetResult contains the result from method ManagedDatabaseTransparentDataEncryptionClient.Get.

type ManagedDatabaseTransparentDataEncryptionClientListByDatabaseOptions added in v0.3.0

type ManagedDatabaseTransparentDataEncryptionClientListByDatabaseOptions struct {
}

ManagedDatabaseTransparentDataEncryptionClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.ListByDatabase method.

type ManagedDatabaseTransparentDataEncryptionClientListByDatabasePager added in v0.3.0

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

ManagedDatabaseTransparentDataEncryptionClientListByDatabasePager provides operations for iterating over paged responses.

func (*ManagedDatabaseTransparentDataEncryptionClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedDatabaseTransparentDataEncryptionClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedDatabaseTransparentDataEncryptionClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResponse page.

type ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResponse added in v0.3.0

type ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResponse struct {
	ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResponse contains the response from method ManagedDatabaseTransparentDataEncryptionClient.ListByDatabase.

type ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResult added in v0.3.0

type ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResult struct {
	ManagedTransparentDataEncryptionListResult
}

ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResult contains the result from method ManagedDatabaseTransparentDataEncryptionClient.ListByDatabase.

type ManagedDatabaseUpdate

type ManagedDatabaseUpdate struct {
	// Resource properties.
	Properties *ManagedDatabaseProperties `json:"properties,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`
}

ManagedDatabaseUpdate - An managed database update.

func (ManagedDatabaseUpdate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseUpdate.

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient

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

ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient contains the methods for the ManagedDatabaseVulnerabilityAssessmentRuleBaselines group. Don't use this type directly, use NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient() instead.

func NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient

func NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient

NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient creates a new instance of ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient with the specified values. subscriptionID - The 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 (*ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdate

CreateOrUpdate - Creates or updates a database's vulnerability assessment rule baseline. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. ruleID - The vulnerability assessment rule ID. baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule). parameters - The requested rule baseline resource. options - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineCreate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		"<rule-id>",
		armsql.VulnerabilityAssessmentPolicyBaselineNameDefault,
		armsql.DatabaseVulnerabilityAssessmentRuleBaseline{
			Properties: &armsql.DatabaseVulnerabilityAssessmentRuleBaselineProperties{
				BaselineResults: []*armsql.DatabaseVulnerabilityAssessmentRuleBaselineItem{
					{
						Result: []*string{
							to.StringPtr("userA"),
							to.StringPtr("SELECT")},
					},
					{
						Result: []*string{
							to.StringPtr("userB"),
							to.StringPtr("SELECT")},
					},
					{
						Result: []*string{
							to.StringPtr("userC"),
							to.StringPtr("SELECT"),
							to.StringPtr("tableId_4")},
					}},
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResult)
}
Output:

func (*ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) Delete

Delete - Removes the database's vulnerability assessment rule baseline. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. ruleID - The vulnerability assessment rule ID. baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule). options - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		"<rule-id>",
		armsql.VulnerabilityAssessmentPolicyBaselineNameDefault,
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) Get

Get - Gets a database's vulnerability assessment rule baseline. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. ruleID - The vulnerability assessment rule ID. baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule). options - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		"<rule-id>",
		armsql.VulnerabilityAssessmentPolicyBaselineNameMaster,
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResult)
}
Output:

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions struct {
}

ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate method.

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse struct {
	ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate.

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResult added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResult struct {
	DatabaseVulnerabilityAssessmentRuleBaseline
}

ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResult contains the result from method ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate.

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions struct {
}

ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete method.

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete.

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions struct {
}

ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Get method.

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse struct {
	ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Get.

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResult added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResult struct {
	DatabaseVulnerabilityAssessmentRuleBaseline
}

ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResult contains the result from method ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Get.

type ManagedDatabaseVulnerabilityAssessmentScansClient

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

ManagedDatabaseVulnerabilityAssessmentScansClient contains the methods for the ManagedDatabaseVulnerabilityAssessmentScans group. Don't use this type directly, use NewManagedDatabaseVulnerabilityAssessmentScansClient() instead.

func NewManagedDatabaseVulnerabilityAssessmentScansClient

func NewManagedDatabaseVulnerabilityAssessmentScansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedDatabaseVulnerabilityAssessmentScansClient

NewManagedDatabaseVulnerabilityAssessmentScansClient creates a new instance of ManagedDatabaseVulnerabilityAssessmentScansClient with the specified values. subscriptionID - The 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 (*ManagedDatabaseVulnerabilityAssessmentScansClient) BeginInitiateScan

BeginInitiateScan - Executes a Vulnerability Assessment database scan. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. vulnerabilityAssessmentName - The name of the vulnerability assessment. scanID - The vulnerability assessment scan Id of the scan to retrieve. options - ManagedDatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.BeginInitiateScan method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScansExecute.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseVulnerabilityAssessmentScansClient("<subscription-id>", cred, nil)
	poller, err := client.BeginInitiateScan(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		"<scan-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedDatabaseVulnerabilityAssessmentScansClient) Export

Export - Convert an existing scan result to a human readable format. If already exists nothing happens If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the scanned database. vulnerabilityAssessmentName - The name of the vulnerability assessment. scanID - The vulnerability assessment scan Id. options - ManagedDatabaseVulnerabilityAssessmentScansClientExportOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.Export method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanExport.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseVulnerabilityAssessmentScansClient("<subscription-id>", cred, nil)
	res, err := client.Export(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		"<scan-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseVulnerabilityAssessmentScansClientExportResult)
}
Output:

func (*ManagedDatabaseVulnerabilityAssessmentScansClient) Get

Get - Gets a vulnerability assessment scan record of a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. vulnerabilityAssessmentName - The name of the vulnerability assessment. scanID - The vulnerability assessment scan Id of the scan to retrieve. options - ManagedDatabaseVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseVulnerabilityAssessmentScansClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		"<scan-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseVulnerabilityAssessmentScansClientGetResult)
}
Output:

func (*ManagedDatabaseVulnerabilityAssessmentScansClient) ListByDatabase

ListByDatabase - Lists the vulnerability assessment scans of a database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. vulnerabilityAssessmentName - The name of the vulnerability assessment. options - ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseVulnerabilityAssessmentScansClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedDatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions struct {
}

ManagedDatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.BeginInitiateScan method.

type ManagedDatabaseVulnerabilityAssessmentScansClientExportOptions added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentScansClientExportOptions struct {
}

ManagedDatabaseVulnerabilityAssessmentScansClientExportOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.Export method.

type ManagedDatabaseVulnerabilityAssessmentScansClientExportResponse added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentScansClientExportResponse struct {
	ManagedDatabaseVulnerabilityAssessmentScansClientExportResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseVulnerabilityAssessmentScansClientExportResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentScansClient.Export.

type ManagedDatabaseVulnerabilityAssessmentScansClientExportResult added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentScansClientExportResult struct {
	DatabaseVulnerabilityAssessmentScansExport
}

ManagedDatabaseVulnerabilityAssessmentScansClientExportResult contains the result from method ManagedDatabaseVulnerabilityAssessmentScansClient.Export.

type ManagedDatabaseVulnerabilityAssessmentScansClientGetOptions added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentScansClientGetOptions struct {
}

ManagedDatabaseVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.Get method.

type ManagedDatabaseVulnerabilityAssessmentScansClientGetResponse added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentScansClientGetResponse struct {
	ManagedDatabaseVulnerabilityAssessmentScansClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseVulnerabilityAssessmentScansClientGetResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentScansClient.Get.

type ManagedDatabaseVulnerabilityAssessmentScansClientGetResult added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentScansClientGetResult struct {
	VulnerabilityAssessmentScanRecord
}

ManagedDatabaseVulnerabilityAssessmentScansClientGetResult contains the result from method ManagedDatabaseVulnerabilityAssessmentScansClient.Get.

type ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanPoller added in v0.3.0

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

ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanPoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanResponse will be returned.

func (*ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanPoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanPollerResponse added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanPollerResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentScansClient.InitiateScan.

func (ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanPollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanPollerResponse from the provided client and resume token.

type ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanResponse added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentScansClient.InitiateScan.

type ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions struct {
}

ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.ListByDatabase method.

type ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabasePager added in v0.3.0

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

ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabasePager provides operations for iterating over paged responses.

func (*ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse page.

type ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse struct {
	ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentScansClient.ListByDatabase.

type ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResult added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResult struct {
	VulnerabilityAssessmentScanRecordListResult
}

ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResult contains the result from method ManagedDatabaseVulnerabilityAssessmentScansClient.ListByDatabase.

type ManagedDatabaseVulnerabilityAssessmentsClient

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

ManagedDatabaseVulnerabilityAssessmentsClient contains the methods for the ManagedDatabaseVulnerabilityAssessments group. Don't use this type directly, use NewManagedDatabaseVulnerabilityAssessmentsClient() instead.

func NewManagedDatabaseVulnerabilityAssessmentsClient

func NewManagedDatabaseVulnerabilityAssessmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedDatabaseVulnerabilityAssessmentsClient

NewManagedDatabaseVulnerabilityAssessmentsClient creates a new instance of ManagedDatabaseVulnerabilityAssessmentsClient with the specified values. subscriptionID - The 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 (*ManagedDatabaseVulnerabilityAssessmentsClient) CreateOrUpdate

CreateOrUpdate - Creates or updates the database's vulnerability assessment. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database for which the vulnerability assessment is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. parameters - The requested resource. options - ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentCreateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		armsql.DatabaseVulnerabilityAssessment{
			Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{
				RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{
					EmailSubscriptionAdmins: to.BoolPtr(true),
					Emails: []*string{
						to.StringPtr("email1@mail.com"),
						to.StringPtr("email2@mail.com")},
					IsEnabled: to.BoolPtr(true),
				},
				StorageContainerPath:   to.StringPtr("<storage-container-path>"),
				StorageContainerSasKey: to.StringPtr("<storage-container-sas-key>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResult)
}
Output:

func (*ManagedDatabaseVulnerabilityAssessmentsClient) Delete

Delete - Removes the database's vulnerability assessment. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database for which the vulnerability assessment is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. options - ManagedDatabaseVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedDatabaseVulnerabilityAssessmentsClient) Get

Get - Gets the database's vulnerability assessment. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database for which the vulnerability assessment is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. options - ManagedDatabaseVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.VulnerabilityAssessmentName("default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabaseVulnerabilityAssessmentsClientGetResult)
}
Output:

func (*ManagedDatabaseVulnerabilityAssessmentsClient) ListByDatabase

ListByDatabase - Lists the vulnerability assessments of a managed database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database for which the vulnerability assessment is defined. options - ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabaseVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions struct {
}

ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.CreateOrUpdate method.

type ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse struct {
	ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentsClient.CreateOrUpdate.

type ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResult added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResult struct {
	DatabaseVulnerabilityAssessment
}

ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResult contains the result from method ManagedDatabaseVulnerabilityAssessmentsClient.CreateOrUpdate.

type ManagedDatabaseVulnerabilityAssessmentsClientDeleteOptions added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentsClientDeleteOptions struct {
}

ManagedDatabaseVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.Delete method.

type ManagedDatabaseVulnerabilityAssessmentsClientDeleteResponse added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseVulnerabilityAssessmentsClientDeleteResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentsClient.Delete.

type ManagedDatabaseVulnerabilityAssessmentsClientGetOptions added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentsClientGetOptions struct {
}

ManagedDatabaseVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.Get method.

type ManagedDatabaseVulnerabilityAssessmentsClientGetResponse added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentsClientGetResponse struct {
	ManagedDatabaseVulnerabilityAssessmentsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseVulnerabilityAssessmentsClientGetResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentsClient.Get.

type ManagedDatabaseVulnerabilityAssessmentsClientGetResult added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentsClientGetResult struct {
	DatabaseVulnerabilityAssessment
}

ManagedDatabaseVulnerabilityAssessmentsClientGetResult contains the result from method ManagedDatabaseVulnerabilityAssessmentsClient.Get.

type ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseOptions added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseOptions struct {
}

ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.ListByDatabase method.

type ManagedDatabaseVulnerabilityAssessmentsClientListByDatabasePager added in v0.3.0

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

ManagedDatabaseVulnerabilityAssessmentsClientListByDatabasePager provides operations for iterating over paged responses.

func (*ManagedDatabaseVulnerabilityAssessmentsClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedDatabaseVulnerabilityAssessmentsClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedDatabaseVulnerabilityAssessmentsClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResponse page.

type ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResponse added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResponse struct {
	ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentsClient.ListByDatabase.

type ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResult added in v0.3.0

type ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResult struct {
	DatabaseVulnerabilityAssessmentListResult
}

ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResult contains the result from method ManagedDatabaseVulnerabilityAssessmentsClient.ListByDatabase.

type ManagedDatabasesClient

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

ManagedDatabasesClient contains the methods for the ManagedDatabases group. Don't use this type directly, use NewManagedDatabasesClient() instead.

func NewManagedDatabasesClient

func NewManagedDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedDatabasesClient

NewManagedDatabasesClient creates a new instance of ManagedDatabasesClient with the specified values. subscriptionID - The 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 (*ManagedDatabasesClient) BeginCompleteRestore

func (client *ManagedDatabasesClient) BeginCompleteRestore(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters CompleteDatabaseRestoreDefinition, options *ManagedDatabasesClientBeginCompleteRestoreOptions) (ManagedDatabasesClientCompleteRestorePollerResponse, error)

BeginCompleteRestore - Completes the restore operation on a managed database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. parameters - The definition for completing the restore of this managed database. options - ManagedDatabasesClientBeginCompleteRestoreOptions contains the optional parameters for the ManagedDatabasesClient.BeginCompleteRestore method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseCompleteExternalRestore.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCompleteRestore(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.CompleteDatabaseRestoreDefinition{
			LastBackupName: to.StringPtr("<last-backup-name>"),
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedDatabasesClient) BeginCreateOrUpdate

func (client *ManagedDatabasesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabase, options *ManagedDatabasesClientBeginCreateOrUpdateOptions) (ManagedDatabasesClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates a new database or updates an existing database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. parameters - The requested database resource state. options - ManagedDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedDatabasesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseCreateRestoreExternalBackup.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.ManagedDatabase{
			Location: to.StringPtr("<location>"),
			Properties: &armsql.ManagedDatabaseProperties{
				AutoCompleteRestore:      to.BoolPtr(true),
				Collation:                to.StringPtr("<collation>"),
				CreateMode:               armsql.ManagedDatabaseCreateMode("RestoreExternalBackup").ToPtr(),
				LastBackupName:           to.StringPtr("<last-backup-name>"),
				StorageContainerSasToken: to.StringPtr("<storage-container-sas-token>"),
				StorageContainerURI:      to.StringPtr("<storage-container-uri>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabasesClientCreateOrUpdateResult)
}
Output:

func (*ManagedDatabasesClient) BeginDelete

func (client *ManagedDatabasesClient) BeginDelete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabasesClientBeginDeleteOptions) (ManagedDatabasesClientDeletePollerResponse, error)

BeginDelete - Deletes a managed database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. options - ManagedDatabasesClientBeginDeleteOptions contains the optional parameters for the ManagedDatabasesClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedDatabasesClient) BeginUpdate

func (client *ManagedDatabasesClient) BeginUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseUpdate, options *ManagedDatabasesClientBeginUpdateOptions) (ManagedDatabasesClientUpdatePollerResponse, error)

BeginUpdate - Updates an existing database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. parameters - The requested database resource state. options - ManagedDatabasesClientBeginUpdateOptions contains the optional parameters for the ManagedDatabasesClient.BeginUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseUpdateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.ManagedDatabaseUpdate{
			Tags: map[string]*string{
				"tagKey1": to.StringPtr("TagValue1"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabasesClientUpdateResult)
}
Output:

func (*ManagedDatabasesClient) Get

func (client *ManagedDatabasesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabasesClientGetOptions) (ManagedDatabasesClientGetResponse, error)

Get - Gets a managed database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. options - ManagedDatabasesClientGetOptions contains the optional parameters for the ManagedDatabasesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabasesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedDatabasesClientGetResult)
}
Output:

func (*ManagedDatabasesClient) ListByInstance

func (client *ManagedDatabasesClient) ListByInstance(resourceGroupName string, managedInstanceName string, options *ManagedDatabasesClientListByInstanceOptions) *ManagedDatabasesClientListByInstancePager

ListByInstance - Gets a list of managed databases. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedDatabasesClientListByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.ListByInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseListByManagedInstance.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabasesClient("<subscription-id>", cred, nil)
	pager := client.ListByInstance("<resource-group-name>",
		"<managed-instance-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*ManagedDatabasesClient) ListInaccessibleByInstance

func (client *ManagedDatabasesClient) ListInaccessibleByInstance(resourceGroupName string, managedInstanceName string, options *ManagedDatabasesClientListInaccessibleByInstanceOptions) *ManagedDatabasesClientListInaccessibleByInstancePager

ListInaccessibleByInstance - Gets a list of inaccessible managed databases in a managed instance If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedDatabasesClientListInaccessibleByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.ListInaccessibleByInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InaccessibleManagedDatabaseListByManagedInstance.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedDatabasesClient("<subscription-id>", cred, nil)
	pager := client.ListInaccessibleByInstance("<resource-group-name>",
		"<managed-instance-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedDatabasesClientBeginCompleteRestoreOptions added in v0.3.0

type ManagedDatabasesClientBeginCompleteRestoreOptions struct {
}

ManagedDatabasesClientBeginCompleteRestoreOptions contains the optional parameters for the ManagedDatabasesClient.BeginCompleteRestore method.

type ManagedDatabasesClientBeginCreateOrUpdateOptions added in v0.3.0

type ManagedDatabasesClientBeginCreateOrUpdateOptions struct {
}

ManagedDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedDatabasesClient.BeginCreateOrUpdate method.

type ManagedDatabasesClientBeginDeleteOptions added in v0.3.0

type ManagedDatabasesClientBeginDeleteOptions struct {
}

ManagedDatabasesClientBeginDeleteOptions contains the optional parameters for the ManagedDatabasesClient.BeginDelete method.

type ManagedDatabasesClientBeginUpdateOptions added in v0.3.0

type ManagedDatabasesClientBeginUpdateOptions struct {
}

ManagedDatabasesClientBeginUpdateOptions contains the optional parameters for the ManagedDatabasesClient.BeginUpdate method.

type ManagedDatabasesClientCompleteRestorePoller added in v0.3.0

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

ManagedDatabasesClientCompleteRestorePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedDatabasesClientCompleteRestorePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedDatabasesClientCompleteRestorePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedDatabasesClientCompleteRestoreResponse will be returned.

func (*ManagedDatabasesClientCompleteRestorePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedDatabasesClientCompleteRestorePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedDatabasesClientCompleteRestorePollerResponse added in v0.3.0

type ManagedDatabasesClientCompleteRestorePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedDatabasesClientCompleteRestorePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabasesClientCompleteRestorePollerResponse contains the response from method ManagedDatabasesClient.CompleteRestore.

func (ManagedDatabasesClientCompleteRestorePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedDatabasesClientCompleteRestorePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedDatabasesClientCompleteRestorePollerResponse from the provided client and resume token.

type ManagedDatabasesClientCompleteRestoreResponse added in v0.3.0

type ManagedDatabasesClientCompleteRestoreResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabasesClientCompleteRestoreResponse contains the response from method ManagedDatabasesClient.CompleteRestore.

type ManagedDatabasesClientCreateOrUpdatePoller added in v0.3.0

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

ManagedDatabasesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedDatabasesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedDatabasesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedDatabasesClientCreateOrUpdateResponse will be returned.

func (*ManagedDatabasesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedDatabasesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedDatabasesClientCreateOrUpdatePollerResponse added in v0.3.0

type ManagedDatabasesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedDatabasesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabasesClientCreateOrUpdatePollerResponse contains the response from method ManagedDatabasesClient.CreateOrUpdate.

func (ManagedDatabasesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedDatabasesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedDatabasesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ManagedDatabasesClientCreateOrUpdateResponse added in v0.3.0

type ManagedDatabasesClientCreateOrUpdateResponse struct {
	ManagedDatabasesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabasesClientCreateOrUpdateResponse contains the response from method ManagedDatabasesClient.CreateOrUpdate.

type ManagedDatabasesClientCreateOrUpdateResult added in v0.3.0

type ManagedDatabasesClientCreateOrUpdateResult struct {
	ManagedDatabase
}

ManagedDatabasesClientCreateOrUpdateResult contains the result from method ManagedDatabasesClient.CreateOrUpdate.

type ManagedDatabasesClientDeletePoller added in v0.3.0

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

ManagedDatabasesClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedDatabasesClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedDatabasesClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedDatabasesClientDeleteResponse will be returned.

func (*ManagedDatabasesClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedDatabasesClientDeletePoller) ResumeToken added in v0.3.0

func (p *ManagedDatabasesClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedDatabasesClientDeletePollerResponse added in v0.3.0

type ManagedDatabasesClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedDatabasesClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabasesClientDeletePollerResponse contains the response from method ManagedDatabasesClient.Delete.

func (ManagedDatabasesClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedDatabasesClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedDatabasesClientDeletePollerResponse from the provided client and resume token.

type ManagedDatabasesClientDeleteResponse added in v0.3.0

type ManagedDatabasesClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabasesClientDeleteResponse contains the response from method ManagedDatabasesClient.Delete.

type ManagedDatabasesClientGetOptions added in v0.3.0

type ManagedDatabasesClientGetOptions struct {
}

ManagedDatabasesClientGetOptions contains the optional parameters for the ManagedDatabasesClient.Get method.

type ManagedDatabasesClientGetResponse added in v0.3.0

type ManagedDatabasesClientGetResponse struct {
	ManagedDatabasesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabasesClientGetResponse contains the response from method ManagedDatabasesClient.Get.

type ManagedDatabasesClientGetResult added in v0.3.0

type ManagedDatabasesClientGetResult struct {
	ManagedDatabase
}

ManagedDatabasesClientGetResult contains the result from method ManagedDatabasesClient.Get.

type ManagedDatabasesClientListByInstanceOptions added in v0.3.0

type ManagedDatabasesClientListByInstanceOptions struct {
}

ManagedDatabasesClientListByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.ListByInstance method.

type ManagedDatabasesClientListByInstancePager added in v0.3.0

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

ManagedDatabasesClientListByInstancePager provides operations for iterating over paged responses.

func (*ManagedDatabasesClientListByInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedDatabasesClientListByInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedDatabasesClientListByInstancePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedDatabasesClientListByInstanceResponse page.

type ManagedDatabasesClientListByInstanceResponse added in v0.3.0

type ManagedDatabasesClientListByInstanceResponse struct {
	ManagedDatabasesClientListByInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabasesClientListByInstanceResponse contains the response from method ManagedDatabasesClient.ListByInstance.

type ManagedDatabasesClientListByInstanceResult added in v0.3.0

type ManagedDatabasesClientListByInstanceResult struct {
	ManagedDatabaseListResult
}

ManagedDatabasesClientListByInstanceResult contains the result from method ManagedDatabasesClient.ListByInstance.

type ManagedDatabasesClientListInaccessibleByInstanceOptions added in v0.3.0

type ManagedDatabasesClientListInaccessibleByInstanceOptions struct {
}

ManagedDatabasesClientListInaccessibleByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.ListInaccessibleByInstance method.

type ManagedDatabasesClientListInaccessibleByInstancePager added in v0.3.0

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

ManagedDatabasesClientListInaccessibleByInstancePager provides operations for iterating over paged responses.

func (*ManagedDatabasesClientListInaccessibleByInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedDatabasesClientListInaccessibleByInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedDatabasesClientListInaccessibleByInstancePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedDatabasesClientListInaccessibleByInstanceResponse page.

type ManagedDatabasesClientListInaccessibleByInstanceResponse added in v0.3.0

type ManagedDatabasesClientListInaccessibleByInstanceResponse struct {
	ManagedDatabasesClientListInaccessibleByInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabasesClientListInaccessibleByInstanceResponse contains the response from method ManagedDatabasesClient.ListInaccessibleByInstance.

type ManagedDatabasesClientListInaccessibleByInstanceResult added in v0.3.0

type ManagedDatabasesClientListInaccessibleByInstanceResult struct {
	ManagedDatabaseListResult
}

ManagedDatabasesClientListInaccessibleByInstanceResult contains the result from method ManagedDatabasesClient.ListInaccessibleByInstance.

type ManagedDatabasesClientUpdatePoller added in v0.3.0

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

ManagedDatabasesClientUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedDatabasesClientUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedDatabasesClientUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedDatabasesClientUpdateResponse will be returned.

func (*ManagedDatabasesClientUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedDatabasesClientUpdatePoller) ResumeToken added in v0.3.0

func (p *ManagedDatabasesClientUpdatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedDatabasesClientUpdatePollerResponse added in v0.3.0

type ManagedDatabasesClientUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedDatabasesClientUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabasesClientUpdatePollerResponse contains the response from method ManagedDatabasesClient.Update.

func (ManagedDatabasesClientUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedDatabasesClientUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedDatabasesClientUpdatePollerResponse from the provided client and resume token.

type ManagedDatabasesClientUpdateResponse added in v0.3.0

type ManagedDatabasesClientUpdateResponse struct {
	ManagedDatabasesClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedDatabasesClientUpdateResponse contains the response from method ManagedDatabasesClient.Update.

type ManagedDatabasesClientUpdateResult added in v0.3.0

type ManagedDatabasesClientUpdateResult struct {
	ManagedDatabase
}

ManagedDatabasesClientUpdateResult contains the result from method ManagedDatabasesClient.Update.

type ManagedInstance

type ManagedInstance struct {
	// REQUIRED; Resource location.
	Location *string `json:"location,omitempty"`

	// The Azure Active Directory identity of the managed instance.
	Identity *ResourceIdentity `json:"identity,omitempty"`

	// Resource properties.
	Properties *ManagedInstanceProperties `json:"properties,omitempty"`

	// Managed instance SKU. Allowed values for sku.name: GPGen4, GPGen5, BCGen4, BCGen5
	SKU *SKU `json:"sku,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedInstance - An Azure SQL managed instance.

func (ManagedInstance) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstance.

type ManagedInstanceAdministrator

type ManagedInstanceAdministrator struct {
	// Resource properties.
	Properties *ManagedInstanceAdministratorProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedInstanceAdministrator - An Azure SQL managed instance administrator.

type ManagedInstanceAdministratorListResult

type ManagedInstanceAdministratorListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedInstanceAdministrator `json:"value,omitempty" azure:"ro"`
}

ManagedInstanceAdministratorListResult - A list of managed instance administrators.

func (ManagedInstanceAdministratorListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdministratorListResult.

type ManagedInstanceAdministratorProperties

type ManagedInstanceAdministratorProperties struct {
	// REQUIRED; Type of the managed instance administrator.
	AdministratorType *ManagedInstanceAdministratorType `json:"administratorType,omitempty"`

	// REQUIRED; Login name of the managed instance administrator.
	Login *string `json:"login,omitempty"`

	// REQUIRED; SID (object ID) of the managed instance administrator.
	Sid *string `json:"sid,omitempty"`

	// Tenant ID of the managed instance administrator.
	TenantID *string `json:"tenantId,omitempty"`
}

ManagedInstanceAdministratorProperties - The properties of a managed instance administrator.

type ManagedInstanceAdministratorType

type ManagedInstanceAdministratorType string

ManagedInstanceAdministratorType - Type of the managed instance administrator.

const (
	ManagedInstanceAdministratorTypeActiveDirectory ManagedInstanceAdministratorType = "ActiveDirectory"
)

func PossibleManagedInstanceAdministratorTypeValues

func PossibleManagedInstanceAdministratorTypeValues() []ManagedInstanceAdministratorType

PossibleManagedInstanceAdministratorTypeValues returns the possible values for the ManagedInstanceAdministratorType const type.

func (ManagedInstanceAdministratorType) ToPtr

ToPtr returns a *ManagedInstanceAdministratorType pointing to the current value.

type ManagedInstanceAdministratorsClient

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

ManagedInstanceAdministratorsClient contains the methods for the ManagedInstanceAdministrators group. Don't use this type directly, use NewManagedInstanceAdministratorsClient() instead.

func NewManagedInstanceAdministratorsClient

func NewManagedInstanceAdministratorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedInstanceAdministratorsClient

NewManagedInstanceAdministratorsClient creates a new instance of ManagedInstanceAdministratorsClient with the specified values. subscriptionID - The 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 (*ManagedInstanceAdministratorsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates a managed instance administrator. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. parameters - The requested administrator parameters. options - ManagedInstanceAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorCreate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceAdministratorsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.AdministratorName("ActiveDirectory"),
		armsql.ManagedInstanceAdministrator{
			Properties: &armsql.ManagedInstanceAdministratorProperties{
				AdministratorType: armsql.ManagedInstanceAdministratorType("ActiveDirectory").ToPtr(),
				Login:             to.StringPtr("<login>"),
				Sid:               to.StringPtr("<sid>"),
				TenantID:          to.StringPtr("<tenant-id>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstanceAdministratorsClientCreateOrUpdateResult)
}
Output:

func (*ManagedInstanceAdministratorsClient) BeginDelete

BeginDelete - Deletes a managed instance administrator. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstanceAdministratorsClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceAdministratorsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.AdministratorName("ActiveDirectory"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedInstanceAdministratorsClient) Get

Get - Gets a managed instance administrator. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstanceAdministratorsClientGetOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceAdministratorsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.AdministratorName("ActiveDirectory"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstanceAdministratorsClientGetResult)
}
Output:

func (*ManagedInstanceAdministratorsClient) ListByInstance

ListByInstance - Gets a list of managed instance administrators. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstanceAdministratorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.ListByInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorListByInstance.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceAdministratorsClient("<subscription-id>", cred, nil)
	pager := client.ListByInstance("<resource-group-name>",
		"<managed-instance-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedInstanceAdministratorsClientBeginCreateOrUpdateOptions added in v0.3.0

type ManagedInstanceAdministratorsClientBeginCreateOrUpdateOptions struct {
}

ManagedInstanceAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.BeginCreateOrUpdate method.

type ManagedInstanceAdministratorsClientBeginDeleteOptions added in v0.3.0

type ManagedInstanceAdministratorsClientBeginDeleteOptions struct {
}

ManagedInstanceAdministratorsClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.BeginDelete method.

type ManagedInstanceAdministratorsClientCreateOrUpdatePoller added in v0.3.0

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

ManagedInstanceAdministratorsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstanceAdministratorsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstanceAdministratorsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstanceAdministratorsClientCreateOrUpdateResponse will be returned.

func (*ManagedInstanceAdministratorsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstanceAdministratorsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstanceAdministratorsClientCreateOrUpdatePollerResponse added in v0.3.0

type ManagedInstanceAdministratorsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstanceAdministratorsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceAdministratorsClientCreateOrUpdatePollerResponse contains the response from method ManagedInstanceAdministratorsClient.CreateOrUpdate.

func (ManagedInstanceAdministratorsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstanceAdministratorsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstanceAdministratorsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ManagedInstanceAdministratorsClientCreateOrUpdateResponse added in v0.3.0

type ManagedInstanceAdministratorsClientCreateOrUpdateResponse struct {
	ManagedInstanceAdministratorsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceAdministratorsClientCreateOrUpdateResponse contains the response from method ManagedInstanceAdministratorsClient.CreateOrUpdate.

type ManagedInstanceAdministratorsClientCreateOrUpdateResult added in v0.3.0

type ManagedInstanceAdministratorsClientCreateOrUpdateResult struct {
	ManagedInstanceAdministrator
}

ManagedInstanceAdministratorsClientCreateOrUpdateResult contains the result from method ManagedInstanceAdministratorsClient.CreateOrUpdate.

type ManagedInstanceAdministratorsClientDeletePoller added in v0.3.0

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

ManagedInstanceAdministratorsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstanceAdministratorsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstanceAdministratorsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstanceAdministratorsClientDeleteResponse will be returned.

func (*ManagedInstanceAdministratorsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstanceAdministratorsClientDeletePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstanceAdministratorsClientDeletePollerResponse added in v0.3.0

type ManagedInstanceAdministratorsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstanceAdministratorsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceAdministratorsClientDeletePollerResponse contains the response from method ManagedInstanceAdministratorsClient.Delete.

func (ManagedInstanceAdministratorsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstanceAdministratorsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstanceAdministratorsClientDeletePollerResponse from the provided client and resume token.

type ManagedInstanceAdministratorsClientDeleteResponse added in v0.3.0

type ManagedInstanceAdministratorsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceAdministratorsClientDeleteResponse contains the response from method ManagedInstanceAdministratorsClient.Delete.

type ManagedInstanceAdministratorsClientGetOptions added in v0.3.0

type ManagedInstanceAdministratorsClientGetOptions struct {
}

ManagedInstanceAdministratorsClientGetOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.Get method.

type ManagedInstanceAdministratorsClientGetResponse added in v0.3.0

type ManagedInstanceAdministratorsClientGetResponse struct {
	ManagedInstanceAdministratorsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceAdministratorsClientGetResponse contains the response from method ManagedInstanceAdministratorsClient.Get.

type ManagedInstanceAdministratorsClientGetResult added in v0.3.0

type ManagedInstanceAdministratorsClientGetResult struct {
	ManagedInstanceAdministrator
}

ManagedInstanceAdministratorsClientGetResult contains the result from method ManagedInstanceAdministratorsClient.Get.

type ManagedInstanceAdministratorsClientListByInstanceOptions added in v0.3.0

type ManagedInstanceAdministratorsClientListByInstanceOptions struct {
}

ManagedInstanceAdministratorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.ListByInstance method.

type ManagedInstanceAdministratorsClientListByInstancePager added in v0.3.0

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

ManagedInstanceAdministratorsClientListByInstancePager provides operations for iterating over paged responses.

func (*ManagedInstanceAdministratorsClientListByInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedInstanceAdministratorsClientListByInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedInstanceAdministratorsClientListByInstancePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedInstanceAdministratorsClientListByInstanceResponse page.

type ManagedInstanceAdministratorsClientListByInstanceResponse added in v0.3.0

type ManagedInstanceAdministratorsClientListByInstanceResponse struct {
	ManagedInstanceAdministratorsClientListByInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceAdministratorsClientListByInstanceResponse contains the response from method ManagedInstanceAdministratorsClient.ListByInstance.

type ManagedInstanceAdministratorsClientListByInstanceResult added in v0.3.0

type ManagedInstanceAdministratorsClientListByInstanceResult struct {
	ManagedInstanceAdministratorListResult
}

ManagedInstanceAdministratorsClientListByInstanceResult contains the result from method ManagedInstanceAdministratorsClient.ListByInstance.

type ManagedInstanceAzureADOnlyAuthListResult

type ManagedInstanceAzureADOnlyAuthListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedInstanceAzureADOnlyAuthentication `json:"value,omitempty" azure:"ro"`
}

ManagedInstanceAzureADOnlyAuthListResult - A list of active directory only authentications.

func (ManagedInstanceAzureADOnlyAuthListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAzureADOnlyAuthListResult.

type ManagedInstanceAzureADOnlyAuthProperties

type ManagedInstanceAzureADOnlyAuthProperties struct {
	// REQUIRED; Azure Active Directory only Authentication enabled.
	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`
}

ManagedInstanceAzureADOnlyAuthProperties - Properties of a active directory only authentication for Managed Instance.

type ManagedInstanceAzureADOnlyAuthentication

type ManagedInstanceAzureADOnlyAuthentication struct {
	// Resource properties.
	Properties *ManagedInstanceAzureADOnlyAuthProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedInstanceAzureADOnlyAuthentication - Azure Active Directory only authentication.

type ManagedInstanceAzureADOnlyAuthenticationsClient

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

ManagedInstanceAzureADOnlyAuthenticationsClient contains the methods for the ManagedInstanceAzureADOnlyAuthentications group. Don't use this type directly, use NewManagedInstanceAzureADOnlyAuthenticationsClient() instead.

func NewManagedInstanceAzureADOnlyAuthenticationsClient

func NewManagedInstanceAzureADOnlyAuthenticationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedInstanceAzureADOnlyAuthenticationsClient

NewManagedInstanceAzureADOnlyAuthenticationsClient creates a new instance of ManagedInstanceAzureADOnlyAuthenticationsClient with the specified values. subscriptionID - The 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 (*ManagedInstanceAzureADOnlyAuthenticationsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Sets Server Active Directory only authentication property or updates an existing server Active Directory only authentication property. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. authenticationName - The name of server azure active directory only authentication. parameters - The required parameters for creating or updating an Active Directory only authentication property. options - ManagedInstanceAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthCreateOrUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceAzureADOnlyAuthenticationsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.AuthenticationName("Default"),
		armsql.ManagedInstanceAzureADOnlyAuthentication{
			Properties: &armsql.ManagedInstanceAzureADOnlyAuthProperties{
				AzureADOnlyAuthentication: to.BoolPtr(false),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResult)
}
Output:

func (*ManagedInstanceAzureADOnlyAuthenticationsClient) BeginDelete

BeginDelete - Deletes an existing server Active Directory only authentication property. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. authenticationName - The name of server azure active directory only authentication. options - ManagedInstanceAzureADOnlyAuthenticationsClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceAzureADOnlyAuthenticationsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.AuthenticationName("Default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedInstanceAzureADOnlyAuthenticationsClient) Get

Get - Gets a specific Azure Active Directory only authentication property. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. authenticationName - The name of server azure active directory only authentication. options - ManagedInstanceAzureADOnlyAuthenticationsClientGetOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceAzureADOnlyAuthenticationsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.AuthenticationName("Default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstanceAzureADOnlyAuthenticationsClientGetResult)
}
Output:

func (*ManagedInstanceAzureADOnlyAuthenticationsClient) ListByInstance

ListByInstance - Gets a list of server Azure Active Directory only authentications. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.ListByInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthListByInstance.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceAzureADOnlyAuthenticationsClient("<subscription-id>", cred, nil)
	pager := client.ListByInstance("<resource-group-name>",
		"<managed-instance-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedInstanceAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions added in v0.3.0

type ManagedInstanceAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions struct {
}

ManagedInstanceAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate method.

type ManagedInstanceAzureADOnlyAuthenticationsClientBeginDeleteOptions added in v0.3.0

type ManagedInstanceAzureADOnlyAuthenticationsClientBeginDeleteOptions struct {
}

ManagedInstanceAzureADOnlyAuthenticationsClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.BeginDelete method.

type ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdatePoller added in v0.3.0

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

ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResponse will be returned.

func (*ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdatePollerResponse added in v0.3.0

type ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdatePollerResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.CreateOrUpdate.

func (ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResponse added in v0.3.0

type ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResponse struct {
	ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.CreateOrUpdate.

type ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResult added in v0.3.0

type ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResult struct {
	ManagedInstanceAzureADOnlyAuthentication
}

ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResult contains the result from method ManagedInstanceAzureADOnlyAuthenticationsClient.CreateOrUpdate.

type ManagedInstanceAzureADOnlyAuthenticationsClientDeletePoller added in v0.3.0

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

ManagedInstanceAzureADOnlyAuthenticationsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstanceAzureADOnlyAuthenticationsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstanceAzureADOnlyAuthenticationsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstanceAzureADOnlyAuthenticationsClientDeleteResponse will be returned.

func (*ManagedInstanceAzureADOnlyAuthenticationsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstanceAzureADOnlyAuthenticationsClientDeletePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstanceAzureADOnlyAuthenticationsClientDeletePollerResponse added in v0.3.0

type ManagedInstanceAzureADOnlyAuthenticationsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstanceAzureADOnlyAuthenticationsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceAzureADOnlyAuthenticationsClientDeletePollerResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.Delete.

func (ManagedInstanceAzureADOnlyAuthenticationsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstanceAzureADOnlyAuthenticationsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstanceAzureADOnlyAuthenticationsClientDeletePollerResponse from the provided client and resume token.

type ManagedInstanceAzureADOnlyAuthenticationsClientDeleteResponse added in v0.3.0

type ManagedInstanceAzureADOnlyAuthenticationsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceAzureADOnlyAuthenticationsClientDeleteResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.Delete.

type ManagedInstanceAzureADOnlyAuthenticationsClientGetOptions added in v0.3.0

type ManagedInstanceAzureADOnlyAuthenticationsClientGetOptions struct {
}

ManagedInstanceAzureADOnlyAuthenticationsClientGetOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.Get method.

type ManagedInstanceAzureADOnlyAuthenticationsClientGetResponse added in v0.3.0

type ManagedInstanceAzureADOnlyAuthenticationsClientGetResponse struct {
	ManagedInstanceAzureADOnlyAuthenticationsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceAzureADOnlyAuthenticationsClientGetResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.Get.

type ManagedInstanceAzureADOnlyAuthenticationsClientGetResult added in v0.3.0

type ManagedInstanceAzureADOnlyAuthenticationsClientGetResult struct {
	ManagedInstanceAzureADOnlyAuthentication
}

ManagedInstanceAzureADOnlyAuthenticationsClientGetResult contains the result from method ManagedInstanceAzureADOnlyAuthenticationsClient.Get.

type ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceOptions added in v0.3.0

type ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceOptions struct {
}

ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.ListByInstance method.

type ManagedInstanceAzureADOnlyAuthenticationsClientListByInstancePager added in v0.3.0

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

ManagedInstanceAzureADOnlyAuthenticationsClientListByInstancePager provides operations for iterating over paged responses.

func (*ManagedInstanceAzureADOnlyAuthenticationsClientListByInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedInstanceAzureADOnlyAuthenticationsClientListByInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedInstanceAzureADOnlyAuthenticationsClientListByInstancePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResponse page.

type ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResponse added in v0.3.0

type ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResponse struct {
	ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.ListByInstance.

type ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResult added in v0.3.0

type ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResult struct {
	ManagedInstanceAzureADOnlyAuthListResult
}

ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResult contains the result from method ManagedInstanceAzureADOnlyAuthenticationsClient.ListByInstance.

type ManagedInstanceEditionCapability

type ManagedInstanceEditionCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; The managed server version name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; The supported families.
	SupportedFamilies []*ManagedInstanceFamilyCapability `json:"supportedFamilies,omitempty" azure:"ro"`

	// READ-ONLY; The list of supported storage capabilities for this edition
	SupportedStorageCapabilities []*StorageCapability `json:"supportedStorageCapabilities,omitempty" azure:"ro"`

	// READ-ONLY; Whether or not zone redundancy is supported for the edition.
	ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"`
}

ManagedInstanceEditionCapability - The managed server capability

func (ManagedInstanceEditionCapability) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEditionCapability.

type ManagedInstanceEncryptionProtector

type ManagedInstanceEncryptionProtector struct {
	// Resource properties.
	Properties *ManagedInstanceEncryptionProtectorProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
	Kind *string `json:"kind,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedInstanceEncryptionProtector - The managed instance encryption protector.

type ManagedInstanceEncryptionProtectorListResult

type ManagedInstanceEncryptionProtectorListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedInstanceEncryptionProtector `json:"value,omitempty" azure:"ro"`
}

ManagedInstanceEncryptionProtectorListResult - A list of managed instance encryption protectors.

func (ManagedInstanceEncryptionProtectorListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEncryptionProtectorListResult.

type ManagedInstanceEncryptionProtectorProperties

type ManagedInstanceEncryptionProtectorProperties struct {
	// REQUIRED; The encryption protector type like 'ServiceManaged', 'AzureKeyVault'.
	ServerKeyType *ServerKeyType `json:"serverKeyType,omitempty"`

	// Key auto rotation opt-in flag. Either true or false.
	AutoRotationEnabled *bool `json:"autoRotationEnabled,omitempty"`

	// The name of the managed instance key.
	ServerKeyName *string `json:"serverKeyName,omitempty"`

	// READ-ONLY; Thumbprint of the server key.
	Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"`

	// READ-ONLY; The URI of the server key.
	URI *string `json:"uri,omitempty" azure:"ro"`
}

ManagedInstanceEncryptionProtectorProperties - Properties for an encryption protector execution.

type ManagedInstanceEncryptionProtectorsClient

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

ManagedInstanceEncryptionProtectorsClient contains the methods for the ManagedInstanceEncryptionProtectors group. Don't use this type directly, use NewManagedInstanceEncryptionProtectorsClient() instead.

func NewManagedInstanceEncryptionProtectorsClient

func NewManagedInstanceEncryptionProtectorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedInstanceEncryptionProtectorsClient

NewManagedInstanceEncryptionProtectorsClient creates a new instance of ManagedInstanceEncryptionProtectorsClient with the specified values. subscriptionID - The 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 (*ManagedInstanceEncryptionProtectorsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Updates an existing encryption protector. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. encryptionProtectorName - The name of the encryption protector to be updated. parameters - The requested encryption protector resource state. options - ManagedInstanceEncryptionProtectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateKeyVault.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceEncryptionProtectorsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.EncryptionProtectorName("current"),
		armsql.ManagedInstanceEncryptionProtector{
			Properties: &armsql.ManagedInstanceEncryptionProtectorProperties{
				AutoRotationEnabled: to.BoolPtr(false),
				ServerKeyName:       to.StringPtr("<server-key-name>"),
				ServerKeyType:       armsql.ServerKeyType("AzureKeyVault").ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResult)
}
Output:

func (*ManagedInstanceEncryptionProtectorsClient) BeginRevalidate

BeginRevalidate - Revalidates an existing encryption protector. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. encryptionProtectorName - The name of the encryption protector to be updated. options - ManagedInstanceEncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.BeginRevalidate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorRevalidate.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceEncryptionProtectorsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginRevalidate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.EncryptionProtectorName("current"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedInstanceEncryptionProtectorsClient) Get

Get - Gets a managed instance encryption protector. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. encryptionProtectorName - The name of the encryption protector to be retrieved. options - ManagedInstanceEncryptionProtectorsClientGetOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceEncryptionProtectorsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.EncryptionProtectorName("current"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstanceEncryptionProtectorsClientGetResult)
}
Output:

func (*ManagedInstanceEncryptionProtectorsClient) ListByInstance

ListByInstance - Gets a list of managed instance encryption protectors If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstanceEncryptionProtectorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.ListByInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceEncryptionProtectorsClient("<subscription-id>", cred, nil)
	pager := client.ListByInstance("<resource-group-name>",
		"<managed-instance-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedInstanceEncryptionProtectorsClientBeginCreateOrUpdateOptions added in v0.3.0

type ManagedInstanceEncryptionProtectorsClientBeginCreateOrUpdateOptions struct {
}

ManagedInstanceEncryptionProtectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.BeginCreateOrUpdate method.

type ManagedInstanceEncryptionProtectorsClientBeginRevalidateOptions added in v0.3.0

type ManagedInstanceEncryptionProtectorsClientBeginRevalidateOptions struct {
}

ManagedInstanceEncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.BeginRevalidate method.

type ManagedInstanceEncryptionProtectorsClientCreateOrUpdatePoller added in v0.3.0

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

ManagedInstanceEncryptionProtectorsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstanceEncryptionProtectorsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstanceEncryptionProtectorsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResponse will be returned.

func (*ManagedInstanceEncryptionProtectorsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstanceEncryptionProtectorsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstanceEncryptionProtectorsClientCreateOrUpdatePollerResponse added in v0.3.0

type ManagedInstanceEncryptionProtectorsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstanceEncryptionProtectorsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceEncryptionProtectorsClientCreateOrUpdatePollerResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.CreateOrUpdate.

func (ManagedInstanceEncryptionProtectorsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstanceEncryptionProtectorsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstanceEncryptionProtectorsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResponse added in v0.3.0

type ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResponse struct {
	ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.CreateOrUpdate.

type ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResult added in v0.3.0

type ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResult struct {
	ManagedInstanceEncryptionProtector
}

ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResult contains the result from method ManagedInstanceEncryptionProtectorsClient.CreateOrUpdate.

type ManagedInstanceEncryptionProtectorsClientGetOptions added in v0.3.0

type ManagedInstanceEncryptionProtectorsClientGetOptions struct {
}

ManagedInstanceEncryptionProtectorsClientGetOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.Get method.

type ManagedInstanceEncryptionProtectorsClientGetResponse added in v0.3.0

type ManagedInstanceEncryptionProtectorsClientGetResponse struct {
	ManagedInstanceEncryptionProtectorsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceEncryptionProtectorsClientGetResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.Get.

type ManagedInstanceEncryptionProtectorsClientGetResult added in v0.3.0

type ManagedInstanceEncryptionProtectorsClientGetResult struct {
	ManagedInstanceEncryptionProtector
}

ManagedInstanceEncryptionProtectorsClientGetResult contains the result from method ManagedInstanceEncryptionProtectorsClient.Get.

type ManagedInstanceEncryptionProtectorsClientListByInstanceOptions added in v0.3.0

type ManagedInstanceEncryptionProtectorsClientListByInstanceOptions struct {
}

ManagedInstanceEncryptionProtectorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.ListByInstance method.

type ManagedInstanceEncryptionProtectorsClientListByInstancePager added in v0.3.0

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

ManagedInstanceEncryptionProtectorsClientListByInstancePager provides operations for iterating over paged responses.

func (*ManagedInstanceEncryptionProtectorsClientListByInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedInstanceEncryptionProtectorsClientListByInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedInstanceEncryptionProtectorsClientListByInstancePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedInstanceEncryptionProtectorsClientListByInstanceResponse page.

type ManagedInstanceEncryptionProtectorsClientListByInstanceResponse added in v0.3.0

type ManagedInstanceEncryptionProtectorsClientListByInstanceResponse struct {
	ManagedInstanceEncryptionProtectorsClientListByInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceEncryptionProtectorsClientListByInstanceResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.ListByInstance.

type ManagedInstanceEncryptionProtectorsClientListByInstanceResult added in v0.3.0

type ManagedInstanceEncryptionProtectorsClientListByInstanceResult struct {
	ManagedInstanceEncryptionProtectorListResult
}

ManagedInstanceEncryptionProtectorsClientListByInstanceResult contains the result from method ManagedInstanceEncryptionProtectorsClient.ListByInstance.

type ManagedInstanceEncryptionProtectorsClientRevalidatePoller added in v0.3.0

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

ManagedInstanceEncryptionProtectorsClientRevalidatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstanceEncryptionProtectorsClientRevalidatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstanceEncryptionProtectorsClientRevalidatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstanceEncryptionProtectorsClientRevalidateResponse will be returned.

func (*ManagedInstanceEncryptionProtectorsClientRevalidatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstanceEncryptionProtectorsClientRevalidatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstanceEncryptionProtectorsClientRevalidatePollerResponse added in v0.3.0

type ManagedInstanceEncryptionProtectorsClientRevalidatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstanceEncryptionProtectorsClientRevalidatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceEncryptionProtectorsClientRevalidatePollerResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.Revalidate.

func (ManagedInstanceEncryptionProtectorsClientRevalidatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstanceEncryptionProtectorsClientRevalidatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstanceEncryptionProtectorsClientRevalidatePollerResponse from the provided client and resume token.

type ManagedInstanceEncryptionProtectorsClientRevalidateResponse added in v0.3.0

type ManagedInstanceEncryptionProtectorsClientRevalidateResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceEncryptionProtectorsClientRevalidateResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.Revalidate.

type ManagedInstanceExternalAdministrator

type ManagedInstanceExternalAdministrator struct {
	// Type of the sever administrator.
	AdministratorType *AdministratorType `json:"administratorType,omitempty"`

	// Azure Active Directory only Authentication enabled.
	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`

	// Login name of the server administrator.
	Login *string `json:"login,omitempty"`

	// Principal Type of the sever administrator.
	PrincipalType *PrincipalType `json:"principalType,omitempty"`

	// SID (object ID) of the server administrator.
	Sid *string `json:"sid,omitempty"`

	// Tenant ID of the administrator.
	TenantID *string `json:"tenantId,omitempty"`
}

ManagedInstanceExternalAdministrator - Properties of a active directory administrator.

type ManagedInstanceFamilyCapability

type ManagedInstanceFamilyCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; Family name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; SKU name.
	SKU *string `json:"sku,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; List of supported license types.
	SupportedLicenseTypes []*LicenseTypeCapability `json:"supportedLicenseTypes,omitempty" azure:"ro"`

	// READ-ONLY; List of supported virtual cores values.
	SupportedVcoresValues []*ManagedInstanceVcoresCapability `json:"supportedVcoresValues,omitempty" azure:"ro"`
}

ManagedInstanceFamilyCapability - The managed server family capability.

func (ManagedInstanceFamilyCapability) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceFamilyCapability.

type ManagedInstanceKey

type ManagedInstanceKey struct {
	// Resource properties.
	Properties *ManagedInstanceKeyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
	Kind *string `json:"kind,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedInstanceKey - A managed instance key.

type ManagedInstanceKeyListResult

type ManagedInstanceKeyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedInstanceKey `json:"value,omitempty" azure:"ro"`
}

ManagedInstanceKeyListResult - A list of managed instance keys.

func (ManagedInstanceKeyListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceKeyListResult.

type ManagedInstanceKeyProperties

type ManagedInstanceKeyProperties struct {
	// REQUIRED; The key type like 'ServiceManaged', 'AzureKeyVault'.
	ServerKeyType *ServerKeyType `json:"serverKeyType,omitempty"`

	// The URI of the key. If the ServerKeyType is AzureKeyVault, then the URI is required.
	URI *string `json:"uri,omitempty"`

	// READ-ONLY; Key auto rotation opt-in flag. Either true or false.
	AutoRotationEnabled *bool `json:"autoRotationEnabled,omitempty" azure:"ro"`

	// READ-ONLY; The key creation date.
	CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"`

	// READ-ONLY; Thumbprint of the key.
	Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"`
}

ManagedInstanceKeyProperties - Properties for a key execution.

func (ManagedInstanceKeyProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceKeyProperties.

func (*ManagedInstanceKeyProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceKeyProperties.

type ManagedInstanceKeysClient

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

ManagedInstanceKeysClient contains the methods for the ManagedInstanceKeys group. Don't use this type directly, use NewManagedInstanceKeysClient() instead.

func NewManagedInstanceKeysClient

func NewManagedInstanceKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedInstanceKeysClient

NewManagedInstanceKeysClient creates a new instance of ManagedInstanceKeysClient with the specified values. subscriptionID - The 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 (*ManagedInstanceKeysClient) BeginCreateOrUpdate

func (client *ManagedInstanceKeysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, parameters ManagedInstanceKey, options *ManagedInstanceKeysClientBeginCreateOrUpdateOptions) (ManagedInstanceKeysClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates a managed instance key. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. keyName - The name of the managed instance key to be operated on (updated or created). parameters - The requested managed instance key resource state. options - ManagedInstanceKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceKeysClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyCreateOrUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceKeysClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<key-name>",
		armsql.ManagedInstanceKey{
			Properties: &armsql.ManagedInstanceKeyProperties{
				ServerKeyType: armsql.ServerKeyType("AzureKeyVault").ToPtr(),
				URI:           to.StringPtr("<uri>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstanceKeysClientCreateOrUpdateResult)
}
Output:

func (*ManagedInstanceKeysClient) BeginDelete

func (client *ManagedInstanceKeysClient) BeginDelete(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, options *ManagedInstanceKeysClientBeginDeleteOptions) (ManagedInstanceKeysClientDeletePollerResponse, error)

BeginDelete - Deletes the managed instance key with the given name. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. keyName - The name of the managed instance key to be deleted. options - ManagedInstanceKeysClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceKeysClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceKeysClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<key-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedInstanceKeysClient) Get

func (client *ManagedInstanceKeysClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, options *ManagedInstanceKeysClientGetOptions) (ManagedInstanceKeysClientGetResponse, error)

Get - Gets a managed instance key. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. keyName - The name of the managed instance key to be retrieved. options - ManagedInstanceKeysClientGetOptions contains the optional parameters for the ManagedInstanceKeysClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceKeysClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<key-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstanceKeysClientGetResult)
}
Output:

func (*ManagedInstanceKeysClient) ListByInstance

func (client *ManagedInstanceKeysClient) ListByInstance(resourceGroupName string, managedInstanceName string, options *ManagedInstanceKeysClientListByInstanceOptions) *ManagedInstanceKeysClientListByInstancePager

ListByInstance - Gets a list of managed instance keys. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstanceKeysClientListByInstanceOptions contains the optional parameters for the ManagedInstanceKeysClient.ListByInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceKeysClient("<subscription-id>", cred, nil)
	pager := client.ListByInstance("<resource-group-name>",
		"<managed-instance-name>",
		&armsql.ManagedInstanceKeysClientListByInstanceOptions{Filter: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedInstanceKeysClientBeginCreateOrUpdateOptions added in v0.3.0

type ManagedInstanceKeysClientBeginCreateOrUpdateOptions struct {
}

ManagedInstanceKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceKeysClient.BeginCreateOrUpdate method.

type ManagedInstanceKeysClientBeginDeleteOptions added in v0.3.0

type ManagedInstanceKeysClientBeginDeleteOptions struct {
}

ManagedInstanceKeysClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceKeysClient.BeginDelete method.

type ManagedInstanceKeysClientCreateOrUpdatePoller added in v0.3.0

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

ManagedInstanceKeysClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstanceKeysClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstanceKeysClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstanceKeysClientCreateOrUpdateResponse will be returned.

func (*ManagedInstanceKeysClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstanceKeysClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstanceKeysClientCreateOrUpdatePollerResponse added in v0.3.0

type ManagedInstanceKeysClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstanceKeysClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceKeysClientCreateOrUpdatePollerResponse contains the response from method ManagedInstanceKeysClient.CreateOrUpdate.

func (ManagedInstanceKeysClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstanceKeysClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstanceKeysClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ManagedInstanceKeysClientCreateOrUpdateResponse added in v0.3.0

type ManagedInstanceKeysClientCreateOrUpdateResponse struct {
	ManagedInstanceKeysClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceKeysClientCreateOrUpdateResponse contains the response from method ManagedInstanceKeysClient.CreateOrUpdate.

type ManagedInstanceKeysClientCreateOrUpdateResult added in v0.3.0

type ManagedInstanceKeysClientCreateOrUpdateResult struct {
	ManagedInstanceKey
}

ManagedInstanceKeysClientCreateOrUpdateResult contains the result from method ManagedInstanceKeysClient.CreateOrUpdate.

type ManagedInstanceKeysClientDeletePoller added in v0.3.0

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

ManagedInstanceKeysClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstanceKeysClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstanceKeysClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstanceKeysClientDeleteResponse will be returned.

func (*ManagedInstanceKeysClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstanceKeysClientDeletePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstanceKeysClientDeletePollerResponse added in v0.3.0

type ManagedInstanceKeysClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstanceKeysClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceKeysClientDeletePollerResponse contains the response from method ManagedInstanceKeysClient.Delete.

func (ManagedInstanceKeysClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstanceKeysClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstanceKeysClientDeletePollerResponse from the provided client and resume token.

type ManagedInstanceKeysClientDeleteResponse added in v0.3.0

type ManagedInstanceKeysClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceKeysClientDeleteResponse contains the response from method ManagedInstanceKeysClient.Delete.

type ManagedInstanceKeysClientGetOptions added in v0.3.0

type ManagedInstanceKeysClientGetOptions struct {
}

ManagedInstanceKeysClientGetOptions contains the optional parameters for the ManagedInstanceKeysClient.Get method.

type ManagedInstanceKeysClientGetResponse added in v0.3.0

type ManagedInstanceKeysClientGetResponse struct {
	ManagedInstanceKeysClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceKeysClientGetResponse contains the response from method ManagedInstanceKeysClient.Get.

type ManagedInstanceKeysClientGetResult added in v0.3.0

type ManagedInstanceKeysClientGetResult struct {
	ManagedInstanceKey
}

ManagedInstanceKeysClientGetResult contains the result from method ManagedInstanceKeysClient.Get.

type ManagedInstanceKeysClientListByInstanceOptions added in v0.3.0

type ManagedInstanceKeysClientListByInstanceOptions struct {
	// An OData filter expression that filters elements in the collection.
	Filter *string
}

ManagedInstanceKeysClientListByInstanceOptions contains the optional parameters for the ManagedInstanceKeysClient.ListByInstance method.

type ManagedInstanceKeysClientListByInstancePager added in v0.3.0

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

ManagedInstanceKeysClientListByInstancePager provides operations for iterating over paged responses.

func (*ManagedInstanceKeysClientListByInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedInstanceKeysClientListByInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedInstanceKeysClientListByInstancePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedInstanceKeysClientListByInstanceResponse page.

type ManagedInstanceKeysClientListByInstanceResponse added in v0.3.0

type ManagedInstanceKeysClientListByInstanceResponse struct {
	ManagedInstanceKeysClientListByInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceKeysClientListByInstanceResponse contains the response from method ManagedInstanceKeysClient.ListByInstance.

type ManagedInstanceKeysClientListByInstanceResult added in v0.3.0

type ManagedInstanceKeysClientListByInstanceResult struct {
	ManagedInstanceKeyListResult
}

ManagedInstanceKeysClientListByInstanceResult contains the result from method ManagedInstanceKeysClient.ListByInstance.

type ManagedInstanceLicenseType

type ManagedInstanceLicenseType string

ManagedInstanceLicenseType - The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses).

const (
	ManagedInstanceLicenseTypeBasePrice       ManagedInstanceLicenseType = "BasePrice"
	ManagedInstanceLicenseTypeLicenseIncluded ManagedInstanceLicenseType = "LicenseIncluded"
)

func PossibleManagedInstanceLicenseTypeValues

func PossibleManagedInstanceLicenseTypeValues() []ManagedInstanceLicenseType

PossibleManagedInstanceLicenseTypeValues returns the possible values for the ManagedInstanceLicenseType const type.

func (ManagedInstanceLicenseType) ToPtr

ToPtr returns a *ManagedInstanceLicenseType pointing to the current value.

type ManagedInstanceListResult

type ManagedInstanceListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedInstance `json:"value,omitempty" azure:"ro"`
}

ManagedInstanceListResult - A list of managed instances.

func (ManagedInstanceListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceListResult.

type ManagedInstanceLongTermRetentionBackup

type ManagedInstanceLongTermRetentionBackup struct {
	// Resource properties.
	Properties *ManagedInstanceLongTermRetentionBackupProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedInstanceLongTermRetentionBackup - A long term retention backup for a managed database.

type ManagedInstanceLongTermRetentionBackupListResult

type ManagedInstanceLongTermRetentionBackupListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedInstanceLongTermRetentionBackup `json:"value,omitempty" azure:"ro"`
}

ManagedInstanceLongTermRetentionBackupListResult - A list of long term retention backups for managed database(s).

func (ManagedInstanceLongTermRetentionBackupListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionBackupListResult.

type ManagedInstanceLongTermRetentionBackupProperties

type ManagedInstanceLongTermRetentionBackupProperties struct {
	// READ-ONLY; The time the long term retention backup will expire.
	BackupExpirationTime *time.Time `json:"backupExpirationTime,omitempty" azure:"ro"`

	// READ-ONLY; The storage redundancy type of the backup
	BackupStorageRedundancy *BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty" azure:"ro"`

	// READ-ONLY; The time the backup was taken
	BackupTime *time.Time `json:"backupTime,omitempty" azure:"ro"`

	// READ-ONLY; The delete time of the database
	DatabaseDeletionTime *time.Time `json:"databaseDeletionTime,omitempty" azure:"ro"`

	// READ-ONLY; The name of the database the backup belong to
	DatabaseName *string `json:"databaseName,omitempty" azure:"ro"`

	// READ-ONLY; The create time of the instance.
	ManagedInstanceCreateTime *time.Time `json:"managedInstanceCreateTime,omitempty" azure:"ro"`

	// READ-ONLY; The managed instance that the backup database belongs to.
	ManagedInstanceName *string `json:"managedInstanceName,omitempty" azure:"ro"`
}

ManagedInstanceLongTermRetentionBackupProperties - Properties of a long term retention backup

func (ManagedInstanceLongTermRetentionBackupProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionBackupProperties.

func (*ManagedInstanceLongTermRetentionBackupProperties) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceLongTermRetentionBackupProperties.

type ManagedInstanceLongTermRetentionPoliciesClient

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

ManagedInstanceLongTermRetentionPoliciesClient contains the methods for the ManagedInstanceLongTermRetentionPolicies group. Don't use this type directly, use NewManagedInstanceLongTermRetentionPoliciesClient() instead.

func NewManagedInstanceLongTermRetentionPoliciesClient

func NewManagedInstanceLongTermRetentionPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedInstanceLongTermRetentionPoliciesClient

NewManagedInstanceLongTermRetentionPoliciesClient creates a new instance of ManagedInstanceLongTermRetentionPoliciesClient with the specified values. subscriptionID - The 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 (*ManagedInstanceLongTermRetentionPoliciesClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Sets a managed database's long term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. policyName - The policy name. Should always be Default. parameters - The long term retention policy info. options - ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyCreateOrUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceLongTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.ManagedInstanceLongTermRetentionPolicyName("default"),
		armsql.ManagedInstanceLongTermRetentionPolicy{
			Properties: &armsql.BaseLongTermRetentionPolicyProperties{
				MonthlyRetention: to.StringPtr("<monthly-retention>"),
				WeekOfYear:       to.Int32Ptr(5),
				WeeklyRetention:  to.StringPtr("<weekly-retention>"),
				YearlyRetention:  to.StringPtr("<yearly-retention>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResult)
}
Output:

func (*ManagedInstanceLongTermRetentionPoliciesClient) Get

Get - Gets a managed database's long term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. policyName - The policy name. Should always be Default. options - ManagedInstanceLongTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceLongTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		armsql.ManagedInstanceLongTermRetentionPolicyName("default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstanceLongTermRetentionPoliciesClientGetResult)
}
Output:

func (*ManagedInstanceLongTermRetentionPoliciesClient) ListByDatabase

ListByDatabase - Gets a database's long term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. databaseName - The name of the database. options - ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceLongTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<managed-instance-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions added in v0.3.0

type ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct {
}

ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.BeginCreateOrUpdate method.

type ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdatePoller added in v0.3.0

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

ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResponse will be returned.

func (*ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdatePollerResponse added in v0.3.0

type ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdatePollerResponse contains the response from method ManagedInstanceLongTermRetentionPoliciesClient.CreateOrUpdate.

func (ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResponse added in v0.3.0

type ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResponse struct {
	ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method ManagedInstanceLongTermRetentionPoliciesClient.CreateOrUpdate.

type ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResult added in v0.3.0

type ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResult struct {
	ManagedInstanceLongTermRetentionPolicy
}

ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResult contains the result from method ManagedInstanceLongTermRetentionPoliciesClient.CreateOrUpdate.

type ManagedInstanceLongTermRetentionPoliciesClientGetOptions added in v0.3.0

type ManagedInstanceLongTermRetentionPoliciesClientGetOptions struct {
}

ManagedInstanceLongTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.Get method.

type ManagedInstanceLongTermRetentionPoliciesClientGetResponse added in v0.3.0

type ManagedInstanceLongTermRetentionPoliciesClientGetResponse struct {
	ManagedInstanceLongTermRetentionPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceLongTermRetentionPoliciesClientGetResponse contains the response from method ManagedInstanceLongTermRetentionPoliciesClient.Get.

type ManagedInstanceLongTermRetentionPoliciesClientGetResult added in v0.3.0

type ManagedInstanceLongTermRetentionPoliciesClientGetResult struct {
	ManagedInstanceLongTermRetentionPolicy
}

ManagedInstanceLongTermRetentionPoliciesClientGetResult contains the result from method ManagedInstanceLongTermRetentionPoliciesClient.Get.

type ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseOptions added in v0.3.0

type ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseOptions struct {
}

ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.ListByDatabase method.

type ManagedInstanceLongTermRetentionPoliciesClientListByDatabasePager added in v0.3.0

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

ManagedInstanceLongTermRetentionPoliciesClientListByDatabasePager provides operations for iterating over paged responses.

func (*ManagedInstanceLongTermRetentionPoliciesClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedInstanceLongTermRetentionPoliciesClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedInstanceLongTermRetentionPoliciesClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResponse page.

type ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResponse added in v0.3.0

type ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResponse struct {
	ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResponse contains the response from method ManagedInstanceLongTermRetentionPoliciesClient.ListByDatabase.

type ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResult added in v0.3.0

type ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResult struct {
	ManagedInstanceLongTermRetentionPolicyListResult
}

ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResult contains the result from method ManagedInstanceLongTermRetentionPoliciesClient.ListByDatabase.

type ManagedInstanceLongTermRetentionPolicy

type ManagedInstanceLongTermRetentionPolicy struct {
	// Resource properties.
	Properties *BaseLongTermRetentionPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedInstanceLongTermRetentionPolicy - A long term retention policy.

type ManagedInstanceLongTermRetentionPolicyListResult

type ManagedInstanceLongTermRetentionPolicyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedInstanceLongTermRetentionPolicy `json:"value,omitempty" azure:"ro"`
}

ManagedInstanceLongTermRetentionPolicyListResult - A list of long term retention policies.

func (ManagedInstanceLongTermRetentionPolicyListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionPolicyListResult.

type ManagedInstanceLongTermRetentionPolicyName

type ManagedInstanceLongTermRetentionPolicyName string
const (
	ManagedInstanceLongTermRetentionPolicyNameDefault ManagedInstanceLongTermRetentionPolicyName = "default"
)

func PossibleManagedInstanceLongTermRetentionPolicyNameValues

func PossibleManagedInstanceLongTermRetentionPolicyNameValues() []ManagedInstanceLongTermRetentionPolicyName

PossibleManagedInstanceLongTermRetentionPolicyNameValues returns the possible values for the ManagedInstanceLongTermRetentionPolicyName const type.

func (ManagedInstanceLongTermRetentionPolicyName) ToPtr

ToPtr returns a *ManagedInstanceLongTermRetentionPolicyName pointing to the current value.

type ManagedInstanceMaintenanceConfigurationCapability

type ManagedInstanceMaintenanceConfigurationCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; Maintenance configuration name
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`
}

ManagedInstanceMaintenanceConfigurationCapability - The maintenance configuration capability

type ManagedInstanceOperation

type ManagedInstanceOperation struct {
	// Resource properties.
	Properties *ManagedInstanceOperationProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedInstanceOperation - A managed instance operation.

type ManagedInstanceOperationListResult

type ManagedInstanceOperationListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedInstanceOperation `json:"value,omitempty" azure:"ro"`
}

ManagedInstanceOperationListResult - The response to a list managed instance operations request

func (ManagedInstanceOperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationListResult.

type ManagedInstanceOperationParametersPair

type ManagedInstanceOperationParametersPair struct {
	// READ-ONLY; The current parameters.
	CurrentParameters *UpsertManagedServerOperationParameters `json:"currentParameters,omitempty" azure:"ro"`

	// READ-ONLY; The requested parameters.
	RequestedParameters *UpsertManagedServerOperationParameters `json:"requestedParameters,omitempty" azure:"ro"`
}

ManagedInstanceOperationParametersPair - The parameters of a managed instance operation.

type ManagedInstanceOperationProperties

type ManagedInstanceOperationProperties struct {
	// READ-ONLY; The operation description.
	Description *string `json:"description,omitempty" azure:"ro"`

	// READ-ONLY; The operation error code.
	ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"`

	// READ-ONLY; The operation error description.
	ErrorDescription *string `json:"errorDescription,omitempty" azure:"ro"`

	// READ-ONLY; The operation error severity.
	ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"`

	// READ-ONLY; The estimated completion time of the operation.
	EstimatedCompletionTime *time.Time `json:"estimatedCompletionTime,omitempty" azure:"ro"`

	// READ-ONLY; Whether the operation can be cancelled.
	IsCancellable *bool `json:"isCancellable,omitempty" azure:"ro"`

	// READ-ONLY; Whether or not the error is a user error.
	IsUserError *bool `json:"isUserError,omitempty" azure:"ro"`

	// READ-ONLY; The name of the managed instance the operation is being performed on.
	ManagedInstanceName *string `json:"managedInstanceName,omitempty" azure:"ro"`

	// READ-ONLY; The name of operation.
	Operation *string `json:"operation,omitempty" azure:"ro"`

	// READ-ONLY; The friendly name of operation.
	OperationFriendlyName *string `json:"operationFriendlyName,omitempty" azure:"ro"`

	// READ-ONLY; The operation parameters.
	OperationParameters *ManagedInstanceOperationParametersPair `json:"operationParameters,omitempty" azure:"ro"`

	// READ-ONLY; The operation steps.
	OperationSteps *ManagedInstanceOperationSteps `json:"operationSteps,omitempty" azure:"ro"`

	// READ-ONLY; The percentage of the operation completed.
	PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"`

	// READ-ONLY; The operation start time.
	StartTime *time.Time `json:"startTime,omitempty" azure:"ro"`

	// READ-ONLY; The operation state.
	State *ManagementOperationState `json:"state,omitempty" azure:"ro"`
}

ManagedInstanceOperationProperties - The properties of a managed instance operation.

func (ManagedInstanceOperationProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationProperties.

func (*ManagedInstanceOperationProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperationProperties.

type ManagedInstanceOperationSteps

type ManagedInstanceOperationSteps struct {
	// READ-ONLY; The number of current operation steps.
	CurrentStep *int32 `json:"currentStep,omitempty" azure:"ro"`

	// READ-ONLY; The operation steps list.
	StepsList []*UpsertManagedServerOperationStep `json:"stepsList,omitempty" azure:"ro"`

	// READ-ONLY; The total number of operation steps.
	TotalSteps *string `json:"totalSteps,omitempty" azure:"ro"`
}

ManagedInstanceOperationSteps - The steps of a managed instance operation.

func (ManagedInstanceOperationSteps) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationSteps.

type ManagedInstanceOperationsClient

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

ManagedInstanceOperationsClient contains the methods for the ManagedInstanceOperations group. Don't use this type directly, use NewManagedInstanceOperationsClient() instead.

func NewManagedInstanceOperationsClient

func NewManagedInstanceOperationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedInstanceOperationsClient

NewManagedInstanceOperationsClient creates a new instance of ManagedInstanceOperationsClient with the specified values. subscriptionID - The 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 (*ManagedInstanceOperationsClient) Cancel

Cancel - Cancels the asynchronous operation on the managed instance. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstanceOperationsClientCancelOptions contains the optional parameters for the ManagedInstanceOperationsClient.Cancel method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelManagedInstanceOperation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceOperationsClient("<subscription-id>", cred, nil)
	_, err = client.Cancel(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<operation-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedInstanceOperationsClient) Get

Get - Gets a management operation on a managed instance. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstanceOperationsClientGetOptions contains the optional parameters for the ManagedInstanceOperationsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedInstanceOperation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceOperationsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<operation-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstanceOperationsClientGetResult)
}
Output:

func (*ManagedInstanceOperationsClient) ListByManagedInstance

ListByManagedInstance - Gets a list of operations performed on the managed instance. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstanceOperationsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstanceOperationsClient.ListByManagedInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListManagedInstanceOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceOperationsClient("<subscription-id>", cred, nil)
	pager := client.ListByManagedInstance("<resource-group-name>",
		"<managed-instance-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedInstanceOperationsClientCancelOptions added in v0.3.0

type ManagedInstanceOperationsClientCancelOptions struct {
}

ManagedInstanceOperationsClientCancelOptions contains the optional parameters for the ManagedInstanceOperationsClient.Cancel method.

type ManagedInstanceOperationsClientCancelResponse added in v0.3.0

type ManagedInstanceOperationsClientCancelResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceOperationsClientCancelResponse contains the response from method ManagedInstanceOperationsClient.Cancel.

type ManagedInstanceOperationsClientGetOptions added in v0.3.0

type ManagedInstanceOperationsClientGetOptions struct {
}

ManagedInstanceOperationsClientGetOptions contains the optional parameters for the ManagedInstanceOperationsClient.Get method.

type ManagedInstanceOperationsClientGetResponse added in v0.3.0

type ManagedInstanceOperationsClientGetResponse struct {
	ManagedInstanceOperationsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceOperationsClientGetResponse contains the response from method ManagedInstanceOperationsClient.Get.

type ManagedInstanceOperationsClientGetResult added in v0.3.0

type ManagedInstanceOperationsClientGetResult struct {
	ManagedInstanceOperation
}

ManagedInstanceOperationsClientGetResult contains the result from method ManagedInstanceOperationsClient.Get.

type ManagedInstanceOperationsClientListByManagedInstanceOptions added in v0.3.0

type ManagedInstanceOperationsClientListByManagedInstanceOptions struct {
}

ManagedInstanceOperationsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstanceOperationsClient.ListByManagedInstance method.

type ManagedInstanceOperationsClientListByManagedInstancePager added in v0.3.0

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

ManagedInstanceOperationsClientListByManagedInstancePager provides operations for iterating over paged responses.

func (*ManagedInstanceOperationsClientListByManagedInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedInstanceOperationsClientListByManagedInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedInstanceOperationsClientListByManagedInstancePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedInstanceOperationsClientListByManagedInstanceResponse page.

type ManagedInstanceOperationsClientListByManagedInstanceResponse added in v0.3.0

type ManagedInstanceOperationsClientListByManagedInstanceResponse struct {
	ManagedInstanceOperationsClientListByManagedInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceOperationsClientListByManagedInstanceResponse contains the response from method ManagedInstanceOperationsClient.ListByManagedInstance.

type ManagedInstanceOperationsClientListByManagedInstanceResult added in v0.3.0

type ManagedInstanceOperationsClientListByManagedInstanceResult struct {
	ManagedInstanceOperationListResult
}

ManagedInstanceOperationsClientListByManagedInstanceResult contains the result from method ManagedInstanceOperationsClient.ListByManagedInstance.

type ManagedInstancePairInfo

type ManagedInstancePairInfo struct {
	// Id of Partner Managed Instance in pair.
	PartnerManagedInstanceID *string `json:"partnerManagedInstanceId,omitempty"`

	// Id of Primary Managed Instance in pair.
	PrimaryManagedInstanceID *string `json:"primaryManagedInstanceId,omitempty"`
}

ManagedInstancePairInfo - Pairs of Managed Instances in the failover group.

type ManagedInstancePecProperty

type ManagedInstancePecProperty struct {
	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Private endpoint connection properties
	Properties *ManagedInstancePrivateEndpointConnectionProperties `json:"properties,omitempty" azure:"ro"`
}

ManagedInstancePecProperty - A private endpoint connection under a managed instance

type ManagedInstancePrivateEndpointConnection

type ManagedInstancePrivateEndpointConnection struct {
	// Resource properties.
	Properties *ManagedInstancePrivateEndpointConnectionProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedInstancePrivateEndpointConnection - A private endpoint connection

type ManagedInstancePrivateEndpointConnectionListResult

type ManagedInstancePrivateEndpointConnectionListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedInstancePrivateEndpointConnection `json:"value,omitempty" azure:"ro"`
}

ManagedInstancePrivateEndpointConnectionListResult - A list of private endpoint connections.

func (ManagedInstancePrivateEndpointConnectionListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateEndpointConnectionListResult.

type ManagedInstancePrivateEndpointConnectionProperties

type ManagedInstancePrivateEndpointConnectionProperties struct {
	// Private endpoint which the connection belongs to.
	PrivateEndpoint *ManagedInstancePrivateEndpointProperty `json:"privateEndpoint,omitempty"`

	// Connection State of the Private Endpoint Connection.
	PrivateLinkServiceConnectionState *ManagedInstancePrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"`

	// READ-ONLY; State of the Private Endpoint Connection.
	ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"`
}

ManagedInstancePrivateEndpointConnectionProperties - Properties of a private endpoint connection.

type ManagedInstancePrivateEndpointConnectionsClient

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

ManagedInstancePrivateEndpointConnectionsClient contains the methods for the ManagedInstancePrivateEndpointConnections group. Don't use this type directly, use NewManagedInstancePrivateEndpointConnectionsClient() instead.

func NewManagedInstancePrivateEndpointConnectionsClient

func NewManagedInstancePrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedInstancePrivateEndpointConnectionsClient

NewManagedInstancePrivateEndpointConnectionsClient creates a new instance of ManagedInstancePrivateEndpointConnectionsClient with the specified values. subscriptionID - The 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 (*ManagedInstancePrivateEndpointConnectionsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstancePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstancePrivateEndpointConnectionsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<private-endpoint-connection-name>",
		armsql.ManagedInstancePrivateEndpointConnection{
			Properties: &armsql.ManagedInstancePrivateEndpointConnectionProperties{
				PrivateLinkServiceConnectionState: &armsql.ManagedInstancePrivateLinkServiceConnectionStateProperty{
					Description: to.StringPtr("<description>"),
					Status:      to.StringPtr("<status>"),
				},
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResult)
}
Output:

func (*ManagedInstancePrivateEndpointConnectionsClient) BeginDelete

BeginDelete - Deletes a private endpoint connection with a given name. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstancePrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstancePrivateEndpointConnectionsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<private-endpoint-connection-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedInstancePrivateEndpointConnectionsClient) Get

Get - Gets a private endpoint connection. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. privateEndpointConnectionName - The name of the private endpoint connection. options - ManagedInstancePrivateEndpointConnectionsClientGetOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstancePrivateEndpointConnectionsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<private-endpoint-connection-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstancePrivateEndpointConnectionsClientGetResult)
}
Output:

func (*ManagedInstancePrivateEndpointConnectionsClient) ListByManagedInstance

ListByManagedInstance - Gets all private endpoint connections on a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.ListByManagedInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstancePrivateEndpointConnectionsClient("<subscription-id>", cred, nil)
	pager := client.ListByManagedInstance("<resource-group-name>",
		"<managed-instance-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedInstancePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions added in v0.3.0

type ManagedInstancePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct {
}

ManagedInstancePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.BeginCreateOrUpdate method.

type ManagedInstancePrivateEndpointConnectionsClientBeginDeleteOptions added in v0.3.0

type ManagedInstancePrivateEndpointConnectionsClientBeginDeleteOptions struct {
}

ManagedInstancePrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.BeginDelete method.

type ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdatePoller added in v0.3.0

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

ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResponse will be returned.

func (*ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdatePollerResponse added in v0.3.0

type ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdatePollerResponse contains the response from method ManagedInstancePrivateEndpointConnectionsClient.CreateOrUpdate.

func (ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResponse added in v0.3.0

type ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResponse struct {
	ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method ManagedInstancePrivateEndpointConnectionsClient.CreateOrUpdate.

type ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResult added in v0.3.0

type ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResult struct {
	ManagedInstancePrivateEndpointConnection
}

ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResult contains the result from method ManagedInstancePrivateEndpointConnectionsClient.CreateOrUpdate.

type ManagedInstancePrivateEndpointConnectionsClientDeletePoller added in v0.3.0

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

ManagedInstancePrivateEndpointConnectionsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstancePrivateEndpointConnectionsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstancePrivateEndpointConnectionsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstancePrivateEndpointConnectionsClientDeleteResponse will be returned.

func (*ManagedInstancePrivateEndpointConnectionsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstancePrivateEndpointConnectionsClientDeletePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstancePrivateEndpointConnectionsClientDeletePollerResponse added in v0.3.0

type ManagedInstancePrivateEndpointConnectionsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstancePrivateEndpointConnectionsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancePrivateEndpointConnectionsClientDeletePollerResponse contains the response from method ManagedInstancePrivateEndpointConnectionsClient.Delete.

func (ManagedInstancePrivateEndpointConnectionsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstancePrivateEndpointConnectionsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstancePrivateEndpointConnectionsClientDeletePollerResponse from the provided client and resume token.

type ManagedInstancePrivateEndpointConnectionsClientDeleteResponse added in v0.3.0

type ManagedInstancePrivateEndpointConnectionsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancePrivateEndpointConnectionsClientDeleteResponse contains the response from method ManagedInstancePrivateEndpointConnectionsClient.Delete.

type ManagedInstancePrivateEndpointConnectionsClientGetOptions added in v0.3.0

type ManagedInstancePrivateEndpointConnectionsClientGetOptions struct {
}

ManagedInstancePrivateEndpointConnectionsClientGetOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.Get method.

type ManagedInstancePrivateEndpointConnectionsClientGetResponse added in v0.3.0

type ManagedInstancePrivateEndpointConnectionsClientGetResponse struct {
	ManagedInstancePrivateEndpointConnectionsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancePrivateEndpointConnectionsClientGetResponse contains the response from method ManagedInstancePrivateEndpointConnectionsClient.Get.

type ManagedInstancePrivateEndpointConnectionsClientGetResult added in v0.3.0

type ManagedInstancePrivateEndpointConnectionsClientGetResult struct {
	ManagedInstancePrivateEndpointConnection
}

ManagedInstancePrivateEndpointConnectionsClientGetResult contains the result from method ManagedInstancePrivateEndpointConnectionsClient.Get.

type ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceOptions added in v0.3.0

type ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceOptions struct {
}

ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.ListByManagedInstance method.

type ManagedInstancePrivateEndpointConnectionsClientListByManagedInstancePager added in v0.3.0

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

ManagedInstancePrivateEndpointConnectionsClientListByManagedInstancePager provides operations for iterating over paged responses.

func (*ManagedInstancePrivateEndpointConnectionsClientListByManagedInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedInstancePrivateEndpointConnectionsClientListByManagedInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedInstancePrivateEndpointConnectionsClientListByManagedInstancePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResponse page.

type ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResponse added in v0.3.0

type ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResponse struct {
	ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResponse contains the response from method ManagedInstancePrivateEndpointConnectionsClient.ListByManagedInstance.

type ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResult added in v0.3.0

type ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResult struct {
	ManagedInstancePrivateEndpointConnectionListResult
}

ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResult contains the result from method ManagedInstancePrivateEndpointConnectionsClient.ListByManagedInstance.

type ManagedInstancePrivateEndpointProperty

type ManagedInstancePrivateEndpointProperty struct {
	// Resource id of the private endpoint.
	ID *string `json:"id,omitempty"`
}
type ManagedInstancePrivateLink struct {
	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The private link resource group id.
	Properties *ManagedInstancePrivateLinkProperties `json:"properties,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedInstancePrivateLink - A private link resource

type ManagedInstancePrivateLinkListResult

type ManagedInstancePrivateLinkListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedInstancePrivateLink `json:"value,omitempty" azure:"ro"`
}

ManagedInstancePrivateLinkListResult - A list of private link resources

func (ManagedInstancePrivateLinkListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLinkListResult.

type ManagedInstancePrivateLinkProperties

type ManagedInstancePrivateLinkProperties struct {
	// READ-ONLY; The private link resource group id.
	GroupID *string `json:"groupId,omitempty" azure:"ro"`

	// READ-ONLY; The private link resource required member names.
	RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"`
}

ManagedInstancePrivateLinkProperties - Properties of a private link resource.

func (ManagedInstancePrivateLinkProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLinkProperties.

type ManagedInstancePrivateLinkResourcesClient

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

ManagedInstancePrivateLinkResourcesClient contains the methods for the ManagedInstancePrivateLinkResources group. Don't use this type directly, use NewManagedInstancePrivateLinkResourcesClient() instead.

func NewManagedInstancePrivateLinkResourcesClient

func NewManagedInstancePrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedInstancePrivateLinkResourcesClient

NewManagedInstancePrivateLinkResourcesClient creates a new instance of ManagedInstancePrivateLinkResourcesClient with the specified values. subscriptionID - The 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 (*ManagedInstancePrivateLinkResourcesClient) Get

Get - Gets a private link resource for SQL server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. groupName - The name of the private link resource. options - ManagedInstancePrivateLinkResourcesClientGetOptions contains the optional parameters for the ManagedInstancePrivateLinkResourcesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstancePrivateLinkResourcesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstancePrivateLinkResourcesClientGetResult)
}
Output:

func (*ManagedInstancePrivateLinkResourcesClient) ListByManagedInstance

ListByManagedInstance - Gets the private link resources for SQL server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstancePrivateLinkResourcesClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancePrivateLinkResourcesClient.ListByManagedInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstancePrivateLinkResourcesClient("<subscription-id>", cred, nil)
	pager := client.ListByManagedInstance("<resource-group-name>",
		"<managed-instance-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedInstancePrivateLinkResourcesClientGetOptions added in v0.3.0

type ManagedInstancePrivateLinkResourcesClientGetOptions struct {
}

ManagedInstancePrivateLinkResourcesClientGetOptions contains the optional parameters for the ManagedInstancePrivateLinkResourcesClient.Get method.

type ManagedInstancePrivateLinkResourcesClientGetResponse added in v0.3.0

type ManagedInstancePrivateLinkResourcesClientGetResponse struct {
	ManagedInstancePrivateLinkResourcesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancePrivateLinkResourcesClientGetResponse contains the response from method ManagedInstancePrivateLinkResourcesClient.Get.

type ManagedInstancePrivateLinkResourcesClientGetResult added in v0.3.0

type ManagedInstancePrivateLinkResourcesClientGetResult struct {
	ManagedInstancePrivateLink
}

ManagedInstancePrivateLinkResourcesClientGetResult contains the result from method ManagedInstancePrivateLinkResourcesClient.Get.

type ManagedInstancePrivateLinkResourcesClientListByManagedInstanceOptions added in v0.3.0

type ManagedInstancePrivateLinkResourcesClientListByManagedInstanceOptions struct {
}

ManagedInstancePrivateLinkResourcesClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancePrivateLinkResourcesClient.ListByManagedInstance method.

type ManagedInstancePrivateLinkResourcesClientListByManagedInstancePager added in v0.3.0

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

ManagedInstancePrivateLinkResourcesClientListByManagedInstancePager provides operations for iterating over paged responses.

func (*ManagedInstancePrivateLinkResourcesClientListByManagedInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedInstancePrivateLinkResourcesClientListByManagedInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedInstancePrivateLinkResourcesClientListByManagedInstancePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResponse page.

type ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResponse added in v0.3.0

type ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResponse struct {
	ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResponse contains the response from method ManagedInstancePrivateLinkResourcesClient.ListByManagedInstance.

type ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResult added in v0.3.0

type ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResult struct {
	ManagedInstancePrivateLinkListResult
}

ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResult contains the result from method ManagedInstancePrivateLinkResourcesClient.ListByManagedInstance.

type ManagedInstancePrivateLinkServiceConnectionStateProperty

type ManagedInstancePrivateLinkServiceConnectionStateProperty struct {
	// REQUIRED; The private link service connection description.
	Description *string `json:"description,omitempty"`

	// REQUIRED; The private link service connection status.
	Status *string `json:"status,omitempty"`

	// READ-ONLY; The private link service connection description.
	ActionsRequired *string `json:"actionsRequired,omitempty" azure:"ro"`
}

type ManagedInstanceProperties

type ManagedInstanceProperties struct {
	// Administrator username for the managed instance. Can only be specified when the managed instance is being created (and
	// is required for creation).
	AdministratorLogin *string `json:"administratorLogin,omitempty"`

	// The administrator login password (required for managed instance creation).
	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`

	// The Azure Active Directory administrator of the server.
	Administrators *ManagedInstanceExternalAdministrator `json:"administrators,omitempty"`

	// Collation of the managed instance.
	Collation *string `json:"collation,omitempty"`

	// The resource id of another managed instance whose DNS zone this managed instance will share after creation.
	DNSZonePartner *string `json:"dnsZonePartner,omitempty"`

	// The Id of the instance pool this managed server belongs to.
	InstancePoolID *string `json:"instancePoolId,omitempty"`

	// A CMK URI of the key to use for encryption.
	KeyID *string `json:"keyId,omitempty"`

	// The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice'
	// (discounted AHB price for bringing your own SQL licenses).
	LicenseType *ManagedInstanceLicenseType `json:"licenseType,omitempty"`

	// Specifies maintenance configuration id to apply to this managed instance.
	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`

	// Specifies the mode of database creation.
	// Default: Regular instance creation.
	// Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId
	// must be specified.
	ManagedInstanceCreateMode *ManagedServerCreateMode `json:"managedInstanceCreateMode,omitempty"`

	// Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'
	MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"`

	// The resource id of a user assigned identity to be used by default.
	PrimaryUserAssignedIdentityID *string `json:"primaryUserAssignedIdentityId,omitempty"`

	// Connection type used for connecting to the instance.
	ProxyOverride *ManagedInstanceProxyOverride `json:"proxyOverride,omitempty"`

	// Whether or not the public data endpoint is enabled.
	PublicDataEndpointEnabled *bool `json:"publicDataEndpointEnabled,omitempty"`

	// The storage account type to be used to store backups for this instance. The options are Local (LocallyRedundantStorage),
	// Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and
	// GeoZone(GeoZoneRedundantStorage)
	RequestedBackupStorageRedundancy *BackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"`

	// Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
	RestorePointInTime *time.Time `json:"restorePointInTime,omitempty"`

	// The managed instance's service principal.
	ServicePrincipal *ServicePrincipal `json:"servicePrincipal,omitempty"`

	// The resource identifier of the source managed instance associated with create operation of this instance.
	SourceManagedInstanceID *string `json:"sourceManagedInstanceId,omitempty"`

	// Storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only.
	StorageSizeInGB *int32 `json:"storageSizeInGB,omitempty"`

	// Subnet resource ID for the managed instance.
	SubnetID *string `json:"subnetId,omitempty"`

	// Id of the timezone. Allowed values are timezones supported by Windows. Windows keeps details on supported timezones, including
	// the id, in registry under KEYLOCALMACHINE\SOFTWARE\Microsoft\Windows
	// NT\CurrentVersion\Time Zones. You can get those registry values via SQL Server by querying SELECT name AS timezoneid FROM
	// sys.timezone_info. List of Ids can also be obtained by executing
	// [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. An example of valid timezone id is "Pacific Standard Time" or
	// "W. Europe Standard Time".
	TimezoneID *string `json:"timezoneId,omitempty"`

	// The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80.
	VCores *int32 `json:"vCores,omitempty"`

	// Whether or not the multi-az is enabled.
	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`

	// READ-ONLY; The storage account type used to store backups for this instance. The options are Local (LocallyRedundantStorage),
	// Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and
	// GeoZone(GeoZoneRedundantStorage)
	CurrentBackupStorageRedundancy *BackupStorageRedundancy `json:"currentBackupStorageRedundancy,omitempty" azure:"ro"`

	// READ-ONLY; The Dns Zone that the managed instance is in.
	DNSZone *string `json:"dnsZone,omitempty" azure:"ro"`

	// READ-ONLY; The fully qualified domain name of the managed instance.
	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty" azure:"ro"`

	// READ-ONLY; List of private endpoint connections on a managed instance.
	PrivateEndpointConnections []*ManagedInstancePecProperty `json:"privateEndpointConnections,omitempty" azure:"ro"`

	// READ-ONLY
	ProvisioningState *ManagedInstancePropertiesProvisioningState `json:"provisioningState,omitempty" azure:"ro"`

	// READ-ONLY; The state of the managed instance.
	State *string `json:"state,omitempty" azure:"ro"`
}

ManagedInstanceProperties - The properties of a managed instance.

func (ManagedInstanceProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceProperties.

func (*ManagedInstanceProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceProperties.

type ManagedInstancePropertiesProvisioningState

type ManagedInstancePropertiesProvisioningState string
const (
	ManagedInstancePropertiesProvisioningStateAccepted     ManagedInstancePropertiesProvisioningState = "Accepted"
	ManagedInstancePropertiesProvisioningStateCanceled     ManagedInstancePropertiesProvisioningState = "Canceled"
	ManagedInstancePropertiesProvisioningStateCreated      ManagedInstancePropertiesProvisioningState = "Created"
	ManagedInstancePropertiesProvisioningStateCreating     ManagedInstancePropertiesProvisioningState = "Creating"
	ManagedInstancePropertiesProvisioningStateDeleted      ManagedInstancePropertiesProvisioningState = "Deleted"
	ManagedInstancePropertiesProvisioningStateDeleting     ManagedInstancePropertiesProvisioningState = "Deleting"
	ManagedInstancePropertiesProvisioningStateFailed       ManagedInstancePropertiesProvisioningState = "Failed"
	ManagedInstancePropertiesProvisioningStateNotSpecified ManagedInstancePropertiesProvisioningState = "NotSpecified"
	ManagedInstancePropertiesProvisioningStateRegistering  ManagedInstancePropertiesProvisioningState = "Registering"
	ManagedInstancePropertiesProvisioningStateRunning      ManagedInstancePropertiesProvisioningState = "Running"
	ManagedInstancePropertiesProvisioningStateSucceeded    ManagedInstancePropertiesProvisioningState = "Succeeded"
	ManagedInstancePropertiesProvisioningStateTimedOut     ManagedInstancePropertiesProvisioningState = "TimedOut"
	ManagedInstancePropertiesProvisioningStateUnknown      ManagedInstancePropertiesProvisioningState = "Unknown"
	ManagedInstancePropertiesProvisioningStateUnrecognized ManagedInstancePropertiesProvisioningState = "Unrecognized"
	ManagedInstancePropertiesProvisioningStateUpdating     ManagedInstancePropertiesProvisioningState = "Updating"
)

func PossibleManagedInstancePropertiesProvisioningStateValues

func PossibleManagedInstancePropertiesProvisioningStateValues() []ManagedInstancePropertiesProvisioningState

PossibleManagedInstancePropertiesProvisioningStateValues returns the possible values for the ManagedInstancePropertiesProvisioningState const type.

func (ManagedInstancePropertiesProvisioningState) ToPtr

ToPtr returns a *ManagedInstancePropertiesProvisioningState pointing to the current value.

type ManagedInstanceProxyOverride

type ManagedInstanceProxyOverride string

ManagedInstanceProxyOverride - Connection type used for connecting to the instance.

const (
	ManagedInstanceProxyOverrideDefault  ManagedInstanceProxyOverride = "Default"
	ManagedInstanceProxyOverrideProxy    ManagedInstanceProxyOverride = "Proxy"
	ManagedInstanceProxyOverrideRedirect ManagedInstanceProxyOverride = "Redirect"
)

func PossibleManagedInstanceProxyOverrideValues

func PossibleManagedInstanceProxyOverrideValues() []ManagedInstanceProxyOverride

PossibleManagedInstanceProxyOverrideValues returns the possible values for the ManagedInstanceProxyOverride const type.

func (ManagedInstanceProxyOverride) ToPtr

ToPtr returns a *ManagedInstanceProxyOverride pointing to the current value.

type ManagedInstanceQuery

type ManagedInstanceQuery struct {
	// Resource properties.
	Properties *QueryProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedInstanceQuery - Database query.

type ManagedInstanceQueryStatistics

type ManagedInstanceQueryStatistics struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*QueryStatistics `json:"value,omitempty" azure:"ro"`
}

ManagedInstanceQueryStatistics - Execution statistics for one particular query

func (ManagedInstanceQueryStatistics) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceQueryStatistics.

type ManagedInstanceTdeCertificatesClient

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

ManagedInstanceTdeCertificatesClient contains the methods for the ManagedInstanceTdeCertificates group. Don't use this type directly, use NewManagedInstanceTdeCertificatesClient() instead.

func NewManagedInstanceTdeCertificatesClient

func NewManagedInstanceTdeCertificatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedInstanceTdeCertificatesClient

NewManagedInstanceTdeCertificatesClient creates a new instance of ManagedInstanceTdeCertificatesClient with the specified values. subscriptionID - The 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 (*ManagedInstanceTdeCertificatesClient) BeginCreate

BeginCreate - Creates a TDE certificate for a given server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. parameters - The requested TDE certificate to be created or updated. options - ManagedInstanceTdeCertificatesClientBeginCreateOptions contains the optional parameters for the ManagedInstanceTdeCertificatesClient.BeginCreate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTdeCertificate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceTdeCertificatesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.TdeCertificate{
			Properties: &armsql.TdeCertificateProperties{
				PrivateBlob: to.StringPtr("<private-blob>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

type ManagedInstanceTdeCertificatesClientBeginCreateOptions added in v0.3.0

type ManagedInstanceTdeCertificatesClientBeginCreateOptions struct {
}

ManagedInstanceTdeCertificatesClientBeginCreateOptions contains the optional parameters for the ManagedInstanceTdeCertificatesClient.BeginCreate method.

type ManagedInstanceTdeCertificatesClientCreatePoller added in v0.3.0

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

ManagedInstanceTdeCertificatesClientCreatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstanceTdeCertificatesClientCreatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstanceTdeCertificatesClientCreatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstanceTdeCertificatesClientCreateResponse will be returned.

func (*ManagedInstanceTdeCertificatesClientCreatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstanceTdeCertificatesClientCreatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstanceTdeCertificatesClientCreatePollerResponse added in v0.3.0

type ManagedInstanceTdeCertificatesClientCreatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstanceTdeCertificatesClientCreatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceTdeCertificatesClientCreatePollerResponse contains the response from method ManagedInstanceTdeCertificatesClient.Create.

func (ManagedInstanceTdeCertificatesClientCreatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstanceTdeCertificatesClientCreatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstanceTdeCertificatesClientCreatePollerResponse from the provided client and resume token.

type ManagedInstanceTdeCertificatesClientCreateResponse added in v0.3.0

type ManagedInstanceTdeCertificatesClientCreateResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceTdeCertificatesClientCreateResponse contains the response from method ManagedInstanceTdeCertificatesClient.Create.

type ManagedInstanceUpdate

type ManagedInstanceUpdate struct {
	// Managed instance identity
	Identity *ResourceIdentity `json:"identity,omitempty"`

	// Resource properties.
	Properties *ManagedInstanceProperties `json:"properties,omitempty"`

	// Managed instance sku
	SKU *SKU `json:"sku,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`
}

ManagedInstanceUpdate - An update request for an Azure SQL Database managed instance.

func (ManagedInstanceUpdate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceUpdate.

type ManagedInstanceVcoresCapability

type ManagedInstanceVcoresCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; Included size.
	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty" azure:"ro"`

	// READ-ONLY; True if this service objective is supported for managed instances in an instance pool.
	InstancePoolSupported *bool `json:"instancePoolSupported,omitempty" azure:"ro"`

	// READ-ONLY; The virtual cores identifier.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; True if this service objective is supported for standalone managed instances.
	StandaloneSupported *bool `json:"standaloneSupported,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; List of supported maintenance configurations
	SupportedMaintenanceConfigurations []*ManagedInstanceMaintenanceConfigurationCapability `json:"supportedMaintenanceConfigurations,omitempty" azure:"ro"`

	// READ-ONLY; Storage size ranges.
	SupportedStorageSizes []*MaxSizeRangeCapability `json:"supportedStorageSizes,omitempty" azure:"ro"`

	// READ-ONLY; The virtual cores value.
	Value *int32 `json:"value,omitempty" azure:"ro"`
}

ManagedInstanceVcoresCapability - The managed instance virtual cores capability.

func (ManagedInstanceVcoresCapability) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVcoresCapability.

type ManagedInstanceVersionCapability

type ManagedInstanceVersionCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; The server version name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; The list of supported managed instance editions.
	SupportedEditions []*ManagedInstanceEditionCapability `json:"supportedEditions,omitempty" azure:"ro"`

	// READ-ONLY; The list of supported instance pool editions.
	SupportedInstancePoolEditions []*InstancePoolEditionCapability `json:"supportedInstancePoolEditions,omitempty" azure:"ro"`
}

ManagedInstanceVersionCapability - The managed instance capability

func (ManagedInstanceVersionCapability) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVersionCapability.

type ManagedInstanceVulnerabilityAssessment

type ManagedInstanceVulnerabilityAssessment struct {
	// Resource properties.
	Properties *ManagedInstanceVulnerabilityAssessmentProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedInstanceVulnerabilityAssessment - A managed instance vulnerability assessment.

type ManagedInstanceVulnerabilityAssessmentListResult

type ManagedInstanceVulnerabilityAssessmentListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedInstanceVulnerabilityAssessment `json:"value,omitempty" azure:"ro"`
}

ManagedInstanceVulnerabilityAssessmentListResult - A list of the ManagedInstance's vulnerability assessments.

func (ManagedInstanceVulnerabilityAssessmentListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVulnerabilityAssessmentListResult.

type ManagedInstanceVulnerabilityAssessmentProperties

type ManagedInstanceVulnerabilityAssessmentProperties struct {
	// REQUIRED; A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
	StorageContainerPath *string `json:"storageContainerPath,omitempty"`

	// The recurring scans settings
	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`

	// Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey'
	// isn't specified, storageAccountAccessKey is required. Applies only if the
	// storage account is not behind a Vnet or a firewall
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`

	// A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter.
	// If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is
	// required. Applies only if the storage account is not behind a Vnet or a firewall
	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
}

ManagedInstanceVulnerabilityAssessmentProperties - Properties of a managed instance vulnerability assessment.

type ManagedInstanceVulnerabilityAssessmentsClient

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

ManagedInstanceVulnerabilityAssessmentsClient contains the methods for the ManagedInstanceVulnerabilityAssessments group. Don't use this type directly, use NewManagedInstanceVulnerabilityAssessmentsClient() instead.

func NewManagedInstanceVulnerabilityAssessmentsClient

func NewManagedInstanceVulnerabilityAssessmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedInstanceVulnerabilityAssessmentsClient

NewManagedInstanceVulnerabilityAssessmentsClient creates a new instance of ManagedInstanceVulnerabilityAssessmentsClient with the specified values. subscriptionID - The 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 (*ManagedInstanceVulnerabilityAssessmentsClient) CreateOrUpdate

CreateOrUpdate - Creates or updates the managed instance's vulnerability assessment. Learn more about setting SQL vulnerability assessment with managed identity - https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance for which the vulnerability assessment is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. parameters - The requested resource. options - ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.VulnerabilityAssessmentName("default"),
		armsql.ManagedInstanceVulnerabilityAssessment{
			Properties: &armsql.ManagedInstanceVulnerabilityAssessmentProperties{
				RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{
					EmailSubscriptionAdmins: to.BoolPtr(true),
					Emails: []*string{
						to.StringPtr("email1@mail.com"),
						to.StringPtr("email2@mail.com")},
					IsEnabled: to.BoolPtr(true),
				},
				StorageAccountAccessKey: to.StringPtr("<storage-account-access-key>"),
				StorageContainerPath:    to.StringPtr("<storage-container-path>"),
				StorageContainerSasKey:  to.StringPtr("<storage-container-sas-key>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResult)
}
Output:

func (*ManagedInstanceVulnerabilityAssessmentsClient) Delete

Delete - Removes the managed instance's vulnerability assessment. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance for which the vulnerability assessment is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. options - ManagedInstanceVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.VulnerabilityAssessmentName("default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedInstanceVulnerabilityAssessmentsClient) Get

Get - Gets the managed instance's vulnerability assessment. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance for which the vulnerability assessment is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. options - ManagedInstanceVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.VulnerabilityAssessmentName("default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstanceVulnerabilityAssessmentsClientGetResult)
}
Output:

func (*ManagedInstanceVulnerabilityAssessmentsClient) ListByInstance

ListByInstance - Gets the managed instance's vulnerability assessment policies. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance for which the vulnerability assessments is defined. options - ManagedInstanceVulnerabilityAssessmentsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.ListByInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentListByInstance.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstanceVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	pager := client.ListByInstance("<resource-group-name>",
		"<managed-instance-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateOptions added in v0.3.0

type ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateOptions struct {
}

ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.CreateOrUpdate method.

type ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResponse added in v0.3.0

type ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResponse struct {
	ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResponse contains the response from method ManagedInstanceVulnerabilityAssessmentsClient.CreateOrUpdate.

type ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResult added in v0.3.0

type ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResult struct {
	ManagedInstanceVulnerabilityAssessment
}

ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResult contains the result from method ManagedInstanceVulnerabilityAssessmentsClient.CreateOrUpdate.

type ManagedInstanceVulnerabilityAssessmentsClientDeleteOptions added in v0.3.0

type ManagedInstanceVulnerabilityAssessmentsClientDeleteOptions struct {
}

ManagedInstanceVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.Delete method.

type ManagedInstanceVulnerabilityAssessmentsClientDeleteResponse added in v0.3.0

type ManagedInstanceVulnerabilityAssessmentsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceVulnerabilityAssessmentsClientDeleteResponse contains the response from method ManagedInstanceVulnerabilityAssessmentsClient.Delete.

type ManagedInstanceVulnerabilityAssessmentsClientGetOptions added in v0.3.0

type ManagedInstanceVulnerabilityAssessmentsClientGetOptions struct {
}

ManagedInstanceVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.Get method.

type ManagedInstanceVulnerabilityAssessmentsClientGetResponse added in v0.3.0

type ManagedInstanceVulnerabilityAssessmentsClientGetResponse struct {
	ManagedInstanceVulnerabilityAssessmentsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceVulnerabilityAssessmentsClientGetResponse contains the response from method ManagedInstanceVulnerabilityAssessmentsClient.Get.

type ManagedInstanceVulnerabilityAssessmentsClientGetResult added in v0.3.0

type ManagedInstanceVulnerabilityAssessmentsClientGetResult struct {
	ManagedInstanceVulnerabilityAssessment
}

ManagedInstanceVulnerabilityAssessmentsClientGetResult contains the result from method ManagedInstanceVulnerabilityAssessmentsClient.Get.

type ManagedInstanceVulnerabilityAssessmentsClientListByInstanceOptions added in v0.3.0

type ManagedInstanceVulnerabilityAssessmentsClientListByInstanceOptions struct {
}

ManagedInstanceVulnerabilityAssessmentsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.ListByInstance method.

type ManagedInstanceVulnerabilityAssessmentsClientListByInstancePager added in v0.3.0

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

ManagedInstanceVulnerabilityAssessmentsClientListByInstancePager provides operations for iterating over paged responses.

func (*ManagedInstanceVulnerabilityAssessmentsClientListByInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedInstanceVulnerabilityAssessmentsClientListByInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedInstanceVulnerabilityAssessmentsClientListByInstancePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResponse page.

type ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResponse added in v0.3.0

type ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResponse struct {
	ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResponse contains the response from method ManagedInstanceVulnerabilityAssessmentsClient.ListByInstance.

type ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResult added in v0.3.0

type ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResult struct {
	ManagedInstanceVulnerabilityAssessmentListResult
}

ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResult contains the result from method ManagedInstanceVulnerabilityAssessmentsClient.ListByInstance.

type ManagedInstancesClient

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

ManagedInstancesClient contains the methods for the ManagedInstances group. Don't use this type directly, use NewManagedInstancesClient() instead.

func NewManagedInstancesClient

func NewManagedInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedInstancesClient

NewManagedInstancesClient creates a new instance of ManagedInstancesClient with the specified values. subscriptionID - The 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 (*ManagedInstancesClient) BeginCreateOrUpdate

func (client *ManagedInstancesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstance, options *ManagedInstancesClientBeginCreateOrUpdateOptions) (ManagedInstancesClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates a managed instance. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. parameters - The requested managed instance resource state. options - ManagedInstancesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstancesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceCreateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstancesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.ManagedInstance{
			Location: to.StringPtr("<location>"),
			Tags: map[string]*string{
				"tagKey1": to.StringPtr("TagValue1"),
			},
			Properties: &armsql.ManagedInstanceProperties{
				AdministratorLogin:         to.StringPtr("<administrator-login>"),
				AdministratorLoginPassword: to.StringPtr("<administrator-login-password>"),
				Administrators: &armsql.ManagedInstanceExternalAdministrator{
					AzureADOnlyAuthentication: to.BoolPtr(true),
					Login:                     to.StringPtr("<login>"),
					PrincipalType:             armsql.PrincipalType("User").ToPtr(),
					Sid:                       to.StringPtr("<sid>"),
					TenantID:                  to.StringPtr("<tenant-id>"),
				},
				Collation:                        to.StringPtr("<collation>"),
				DNSZonePartner:                   to.StringPtr("<dnszone-partner>"),
				InstancePoolID:                   to.StringPtr("<instance-pool-id>"),
				LicenseType:                      armsql.ManagedInstanceLicenseType("LicenseIncluded").ToPtr(),
				MaintenanceConfigurationID:       to.StringPtr("<maintenance-configuration-id>"),
				MinimalTLSVersion:                to.StringPtr("<minimal-tlsversion>"),
				ProxyOverride:                    armsql.ManagedInstanceProxyOverride("Redirect").ToPtr(),
				PublicDataEndpointEnabled:        to.BoolPtr(false),
				RequestedBackupStorageRedundancy: armsql.BackupStorageRedundancy("Geo").ToPtr(),
				ServicePrincipal: &armsql.ServicePrincipal{
					Type: armsql.ServicePrincipalType("SystemAssigned").ToPtr(),
				},
				StorageSizeInGB: to.Int32Ptr(1024),
				SubnetID:        to.StringPtr("<subnet-id>"),
				TimezoneID:      to.StringPtr("<timezone-id>"),
				VCores:          to.Int32Ptr(8),
			},
			SKU: &armsql.SKU{
				Name: to.StringPtr("<name>"),
				Tier: to.StringPtr("<tier>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstancesClientCreateOrUpdateResult)
}
Output:

func (*ManagedInstancesClient) BeginDelete

func (client *ManagedInstancesClient) BeginDelete(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginDeleteOptions) (ManagedInstancesClientDeletePollerResponse, error)

BeginDelete - Deletes a managed instance. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstancesClientBeginDeleteOptions contains the optional parameters for the ManagedInstancesClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstancesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedInstancesClient) BeginFailover

func (client *ManagedInstancesClient) BeginFailover(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginFailoverOptions) (ManagedInstancesClientFailoverPollerResponse, error)

BeginFailover - Failovers a managed instance. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance to failover. options - ManagedInstancesClientBeginFailoverOptions contains the optional parameters for the ManagedInstancesClient.BeginFailover method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/FailoverManagedInstance.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstancesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginFailover(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		&armsql.ManagedInstancesClientBeginFailoverOptions{ReplicaType: armsql.ReplicaType("Primary").ToPtr()})
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ManagedInstancesClient) BeginUpdate

func (client *ManagedInstancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstanceUpdate, options *ManagedInstancesClientBeginUpdateOptions) (ManagedInstancesClientUpdatePollerResponse, error)

BeginUpdate - Updates a managed instance. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. parameters - The requested managed instance resource state. options - ManagedInstancesClientBeginUpdateOptions contains the optional parameters for the ManagedInstancesClient.BeginUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceRemoveMaintenanceConfiguration.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstancesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.ManagedInstanceUpdate{
			Properties: &armsql.ManagedInstanceProperties{
				MaintenanceConfigurationID: to.StringPtr("<maintenance-configuration-id>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstancesClientUpdateResult)
}
Output:

func (*ManagedInstancesClient) Get

func (client *ManagedInstancesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientGetOptions) (ManagedInstancesClientGetResponse, error)

Get - Gets a managed instance. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstancesClientGetOptions contains the optional parameters for the ManagedInstancesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstancesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		&armsql.ManagedInstancesClientGetOptions{Expand: nil})
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedInstancesClientGetResult)
}
Output:

func (*ManagedInstancesClient) List

List - Gets a list of all managed instances in the subscription. If the operation fails it returns an *azcore.ResponseError type. options - ManagedInstancesClientListOptions contains the optional parameters for the ManagedInstancesClient.List method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstancesClient("<subscription-id>", cred, nil)
	pager := client.List(&armsql.ManagedInstancesClientListOptions{Expand: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*ManagedInstancesClient) ListByInstancePool

func (client *ManagedInstancesClient) ListByInstancePool(resourceGroupName string, instancePoolName string, options *ManagedInstancesClientListByInstancePoolOptions) *ManagedInstancesClientListByInstancePoolPager

ListByInstancePool - Gets a list of all managed instances in an instance pool. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. instancePoolName - The instance pool name. options - ManagedInstancesClientListByInstancePoolOptions contains the optional parameters for the ManagedInstancesClient.ListByInstancePool method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByInstancePool.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstancesClient("<subscription-id>", cred, nil)
	pager := client.ListByInstancePool("<resource-group-name>",
		"<instance-pool-name>",
		&armsql.ManagedInstancesClientListByInstancePoolOptions{Expand: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*ManagedInstancesClient) ListByManagedInstance

func (client *ManagedInstancesClient) ListByManagedInstance(resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientListByManagedInstanceOptions) *ManagedInstancesClientListByManagedInstancePager

ListByManagedInstance - Get top resource consuming queries of a managed instance. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedInstancesClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancesClient.ListByManagedInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceTopQueriesList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstancesClient("<subscription-id>", cred, nil)
	pager := client.ListByManagedInstance("<resource-group-name>",
		"<managed-instance-name>",
		&armsql.ManagedInstancesClientListByManagedInstanceOptions{NumberOfQueries: nil,
			Databases:           nil,
			StartTime:           nil,
			EndTime:             nil,
			Interval:            armsql.QueryTimeGrainType("PT1H").ToPtr(),
			AggregationFunction: nil,
			ObservationMetric:   armsql.MetricType("duration").ToPtr(),
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*ManagedInstancesClient) ListByResourceGroup

ListByResourceGroup - Gets a list of managed instances in a resource group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. options - ManagedInstancesClientListByResourceGroupOptions contains the optional parameters for the ManagedInstancesClient.ListByResourceGroup method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedInstancesClient("<subscription-id>", cred, nil)
	pager := client.ListByResourceGroup("<resource-group-name>",
		&armsql.ManagedInstancesClientListByResourceGroupOptions{Expand: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedInstancesClientBeginCreateOrUpdateOptions added in v0.3.0

type ManagedInstancesClientBeginCreateOrUpdateOptions struct {
}

ManagedInstancesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstancesClient.BeginCreateOrUpdate method.

type ManagedInstancesClientBeginDeleteOptions added in v0.3.0

type ManagedInstancesClientBeginDeleteOptions struct {
}

ManagedInstancesClientBeginDeleteOptions contains the optional parameters for the ManagedInstancesClient.BeginDelete method.

type ManagedInstancesClientBeginFailoverOptions added in v0.3.0

type ManagedInstancesClientBeginFailoverOptions struct {
	// The type of replica to be failed over.
	ReplicaType *ReplicaType
}

ManagedInstancesClientBeginFailoverOptions contains the optional parameters for the ManagedInstancesClient.BeginFailover method.

type ManagedInstancesClientBeginUpdateOptions added in v0.3.0

type ManagedInstancesClientBeginUpdateOptions struct {
}

ManagedInstancesClientBeginUpdateOptions contains the optional parameters for the ManagedInstancesClient.BeginUpdate method.

type ManagedInstancesClientCreateOrUpdatePoller added in v0.3.0

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

ManagedInstancesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstancesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstancesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstancesClientCreateOrUpdateResponse will be returned.

func (*ManagedInstancesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstancesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstancesClientCreateOrUpdatePollerResponse added in v0.3.0

type ManagedInstancesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstancesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancesClientCreateOrUpdatePollerResponse contains the response from method ManagedInstancesClient.CreateOrUpdate.

func (ManagedInstancesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstancesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstancesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ManagedInstancesClientCreateOrUpdateResponse added in v0.3.0

type ManagedInstancesClientCreateOrUpdateResponse struct {
	ManagedInstancesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancesClientCreateOrUpdateResponse contains the response from method ManagedInstancesClient.CreateOrUpdate.

type ManagedInstancesClientCreateOrUpdateResult added in v0.3.0

type ManagedInstancesClientCreateOrUpdateResult struct {
	ManagedInstance
}

ManagedInstancesClientCreateOrUpdateResult contains the result from method ManagedInstancesClient.CreateOrUpdate.

type ManagedInstancesClientDeletePoller added in v0.3.0

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

ManagedInstancesClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstancesClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstancesClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstancesClientDeleteResponse will be returned.

func (*ManagedInstancesClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstancesClientDeletePoller) ResumeToken added in v0.3.0

func (p *ManagedInstancesClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstancesClientDeletePollerResponse added in v0.3.0

type ManagedInstancesClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstancesClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancesClientDeletePollerResponse contains the response from method ManagedInstancesClient.Delete.

func (ManagedInstancesClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstancesClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstancesClientDeletePollerResponse from the provided client and resume token.

type ManagedInstancesClientDeleteResponse added in v0.3.0

type ManagedInstancesClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancesClientDeleteResponse contains the response from method ManagedInstancesClient.Delete.

type ManagedInstancesClientFailoverPoller added in v0.3.0

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

ManagedInstancesClientFailoverPoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstancesClientFailoverPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstancesClientFailoverPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstancesClientFailoverResponse will be returned.

func (*ManagedInstancesClientFailoverPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstancesClientFailoverPoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstancesClientFailoverPollerResponse added in v0.3.0

type ManagedInstancesClientFailoverPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstancesClientFailoverPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancesClientFailoverPollerResponse contains the response from method ManagedInstancesClient.Failover.

func (ManagedInstancesClientFailoverPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstancesClientFailoverPollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstancesClientFailoverPollerResponse from the provided client and resume token.

type ManagedInstancesClientFailoverResponse added in v0.3.0

type ManagedInstancesClientFailoverResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancesClientFailoverResponse contains the response from method ManagedInstancesClient.Failover.

type ManagedInstancesClientGetOptions added in v0.3.0

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

ManagedInstancesClientGetOptions contains the optional parameters for the ManagedInstancesClient.Get method.

type ManagedInstancesClientGetResponse added in v0.3.0

type ManagedInstancesClientGetResponse struct {
	ManagedInstancesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancesClientGetResponse contains the response from method ManagedInstancesClient.Get.

type ManagedInstancesClientGetResult added in v0.3.0

type ManagedInstancesClientGetResult struct {
	ManagedInstance
}

ManagedInstancesClientGetResult contains the result from method ManagedInstancesClient.Get.

type ManagedInstancesClientListByInstancePoolOptions added in v0.3.0

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

ManagedInstancesClientListByInstancePoolOptions contains the optional parameters for the ManagedInstancesClient.ListByInstancePool method.

type ManagedInstancesClientListByInstancePoolPager added in v0.3.0

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

ManagedInstancesClientListByInstancePoolPager provides operations for iterating over paged responses.

func (*ManagedInstancesClientListByInstancePoolPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedInstancesClientListByInstancePoolPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedInstancesClientListByInstancePoolPager) PageResponse added in v0.3.0

PageResponse returns the current ManagedInstancesClientListByInstancePoolResponse page.

type ManagedInstancesClientListByInstancePoolResponse added in v0.3.0

type ManagedInstancesClientListByInstancePoolResponse struct {
	ManagedInstancesClientListByInstancePoolResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancesClientListByInstancePoolResponse contains the response from method ManagedInstancesClient.ListByInstancePool.

type ManagedInstancesClientListByInstancePoolResult added in v0.3.0

type ManagedInstancesClientListByInstancePoolResult struct {
	ManagedInstanceListResult
}

ManagedInstancesClientListByInstancePoolResult contains the result from method ManagedInstancesClient.ListByInstancePool.

type ManagedInstancesClientListByManagedInstanceOptions added in v0.3.0

type ManagedInstancesClientListByManagedInstanceOptions struct {
	// Aggregation function to be used, default value is 'sum'
	AggregationFunction *AggregationFunctionType
	// Comma separated list of databases to be included into search. All DB's are included if this parameter is not specified.
	Databases *string
	// End time for observed period.
	EndTime *string
	// The time step to be used to summarize the metric values. Default value is PT1H
	Interval *QueryTimeGrainType
	// How many 'top queries' to return. Default is 5.
	NumberOfQueries *int32
	// Metric to be used for ranking top queries. Default is 'cpu'
	ObservationMetric *MetricType
	// Start time for observed period.
	StartTime *string
}

ManagedInstancesClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancesClient.ListByManagedInstance method.

type ManagedInstancesClientListByManagedInstancePager added in v0.3.0

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

ManagedInstancesClientListByManagedInstancePager provides operations for iterating over paged responses.

func (*ManagedInstancesClientListByManagedInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedInstancesClientListByManagedInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedInstancesClientListByManagedInstancePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedInstancesClientListByManagedInstanceResponse page.

type ManagedInstancesClientListByManagedInstanceResponse added in v0.3.0

type ManagedInstancesClientListByManagedInstanceResponse struct {
	ManagedInstancesClientListByManagedInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancesClientListByManagedInstanceResponse contains the response from method ManagedInstancesClient.ListByManagedInstance.

type ManagedInstancesClientListByManagedInstanceResult added in v0.3.0

type ManagedInstancesClientListByManagedInstanceResult struct {
	TopQueriesListResult
}

ManagedInstancesClientListByManagedInstanceResult contains the result from method ManagedInstancesClient.ListByManagedInstance.

type ManagedInstancesClientListByResourceGroupOptions added in v0.3.0

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

ManagedInstancesClientListByResourceGroupOptions contains the optional parameters for the ManagedInstancesClient.ListByResourceGroup method.

type ManagedInstancesClientListByResourceGroupPager added in v0.3.0

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

ManagedInstancesClientListByResourceGroupPager provides operations for iterating over paged responses.

func (*ManagedInstancesClientListByResourceGroupPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedInstancesClientListByResourceGroupPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedInstancesClientListByResourceGroupPager) PageResponse added in v0.3.0

PageResponse returns the current ManagedInstancesClientListByResourceGroupResponse page.

type ManagedInstancesClientListByResourceGroupResponse added in v0.3.0

type ManagedInstancesClientListByResourceGroupResponse struct {
	ManagedInstancesClientListByResourceGroupResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancesClientListByResourceGroupResponse contains the response from method ManagedInstancesClient.ListByResourceGroup.

type ManagedInstancesClientListByResourceGroupResult added in v0.3.0

type ManagedInstancesClientListByResourceGroupResult struct {
	ManagedInstanceListResult
}

ManagedInstancesClientListByResourceGroupResult contains the result from method ManagedInstancesClient.ListByResourceGroup.

type ManagedInstancesClientListOptions added in v0.3.0

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

ManagedInstancesClientListOptions contains the optional parameters for the ManagedInstancesClient.List method.

type ManagedInstancesClientListPager added in v0.3.0

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

ManagedInstancesClientListPager provides operations for iterating over paged responses.

func (*ManagedInstancesClientListPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedInstancesClientListPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedInstancesClientListPager) PageResponse added in v0.3.0

PageResponse returns the current ManagedInstancesClientListResponse page.

type ManagedInstancesClientListResponse added in v0.3.0

type ManagedInstancesClientListResponse struct {
	ManagedInstancesClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancesClientListResponse contains the response from method ManagedInstancesClient.List.

type ManagedInstancesClientListResult added in v0.3.0

type ManagedInstancesClientListResult struct {
	ManagedInstanceListResult
}

ManagedInstancesClientListResult contains the result from method ManagedInstancesClient.List.

type ManagedInstancesClientUpdatePoller added in v0.3.0

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

ManagedInstancesClientUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedInstancesClientUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedInstancesClientUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedInstancesClientUpdateResponse will be returned.

func (*ManagedInstancesClientUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedInstancesClientUpdatePoller) ResumeToken added in v0.3.0

func (p *ManagedInstancesClientUpdatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedInstancesClientUpdatePollerResponse added in v0.3.0

type ManagedInstancesClientUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedInstancesClientUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancesClientUpdatePollerResponse contains the response from method ManagedInstancesClient.Update.

func (ManagedInstancesClientUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedInstancesClientUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedInstancesClientUpdatePollerResponse from the provided client and resume token.

type ManagedInstancesClientUpdateResponse added in v0.3.0

type ManagedInstancesClientUpdateResponse struct {
	ManagedInstancesClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedInstancesClientUpdateResponse contains the response from method ManagedInstancesClient.Update.

type ManagedInstancesClientUpdateResult added in v0.3.0

type ManagedInstancesClientUpdateResult struct {
	ManagedInstance
}

ManagedInstancesClientUpdateResult contains the result from method ManagedInstancesClient.Update.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient

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

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient contains the methods for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies group. Don't use this type directly, use NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient() instead.

func NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient

func NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient

NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient creates a new instance of ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient with the specified values. subscriptionID - The 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 (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Sets a database's short term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. policyName - The policy name. Should always be "default". parameters - The short term retention policy info. options - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicyRestorableDropped.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<restorable-dropped-database-id>",
		armsql.ManagedShortTermRetentionPolicyName("default"),
		armsql.ManagedBackupShortTermRetentionPolicy{
			Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{
				RetentionDays: to.Int32Ptr(14),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResult)
}
Output:

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) BeginUpdate

BeginUpdate - Sets a database's short term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. policyName - The policy name. Should always be "default". parameters - The short term retention policy info. options - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicyRestorableDropped.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<restorable-dropped-database-id>",
		armsql.ManagedShortTermRetentionPolicyName("default"),
		armsql.ManagedBackupShortTermRetentionPolicy{
			Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{
				RetentionDays: to.Int32Ptr(14),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResult)
}
Output:

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) Get

Get - Gets a dropped database's short term retention policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. policyName - The policy name. options - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicyRestorableDropped.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<restorable-dropped-database-id>",
		armsql.ManagedShortTermRetentionPolicyName("default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResult)
}
Output:

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) ListByRestorableDroppedDatabase

ListByRestorableDroppedDatabase - Gets a dropped database's short term retention policy list. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseOptions contains the optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.ListByRestorableDroppedDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicyRestorableDropped.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient("<subscription-id>", cred, nil)
	pager := client.ListByRestorableDroppedDatabase("<resource-group-name>",
		"<managed-instance-name>",
		"<restorable-dropped-database-id>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions added in v0.3.0

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct {
}

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate method.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions added in v0.3.0

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions struct {
}

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginUpdate method.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdatePoller added in v0.3.0

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

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse will be returned.

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse added in v0.3.0

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse contains the response from method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.CreateOrUpdate.

func (ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse added in v0.3.0

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse struct {
	ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.CreateOrUpdate.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResult added in v0.3.0

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResult struct {
	ManagedBackupShortTermRetentionPolicy
}

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResult contains the result from method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.CreateOrUpdate.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions added in v0.3.0

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions struct {
}

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Get method.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResponse added in v0.3.0

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResponse struct {
	ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResponse contains the response from method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Get.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResult added in v0.3.0

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResult struct {
	ManagedBackupShortTermRetentionPolicy
}

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResult contains the result from method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Get.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseOptions added in v0.3.0

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseOptions struct {
}

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseOptions contains the optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.ListByRestorableDroppedDatabase method.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabasePager added in v0.3.0

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

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabasePager provides operations for iterating over paged responses.

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseResponse page.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseResponse added in v0.3.0

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseResponse struct {
	ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseResponse contains the response from method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.ListByRestorableDroppedDatabase.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseResult added in v0.3.0

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseResult struct {
	ManagedBackupShortTermRetentionPolicyListResult
}

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseResult contains the result from method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.ListByRestorableDroppedDatabase.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdatePoller added in v0.3.0

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

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResponse will be returned.

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdatePollerResponse added in v0.3.0

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdatePollerResponse contains the response from method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Update.

func (ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdatePollerResponse from the provided client and resume token.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResponse added in v0.3.0

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResponse struct {
	ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResponse contains the response from method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Update.

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResult added in v0.3.0

type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResult struct {
	ManagedBackupShortTermRetentionPolicy
}

ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResult contains the result from method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Update.

type ManagedServerCreateMode

type ManagedServerCreateMode string

ManagedServerCreateMode - Specifies the mode of database creation. Default: Regular instance creation. Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified.

const (
	ManagedServerCreateModeDefault            ManagedServerCreateMode = "Default"
	ManagedServerCreateModePointInTimeRestore ManagedServerCreateMode = "PointInTimeRestore"
)

func PossibleManagedServerCreateModeValues

func PossibleManagedServerCreateModeValues() []ManagedServerCreateMode

PossibleManagedServerCreateModeValues returns the possible values for the ManagedServerCreateMode const type.

func (ManagedServerCreateMode) ToPtr

ToPtr returns a *ManagedServerCreateMode pointing to the current value.

type ManagedServerSecurityAlertPoliciesClient

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

ManagedServerSecurityAlertPoliciesClient contains the methods for the ManagedServerSecurityAlertPolicies group. Don't use this type directly, use NewManagedServerSecurityAlertPoliciesClient() instead.

func NewManagedServerSecurityAlertPoliciesClient

func NewManagedServerSecurityAlertPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagedServerSecurityAlertPoliciesClient

NewManagedServerSecurityAlertPoliciesClient creates a new instance of ManagedServerSecurityAlertPoliciesClient with the specified values. subscriptionID - The 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 (*ManagedServerSecurityAlertPoliciesClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates a threat detection policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. securityAlertPolicyName - The name of the security alert policy. parameters - The managed server security alert policy. options - ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertCreateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedServerSecurityAlertPoliciesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.SecurityAlertPolicyName("Default"),
		armsql.ManagedServerSecurityAlertPolicy{
			Properties: &armsql.SecurityAlertsPolicyProperties{
				DisabledAlerts: []*string{
					to.StringPtr("Access_Anomaly"),
					to.StringPtr("Usage_Anomaly")},
				EmailAccountAdmins: to.BoolPtr(true),
				EmailAddresses: []*string{
					to.StringPtr("testSecurityAlert@microsoft.com")},
				RetentionDays:           to.Int32Ptr(5),
				State:                   armsql.SecurityAlertsPolicyStateEnabled.ToPtr(),
				StorageAccountAccessKey: to.StringPtr("<storage-account-access-key>"),
				StorageEndpoint:         to.StringPtr("<storage-endpoint>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResult)
}
Output:

func (*ManagedServerSecurityAlertPoliciesClient) Get

Get - Get a managed server's threat detection policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. securityAlertPolicyName - The name of the security alert policy. options - ManagedServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedServerSecurityAlertPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		armsql.SecurityAlertPolicyName("Default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ManagedServerSecurityAlertPoliciesClientGetResult)
}
Output:

func (*ManagedServerSecurityAlertPoliciesClient) ListByInstance

ListByInstance - Get the managed server's threat detection policies. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ManagedServerSecurityAlertPoliciesClientListByInstanceOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.ListByInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertListByInstance.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewManagedServerSecurityAlertPoliciesClient("<subscription-id>", cred, nil)
	pager := client.ListByInstance("<resource-group-name>",
		"<managed-instance-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions added in v0.3.0

type ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions struct {
}

ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.BeginCreateOrUpdate method.

type ManagedServerSecurityAlertPoliciesClientCreateOrUpdatePoller added in v0.3.0

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

ManagedServerSecurityAlertPoliciesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ManagedServerSecurityAlertPoliciesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ManagedServerSecurityAlertPoliciesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse will be returned.

func (*ManagedServerSecurityAlertPoliciesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ManagedServerSecurityAlertPoliciesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ManagedServerSecurityAlertPoliciesClientCreateOrUpdatePollerResponse added in v0.3.0

type ManagedServerSecurityAlertPoliciesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ManagedServerSecurityAlertPoliciesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedServerSecurityAlertPoliciesClientCreateOrUpdatePollerResponse contains the response from method ManagedServerSecurityAlertPoliciesClient.CreateOrUpdate.

func (ManagedServerSecurityAlertPoliciesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ManagedServerSecurityAlertPoliciesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ManagedServerSecurityAlertPoliciesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse added in v0.3.0

type ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse struct {
	ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method ManagedServerSecurityAlertPoliciesClient.CreateOrUpdate.

type ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResult added in v0.3.0

type ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResult struct {
	ManagedServerSecurityAlertPolicy
}

ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResult contains the result from method ManagedServerSecurityAlertPoliciesClient.CreateOrUpdate.

type ManagedServerSecurityAlertPoliciesClientGetOptions added in v0.3.0

type ManagedServerSecurityAlertPoliciesClientGetOptions struct {
}

ManagedServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.Get method.

type ManagedServerSecurityAlertPoliciesClientGetResponse added in v0.3.0

type ManagedServerSecurityAlertPoliciesClientGetResponse struct {
	ManagedServerSecurityAlertPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedServerSecurityAlertPoliciesClientGetResponse contains the response from method ManagedServerSecurityAlertPoliciesClient.Get.

type ManagedServerSecurityAlertPoliciesClientGetResult added in v0.3.0

type ManagedServerSecurityAlertPoliciesClientGetResult struct {
	ManagedServerSecurityAlertPolicy
}

ManagedServerSecurityAlertPoliciesClientGetResult contains the result from method ManagedServerSecurityAlertPoliciesClient.Get.

type ManagedServerSecurityAlertPoliciesClientListByInstanceOptions added in v0.3.0

type ManagedServerSecurityAlertPoliciesClientListByInstanceOptions struct {
}

ManagedServerSecurityAlertPoliciesClientListByInstanceOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.ListByInstance method.

type ManagedServerSecurityAlertPoliciesClientListByInstancePager added in v0.3.0

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

ManagedServerSecurityAlertPoliciesClientListByInstancePager provides operations for iterating over paged responses.

func (*ManagedServerSecurityAlertPoliciesClientListByInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ManagedServerSecurityAlertPoliciesClientListByInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ManagedServerSecurityAlertPoliciesClientListByInstancePager) PageResponse added in v0.3.0

PageResponse returns the current ManagedServerSecurityAlertPoliciesClientListByInstanceResponse page.

type ManagedServerSecurityAlertPoliciesClientListByInstanceResponse added in v0.3.0

type ManagedServerSecurityAlertPoliciesClientListByInstanceResponse struct {
	ManagedServerSecurityAlertPoliciesClientListByInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ManagedServerSecurityAlertPoliciesClientListByInstanceResponse contains the response from method ManagedServerSecurityAlertPoliciesClient.ListByInstance.

type ManagedServerSecurityAlertPoliciesClientListByInstanceResult added in v0.3.0

type ManagedServerSecurityAlertPoliciesClientListByInstanceResult struct {
	ManagedServerSecurityAlertPolicyListResult
}

ManagedServerSecurityAlertPoliciesClientListByInstanceResult contains the result from method ManagedServerSecurityAlertPoliciesClient.ListByInstance.

type ManagedServerSecurityAlertPolicy

type ManagedServerSecurityAlertPolicy struct {
	// Resource properties.
	Properties *SecurityAlertsPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; SystemData of SecurityAlertPolicyResource.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedServerSecurityAlertPolicy - A managed server security alert policy.

type ManagedServerSecurityAlertPolicyListResult

type ManagedServerSecurityAlertPolicyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedServerSecurityAlertPolicy `json:"value,omitempty" azure:"ro"`
}

ManagedServerSecurityAlertPolicyListResult - A list of the managed Server's security alert policies.

func (ManagedServerSecurityAlertPolicyListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ManagedServerSecurityAlertPolicyListResult.

type ManagedShortTermRetentionPolicyName

type ManagedShortTermRetentionPolicyName string
const (
	ManagedShortTermRetentionPolicyNameDefault ManagedShortTermRetentionPolicyName = "default"
)

func PossibleManagedShortTermRetentionPolicyNameValues

func PossibleManagedShortTermRetentionPolicyNameValues() []ManagedShortTermRetentionPolicyName

PossibleManagedShortTermRetentionPolicyNameValues returns the possible values for the ManagedShortTermRetentionPolicyName const type.

func (ManagedShortTermRetentionPolicyName) ToPtr

ToPtr returns a *ManagedShortTermRetentionPolicyName pointing to the current value.

type ManagedTransparentDataEncryption

type ManagedTransparentDataEncryption struct {
	// Resource properties.
	Properties *ManagedTransparentDataEncryptionProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedTransparentDataEncryption - A managed database transparent data encryption state.

type ManagedTransparentDataEncryptionListResult

type ManagedTransparentDataEncryptionListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ManagedTransparentDataEncryption `json:"value,omitempty" azure:"ro"`
}

ManagedTransparentDataEncryptionListResult - A list of managed transparent data encryptions

func (ManagedTransparentDataEncryptionListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type ManagedTransparentDataEncryptionListResult.

type ManagedTransparentDataEncryptionProperties

type ManagedTransparentDataEncryptionProperties struct {
	// REQUIRED; Specifies the state of the transparent data encryption.
	State *TransparentDataEncryptionState `json:"state,omitempty"`
}

ManagedTransparentDataEncryptionProperties - Properties of a transparent data encryption.

type ManagementOperationState

type ManagementOperationState string

ManagementOperationState - The operation state.

const (
	ManagementOperationStateCancelInProgress ManagementOperationState = "CancelInProgress"
	ManagementOperationStateCancelled        ManagementOperationState = "Cancelled"
	ManagementOperationStateFailed           ManagementOperationState = "Failed"
	ManagementOperationStateInProgress       ManagementOperationState = "InProgress"
	ManagementOperationStatePending          ManagementOperationState = "Pending"
	ManagementOperationStateSucceeded        ManagementOperationState = "Succeeded"
)

func PossibleManagementOperationStateValues

func PossibleManagementOperationStateValues() []ManagementOperationState

PossibleManagementOperationStateValues returns the possible values for the ManagementOperationState const type.

func (ManagementOperationState) ToPtr

ToPtr returns a *ManagementOperationState pointing to the current value.

type MaxSizeCapability

type MaxSizeCapability struct {
	// READ-ONLY; The maximum size limit (see 'unit' for the units).
	Limit *int32 `json:"limit,omitempty" azure:"ro"`

	// READ-ONLY; The units that the limit is expressed in.
	Unit *MaxSizeUnit `json:"unit,omitempty" azure:"ro"`
}

MaxSizeCapability - The maximum size capability.

type MaxSizeRangeCapability

type MaxSizeRangeCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; Size of transaction log.
	LogSize *LogSizeCapability `json:"logSize,omitempty" azure:"ro"`

	// READ-ONLY; Maximum value.
	MaxValue *MaxSizeCapability `json:"maxValue,omitempty" azure:"ro"`

	// READ-ONLY; Minimum value.
	MinValue *MaxSizeCapability `json:"minValue,omitempty" azure:"ro"`

	// READ-ONLY; Scale/step size for discrete values between the minimum value and the maximum value.
	ScaleSize *MaxSizeCapability `json:"scaleSize,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`
}

MaxSizeRangeCapability - The maximum size range capability.

type MaxSizeUnit

type MaxSizeUnit string

MaxSizeUnit - The units that the limit is expressed in.

const (
	MaxSizeUnitGigabytes MaxSizeUnit = "Gigabytes"
	MaxSizeUnitMegabytes MaxSizeUnit = "Megabytes"
	MaxSizeUnitPetabytes MaxSizeUnit = "Petabytes"
	MaxSizeUnitTerabytes MaxSizeUnit = "Terabytes"
)

func PossibleMaxSizeUnitValues

func PossibleMaxSizeUnitValues() []MaxSizeUnit

PossibleMaxSizeUnitValues returns the possible values for the MaxSizeUnit const type.

func (MaxSizeUnit) ToPtr

func (c MaxSizeUnit) ToPtr() *MaxSizeUnit

ToPtr returns a *MaxSizeUnit pointing to the current value.

type Metric

type Metric struct {
	// READ-ONLY; The end time for the metric (ISO-8601 format).
	EndTime *time.Time `json:"endTime,omitempty" azure:"ro"`

	// READ-ONLY; The metric values for the specified time window and timestep.
	MetricValues []*MetricValue `json:"metricValues,omitempty" azure:"ro"`

	// READ-ONLY; The name information for the metric.
	Name *MetricName `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The start time for the metric (ISO-8601 format).
	StartTime *time.Time `json:"startTime,omitempty" azure:"ro"`

	// READ-ONLY; The time step to be used to summarize the metric values.
	TimeGrain *string `json:"timeGrain,omitempty" azure:"ro"`

	// READ-ONLY; The unit of the metric.
	Unit *UnitType `json:"unit,omitempty" azure:"ro"`
}

Metric - Database metrics.

func (Metric) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Metric.

func (*Metric) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Metric.

type MetricAvailability

type MetricAvailability struct {
	// READ-ONLY; The length of retention for the database metric.
	Retention *string `json:"retention,omitempty" azure:"ro"`

	// READ-ONLY; The granularity of the database metric.
	TimeGrain *string `json:"timeGrain,omitempty" azure:"ro"`
}

MetricAvailability - A metric availability value.

type MetricDefinition

type MetricDefinition struct {
	// READ-ONLY; The list of database metric availabilities for the metric.
	MetricAvailabilities []*MetricAvailability `json:"metricAvailabilities,omitempty" azure:"ro"`

	// READ-ONLY; The name information for the metric.
	Name *MetricName `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The primary aggregation type defining how metric values are displayed.
	PrimaryAggregationType *PrimaryAggregationType `json:"primaryAggregationType,omitempty" azure:"ro"`

	// READ-ONLY; The resource uri of the database.
	ResourceURI *string `json:"resourceUri,omitempty" azure:"ro"`

	// READ-ONLY; The unit of the metric.
	Unit *UnitDefinitionType `json:"unit,omitempty" azure:"ro"`
}

MetricDefinition - A database metric definition.

func (MetricDefinition) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MetricDefinition.

type MetricDefinitionListResult

type MetricDefinitionListResult struct {
	// REQUIRED; The list of metric definitions for the database.
	Value []*MetricDefinition `json:"value,omitempty"`
}

MetricDefinitionListResult - The response to a list database metric definitions request.

func (MetricDefinitionListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MetricDefinitionListResult.

type MetricListResult

type MetricListResult struct {
	// REQUIRED; The list of metrics for the database.
	Value []*Metric `json:"value,omitempty"`
}

MetricListResult - The response to a list database metrics request.

func (MetricListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MetricListResult.

type MetricName

type MetricName struct {
	// READ-ONLY; The friendly name of the database metric.
	LocalizedValue *string `json:"localizedValue,omitempty" azure:"ro"`

	// READ-ONLY; The name of the database metric.
	Value *string `json:"value,omitempty" azure:"ro"`
}

MetricName - A database metric name.

type MetricType

type MetricType string
const (
	MetricTypeCPU      MetricType = "cpu"
	MetricTypeDtu      MetricType = "dtu"
	MetricTypeDuration MetricType = "duration"
	MetricTypeIo       MetricType = "io"
	MetricTypeLogIo    MetricType = "logIo"
)

func PossibleMetricTypeValues

func PossibleMetricTypeValues() []MetricType

PossibleMetricTypeValues returns the possible values for the MetricType const type.

func (MetricType) ToPtr

func (c MetricType) ToPtr() *MetricType

ToPtr returns a *MetricType pointing to the current value.

type MetricValue

type MetricValue struct {
	// READ-ONLY; The average value of the metric.
	Average *float64 `json:"average,omitempty" azure:"ro"`

	// READ-ONLY; The number of values for the metric.
	Count *int32 `json:"count,omitempty" azure:"ro"`

	// READ-ONLY; The max value of the metric.
	Maximum *float64 `json:"maximum,omitempty" azure:"ro"`

	// READ-ONLY; The min value of the metric.
	Minimum *float64 `json:"minimum,omitempty" azure:"ro"`

	// READ-ONLY; The metric timestamp (ISO-8601 format).
	Timestamp *time.Time `json:"timestamp,omitempty" azure:"ro"`

	// READ-ONLY; The total value of the metric.
	Total *float64 `json:"total,omitempty" azure:"ro"`
}

MetricValue - Represents database metrics.

func (MetricValue) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MetricValue.

func (*MetricValue) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type MetricValue.

type MinCapacityCapability

type MinCapacityCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; Min capacity value
	Value *float64 `json:"value,omitempty" azure:"ro"`
}

MinCapacityCapability - The min capacity capability

type Name

type Name struct {
	// Usage name localized value.
	LocalizedValue *string `json:"localizedValue,omitempty"`

	// Usage name value
	Value *string `json:"value,omitempty"`
}

Name - ARM Usage Name

type NetworkIsolationSettings

type NetworkIsolationSettings struct {
	// The resource id for the SQL server which is the target of this request. If set, private endpoint connection will be created
	// for the SQL server. Must match server which is target of the operation.
	SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"`

	// The resource id for the storage account used to store BACPAC file. If set, private endpoint connection will be created
	// for the storage account. Must match storage account used for StorageUri
	// parameter.
	StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
}

NetworkIsolationSettings - Contains the ARM resources for which to create private endpoint connection.

type Operation

type Operation struct {
	// READ-ONLY; The localized display information for this particular operation / action.
	Display *OperationDisplay `json:"display,omitempty" azure:"ro"`

	// READ-ONLY; The name of the operation being performed on this particular object.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The intended executor of the operation.
	Origin *OperationOrigin `json:"origin,omitempty" azure:"ro"`

	// READ-ONLY; Additional descriptions for the operation.
	Properties map[string]map[string]interface{} `json:"properties,omitempty" azure:"ro"`
}

Operation - SQL REST API operation definition.

func (Operation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// READ-ONLY; The localized friendly description for the operation.
	Description *string `json:"description,omitempty" azure:"ro"`

	// READ-ONLY; The localized friendly name for the operation.
	Operation *string `json:"operation,omitempty" azure:"ro"`

	// READ-ONLY; The localized friendly form of the resource provider name.
	Provider *string `json:"provider,omitempty" azure:"ro"`

	// READ-ONLY; The localized friendly form of the resource type related to this action/operation.
	Resource *string `json:"resource,omitempty" azure:"ro"`
}

OperationDisplay - Display metadata associated with the operation.

type OperationImpact

type OperationImpact struct {
	// READ-ONLY; The absolute impact to dimension.
	ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty" azure:"ro"`

	// READ-ONLY; The relative impact to dimension (null if not applicable)
	ChangeValueRelative *float64 `json:"changeValueRelative,omitempty" azure:"ro"`

	// READ-ONLY; The name of the impact dimension.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The unit in which estimated impact to dimension is measured.
	Unit *string `json:"unit,omitempty" azure:"ro"`
}

OperationImpact - The impact of an operation, both in absolute and relative terms.

type OperationListResult

type OperationListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*Operation `json:"value,omitempty" azure:"ro"`
}

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.

type OperationMode

type OperationMode string

OperationMode - Operation Mode.

const (
	OperationModePolybaseImport OperationMode = "PolybaseImport"
)

func PossibleOperationModeValues

func PossibleOperationModeValues() []OperationMode

PossibleOperationModeValues returns the possible values for the OperationMode const type.

func (OperationMode) ToPtr

func (c OperationMode) ToPtr() *OperationMode

ToPtr returns a *OperationMode pointing to the current value.

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.

func (OperationOrigin) ToPtr

func (c OperationOrigin) ToPtr() *OperationOrigin

ToPtr returns a *OperationOrigin pointing to the current value.

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

NewOperationsClient creates a new instance of OperationsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*OperationsClient) List

List - Lists all of the available SQL Rest API operations. If the operation fails it returns an *azcore.ResponseError type. options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.

type OperationsClientListOptions added in v0.3.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListPager added in v0.3.0

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

OperationsClientListPager provides operations for iterating over paged responses.

func (*OperationsClientListPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*OperationsClientListPager) NextPage added in v0.3.0

func (p *OperationsClientListPager) NextPage(ctx context.Context) bool

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*OperationsClientListPager) PageResponse added in v0.3.0

PageResponse returns the current OperationsClientListResponse page.

type OperationsClientListResponse added in v0.3.0

type OperationsClientListResponse struct {
	OperationsClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type OperationsClientListResult added in v0.3.0

type OperationsClientListResult struct {
	OperationListResult
}

OperationsClientListResult contains the result from method OperationsClient.List.

type OutboundFirewallRule

type OutboundFirewallRule struct {
	// Resource properties.
	Properties *OutboundFirewallRuleProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

OutboundFirewallRule - An Azure SQL DB Server Outbound Firewall Rule.

type OutboundFirewallRuleListResult

type OutboundFirewallRuleListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*OutboundFirewallRule `json:"value,omitempty" azure:"ro"`
}

OutboundFirewallRuleListResult - A list of outbound rules.

func (OutboundFirewallRuleListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OutboundFirewallRuleListResult.

type OutboundFirewallRuleProperties

type OutboundFirewallRuleProperties struct {
	// READ-ONLY; The state of the outbound rule.
	ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"`
}

OutboundFirewallRuleProperties - The properties of an outbound firewall rule.

type OutboundFirewallRulesClient

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

OutboundFirewallRulesClient contains the methods for the OutboundFirewallRules group. Don't use this type directly, use NewOutboundFirewallRulesClient() instead.

func NewOutboundFirewallRulesClient

func NewOutboundFirewallRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *OutboundFirewallRulesClient

NewOutboundFirewallRulesClient creates a new instance of OutboundFirewallRulesClient with the specified values. subscriptionID - The 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 (*OutboundFirewallRulesClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Create a outbound firewall rule with a given name. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - OutboundFirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the OutboundFirewallRulesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleCreate.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewOutboundFirewallRulesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<outbound-rule-fqdn>",
		armsql.OutboundFirewallRule{},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.OutboundFirewallRulesClientCreateOrUpdateResult)
}
Output:

func (*OutboundFirewallRulesClient) BeginDelete

func (client *OutboundFirewallRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, options *OutboundFirewallRulesClientBeginDeleteOptions) (OutboundFirewallRulesClientDeletePollerResponse, error)

BeginDelete - Deletes a outbound firewall rule with a given name. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - OutboundFirewallRulesClientBeginDeleteOptions contains the optional parameters for the OutboundFirewallRulesClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewOutboundFirewallRulesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<outbound-rule-fqdn>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*OutboundFirewallRulesClient) Get

func (client *OutboundFirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, options *OutboundFirewallRulesClientGetOptions) (OutboundFirewallRulesClientGetResponse, error)

Get - Gets an outbound firewall rule. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - OutboundFirewallRulesClientGetOptions contains the optional parameters for the OutboundFirewallRulesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewOutboundFirewallRulesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<outbound-rule-fqdn>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.OutboundFirewallRulesClientGetResult)
}
Output:

func (*OutboundFirewallRulesClient) ListByServer

ListByServer - Gets all outbound firewall rules on a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - OutboundFirewallRulesClientListByServerOptions contains the optional parameters for the OutboundFirewallRulesClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewOutboundFirewallRulesClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type OutboundFirewallRulesClientBeginCreateOrUpdateOptions added in v0.3.0

type OutboundFirewallRulesClientBeginCreateOrUpdateOptions struct {
}

OutboundFirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the OutboundFirewallRulesClient.BeginCreateOrUpdate method.

type OutboundFirewallRulesClientBeginDeleteOptions added in v0.3.0

type OutboundFirewallRulesClientBeginDeleteOptions struct {
}

OutboundFirewallRulesClientBeginDeleteOptions contains the optional parameters for the OutboundFirewallRulesClient.BeginDelete method.

type OutboundFirewallRulesClientCreateOrUpdatePoller added in v0.3.0

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

OutboundFirewallRulesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*OutboundFirewallRulesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*OutboundFirewallRulesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final OutboundFirewallRulesClientCreateOrUpdateResponse will be returned.

func (*OutboundFirewallRulesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*OutboundFirewallRulesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type OutboundFirewallRulesClientCreateOrUpdatePollerResponse added in v0.3.0

type OutboundFirewallRulesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *OutboundFirewallRulesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

OutboundFirewallRulesClientCreateOrUpdatePollerResponse contains the response from method OutboundFirewallRulesClient.CreateOrUpdate.

func (OutboundFirewallRulesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*OutboundFirewallRulesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a OutboundFirewallRulesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type OutboundFirewallRulesClientCreateOrUpdateResponse added in v0.3.0

type OutboundFirewallRulesClientCreateOrUpdateResponse struct {
	OutboundFirewallRulesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

OutboundFirewallRulesClientCreateOrUpdateResponse contains the response from method OutboundFirewallRulesClient.CreateOrUpdate.

type OutboundFirewallRulesClientCreateOrUpdateResult added in v0.3.0

type OutboundFirewallRulesClientCreateOrUpdateResult struct {
	OutboundFirewallRule
}

OutboundFirewallRulesClientCreateOrUpdateResult contains the result from method OutboundFirewallRulesClient.CreateOrUpdate.

type OutboundFirewallRulesClientDeletePoller added in v0.3.0

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

OutboundFirewallRulesClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*OutboundFirewallRulesClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*OutboundFirewallRulesClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final OutboundFirewallRulesClientDeleteResponse will be returned.

func (*OutboundFirewallRulesClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*OutboundFirewallRulesClientDeletePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type OutboundFirewallRulesClientDeletePollerResponse added in v0.3.0

type OutboundFirewallRulesClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *OutboundFirewallRulesClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

OutboundFirewallRulesClientDeletePollerResponse contains the response from method OutboundFirewallRulesClient.Delete.

func (OutboundFirewallRulesClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*OutboundFirewallRulesClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a OutboundFirewallRulesClientDeletePollerResponse from the provided client and resume token.

type OutboundFirewallRulesClientDeleteResponse added in v0.3.0

type OutboundFirewallRulesClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

OutboundFirewallRulesClientDeleteResponse contains the response from method OutboundFirewallRulesClient.Delete.

type OutboundFirewallRulesClientGetOptions added in v0.3.0

type OutboundFirewallRulesClientGetOptions struct {
}

OutboundFirewallRulesClientGetOptions contains the optional parameters for the OutboundFirewallRulesClient.Get method.

type OutboundFirewallRulesClientGetResponse added in v0.3.0

type OutboundFirewallRulesClientGetResponse struct {
	OutboundFirewallRulesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

OutboundFirewallRulesClientGetResponse contains the response from method OutboundFirewallRulesClient.Get.

type OutboundFirewallRulesClientGetResult added in v0.3.0

type OutboundFirewallRulesClientGetResult struct {
	OutboundFirewallRule
}

OutboundFirewallRulesClientGetResult contains the result from method OutboundFirewallRulesClient.Get.

type OutboundFirewallRulesClientListByServerOptions added in v0.3.0

type OutboundFirewallRulesClientListByServerOptions struct {
}

OutboundFirewallRulesClientListByServerOptions contains the optional parameters for the OutboundFirewallRulesClient.ListByServer method.

type OutboundFirewallRulesClientListByServerPager added in v0.3.0

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

OutboundFirewallRulesClientListByServerPager provides operations for iterating over paged responses.

func (*OutboundFirewallRulesClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*OutboundFirewallRulesClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*OutboundFirewallRulesClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current OutboundFirewallRulesClientListByServerResponse page.

type OutboundFirewallRulesClientListByServerResponse added in v0.3.0

type OutboundFirewallRulesClientListByServerResponse struct {
	OutboundFirewallRulesClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

OutboundFirewallRulesClientListByServerResponse contains the response from method OutboundFirewallRulesClient.ListByServer.

type OutboundFirewallRulesClientListByServerResult added in v0.3.0

type OutboundFirewallRulesClientListByServerResult struct {
	OutboundFirewallRuleListResult
}

OutboundFirewallRulesClientListByServerResult contains the result from method OutboundFirewallRulesClient.ListByServer.

type PartnerInfo

type PartnerInfo struct {
	// REQUIRED; Resource identifier of the partner server.
	ID *string `json:"id,omitempty"`

	// READ-ONLY; Geo location of the partner server.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Replication role of the partner server.
	ReplicationRole *FailoverGroupReplicationRole `json:"replicationRole,omitempty" azure:"ro"`
}

PartnerInfo - Partner server information for the failover group.

type PartnerRegionInfo

type PartnerRegionInfo struct {
	// Geo location of the partner managed instances.
	Location *string `json:"location,omitempty"`

	// READ-ONLY; Replication role of the partner managed instances.
	ReplicationRole *InstanceFailoverGroupReplicationRole `json:"replicationRole,omitempty" azure:"ro"`
}

PartnerRegionInfo - Partner region information for the failover group.

type PauseDelayTimeUnit

type PauseDelayTimeUnit string

PauseDelayTimeUnit - Unit of time that delay is expressed in

const (
	PauseDelayTimeUnitMinutes PauseDelayTimeUnit = "Minutes"
)

func PossiblePauseDelayTimeUnitValues

func PossiblePauseDelayTimeUnitValues() []PauseDelayTimeUnit

PossiblePauseDelayTimeUnitValues returns the possible values for the PauseDelayTimeUnit const type.

func (PauseDelayTimeUnit) ToPtr

ToPtr returns a *PauseDelayTimeUnit pointing to the current value.

type PerformanceLevelCapability

type PerformanceLevelCapability struct {
	// READ-ONLY; Unit type used to measure performance level.
	Unit *PerformanceLevelUnit `json:"unit,omitempty" azure:"ro"`

	// READ-ONLY; Performance level value.
	Value *float64 `json:"value,omitempty" azure:"ro"`
}

PerformanceLevelCapability - The performance level capability.

type PerformanceLevelUnit

type PerformanceLevelUnit string

PerformanceLevelUnit - Unit type used to measure performance level.

const (
	PerformanceLevelUnitDTU    PerformanceLevelUnit = "DTU"
	PerformanceLevelUnitVCores PerformanceLevelUnit = "VCores"
)

func PossiblePerformanceLevelUnitValues

func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit

PossiblePerformanceLevelUnitValues returns the possible values for the PerformanceLevelUnit const type.

func (PerformanceLevelUnit) ToPtr

ToPtr returns a *PerformanceLevelUnit pointing to the current value.

type PrimaryAggregationType

type PrimaryAggregationType string

PrimaryAggregationType - The primary aggregation type defining how metric values are displayed.

const (
	PrimaryAggregationTypeAverage PrimaryAggregationType = "Average"
	PrimaryAggregationTypeCount   PrimaryAggregationType = "Count"
	PrimaryAggregationTypeMaximum PrimaryAggregationType = "Maximum"
	PrimaryAggregationTypeMinimum PrimaryAggregationType = "Minimum"
	PrimaryAggregationTypeNone    PrimaryAggregationType = "None"
	PrimaryAggregationTypeTotal   PrimaryAggregationType = "Total"
)

func PossiblePrimaryAggregationTypeValues

func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType

PossiblePrimaryAggregationTypeValues returns the possible values for the PrimaryAggregationType const type.

func (PrimaryAggregationType) ToPtr

ToPtr returns a *PrimaryAggregationType pointing to the current value.

type PrincipalType

type PrincipalType string

PrincipalType - Principal Type of the sever administrator.

const (
	PrincipalTypeApplication PrincipalType = "Application"
	PrincipalTypeGroup       PrincipalType = "Group"
	PrincipalTypeUser        PrincipalType = "User"
)

func PossiblePrincipalTypeValues

func PossiblePrincipalTypeValues() []PrincipalType

PossiblePrincipalTypeValues returns the possible values for the PrincipalType const type.

func (PrincipalType) ToPtr

func (c PrincipalType) ToPtr() *PrincipalType

ToPtr returns a *PrincipalType pointing to the current value.

type PrivateEndpointConnection

type PrivateEndpointConnection struct {
	// Resource properties.
	Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

PrivateEndpointConnection - A private endpoint connection

type PrivateEndpointConnectionListResult

type PrivateEndpointConnectionListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*PrivateEndpointConnection `json:"value,omitempty" azure:"ro"`
}

PrivateEndpointConnectionListResult - A list of private endpoint connections.

func (PrivateEndpointConnectionListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult.

type PrivateEndpointConnectionProperties

type PrivateEndpointConnectionProperties struct {
	// Private endpoint which the connection belongs to.
	PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"`

	// Connection state of the private endpoint connection.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"`

	// READ-ONLY; State of the private endpoint connection.
	ProvisioningState *PrivateEndpointProvisioningState `json:"provisioningState,omitempty" azure:"ro"`
}

PrivateEndpointConnectionProperties - Properties of a private endpoint connection.

type PrivateEndpointConnectionRequestStatus

type PrivateEndpointConnectionRequestStatus struct {
	// READ-ONLY; The connection name for the private endpoint.
	PrivateEndpointConnectionName *string `json:"privateEndpointConnectionName,omitempty" azure:"ro"`

	// READ-ONLY; Resource id for which the private endpoint is created.
	PrivateLinkServiceID *string `json:"privateLinkServiceId,omitempty" azure:"ro"`

	// READ-ONLY; Status of this private endpoint connection.
	Status *string `json:"status,omitempty" azure:"ro"`
}

PrivateEndpointConnectionRequestStatus - Contains the private endpoint connection requests status.

type PrivateEndpointConnectionsClient

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

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

func NewPrivateEndpointConnectionsClient

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

NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. subscriptionID - The 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 (*PrivateEndpointConnectionsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewPrivateEndpointConnectionsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<private-endpoint-connection-name>",
		armsql.PrivateEndpointConnection{
			Properties: &armsql.PrivateEndpointConnectionProperties{
				PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{
					Description: to.StringPtr("<description>"),
					Status:      armsql.PrivateLinkServiceConnectionStateStatus("Approved").ToPtr(),
				},
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientCreateOrUpdateResult)
}
Output:

func (*PrivateEndpointConnectionsClient) BeginDelete

func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (PrivateEndpointConnectionsClientDeletePollerResponse, error)

BeginDelete - Deletes a private endpoint connection with a given name. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewPrivateEndpointConnectionsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<private-endpoint-connection-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*PrivateEndpointConnectionsClient) Get

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

Get - Gets a private endpoint connection. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. privateEndpointConnectionName - The name of the private endpoint connection. options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewPrivateEndpointConnectionsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<private-endpoint-connection-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientGetResult)
}
Output:

func (*PrivateEndpointConnectionsClient) ListByServer

ListByServer - Gets all private endpoint connections on a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - PrivateEndpointConnectionsClientListByServerOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewPrivateEndpointConnectionsClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions added in v0.3.0

type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct {
}

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

type PrivateEndpointConnectionsClientBeginDeleteOptions added in v0.3.0

type PrivateEndpointConnectionsClientBeginDeleteOptions struct {
}

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

type PrivateEndpointConnectionsClientCreateOrUpdatePoller added in v0.3.0

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

PrivateEndpointConnectionsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*PrivateEndpointConnectionsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*PrivateEndpointConnectionsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final PrivateEndpointConnectionsClientCreateOrUpdateResponse will be returned.

func (*PrivateEndpointConnectionsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*PrivateEndpointConnectionsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse added in v0.3.0

type PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *PrivateEndpointConnectionsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse contains the response from method PrivateEndpointConnectionsClient.CreateOrUpdate.

func (PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type PrivateEndpointConnectionsClientCreateOrUpdateResponse added in v0.3.0

type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct {
	PrivateEndpointConnectionsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.CreateOrUpdate.

type PrivateEndpointConnectionsClientCreateOrUpdateResult added in v0.3.0

type PrivateEndpointConnectionsClientCreateOrUpdateResult struct {
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientCreateOrUpdateResult contains the result from method PrivateEndpointConnectionsClient.CreateOrUpdate.

type PrivateEndpointConnectionsClientDeletePoller added in v0.3.0

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

PrivateEndpointConnectionsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*PrivateEndpointConnectionsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*PrivateEndpointConnectionsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final PrivateEndpointConnectionsClientDeleteResponse will be returned.

func (*PrivateEndpointConnectionsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*PrivateEndpointConnectionsClientDeletePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type PrivateEndpointConnectionsClientDeletePollerResponse added in v0.3.0

type PrivateEndpointConnectionsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *PrivateEndpointConnectionsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PrivateEndpointConnectionsClientDeletePollerResponse contains the response from method PrivateEndpointConnectionsClient.Delete.

func (PrivateEndpointConnectionsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*PrivateEndpointConnectionsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a PrivateEndpointConnectionsClientDeletePollerResponse from the provided client and resume token.

type PrivateEndpointConnectionsClientDeleteResponse added in v0.3.0

type PrivateEndpointConnectionsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete.

type PrivateEndpointConnectionsClientGetOptions added in v0.3.0

type PrivateEndpointConnectionsClientGetOptions struct {
}

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

type PrivateEndpointConnectionsClientGetResponse added in v0.3.0

type PrivateEndpointConnectionsClientGetResponse struct {
	PrivateEndpointConnectionsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get.

type PrivateEndpointConnectionsClientGetResult added in v0.3.0

type PrivateEndpointConnectionsClientGetResult struct {
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientGetResult contains the result from method PrivateEndpointConnectionsClient.Get.

type PrivateEndpointConnectionsClientListByServerOptions added in v0.3.0

type PrivateEndpointConnectionsClientListByServerOptions struct {
}

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

type PrivateEndpointConnectionsClientListByServerPager added in v0.3.0

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

PrivateEndpointConnectionsClientListByServerPager provides operations for iterating over paged responses.

func (*PrivateEndpointConnectionsClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*PrivateEndpointConnectionsClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*PrivateEndpointConnectionsClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current PrivateEndpointConnectionsClientListByServerResponse page.

type PrivateEndpointConnectionsClientListByServerResponse added in v0.3.0

type PrivateEndpointConnectionsClientListByServerResponse struct {
	PrivateEndpointConnectionsClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PrivateEndpointConnectionsClientListByServerResponse contains the response from method PrivateEndpointConnectionsClient.ListByServer.

type PrivateEndpointConnectionsClientListByServerResult added in v0.3.0

type PrivateEndpointConnectionsClientListByServerResult struct {
	PrivateEndpointConnectionListResult
}

PrivateEndpointConnectionsClientListByServerResult contains the result from method PrivateEndpointConnectionsClient.ListByServer.

type PrivateEndpointProperty

type PrivateEndpointProperty struct {
	// Resource id of the private endpoint.
	ID *string `json:"id,omitempty"`
}

type PrivateEndpointProvisioningState

type PrivateEndpointProvisioningState string

PrivateEndpointProvisioningState - State of the private endpoint connection.

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

func PossiblePrivateEndpointProvisioningStateValues

func PossiblePrivateEndpointProvisioningStateValues() []PrivateEndpointProvisioningState

PossiblePrivateEndpointProvisioningStateValues returns the possible values for the PrivateEndpointProvisioningState const type.

func (PrivateEndpointProvisioningState) ToPtr

ToPtr returns a *PrivateEndpointProvisioningState pointing to the current value.

type PrivateLinkResource

type PrivateLinkResource struct {
	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The private link resource group id.
	Properties *PrivateLinkResourceProperties `json:"properties,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

PrivateLinkResource - A private link resource

type PrivateLinkResourceListResult

type PrivateLinkResourceListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*PrivateLinkResource `json:"value,omitempty" azure:"ro"`
}

PrivateLinkResourceListResult - A list of private link resources

func (PrivateLinkResourceListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult.

type PrivateLinkResourceProperties

type PrivateLinkResourceProperties struct {
	// READ-ONLY; The private link resource group id.
	GroupID *string `json:"groupId,omitempty" azure:"ro"`

	// READ-ONLY; The private link resource required member names.
	RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"`

	// READ-ONLY; The private link resource required zone names.
	RequiredZoneNames []*string `json:"requiredZoneNames,omitempty" azure:"ro"`
}

PrivateLinkResourceProperties - Properties of a private link resource.

func (PrivateLinkResourceProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties.

type PrivateLinkResourcesClient

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

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

func NewPrivateLinkResourcesClient

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

NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. subscriptionID - The 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 (*PrivateLinkResourcesClient) Get

Get - Gets a private link resource for SQL server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. groupName - The name of the private link resource. options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateLinkResourcesGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewPrivateLinkResourcesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.PrivateLinkResourcesClientGetResult)
}
Output:

func (*PrivateLinkResourcesClient) ListByServer

ListByServer - Gets the private link resources for SQL server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - PrivateLinkResourcesClientListByServerOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateLinkResourcesList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewPrivateLinkResourcesClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type PrivateLinkResourcesClientGetOptions added in v0.3.0

type PrivateLinkResourcesClientGetOptions struct {
}

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

type PrivateLinkResourcesClientGetResponse added in v0.3.0

type PrivateLinkResourcesClientGetResponse struct {
	PrivateLinkResourcesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get.

type PrivateLinkResourcesClientGetResult added in v0.3.0

type PrivateLinkResourcesClientGetResult struct {
	PrivateLinkResource
}

PrivateLinkResourcesClientGetResult contains the result from method PrivateLinkResourcesClient.Get.

type PrivateLinkResourcesClientListByServerOptions added in v0.3.0

type PrivateLinkResourcesClientListByServerOptions struct {
}

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

type PrivateLinkResourcesClientListByServerPager added in v0.3.0

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

PrivateLinkResourcesClientListByServerPager provides operations for iterating over paged responses.

func (*PrivateLinkResourcesClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*PrivateLinkResourcesClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*PrivateLinkResourcesClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current PrivateLinkResourcesClientListByServerResponse page.

type PrivateLinkResourcesClientListByServerResponse added in v0.3.0

type PrivateLinkResourcesClientListByServerResponse struct {
	PrivateLinkResourcesClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

PrivateLinkResourcesClientListByServerResponse contains the response from method PrivateLinkResourcesClient.ListByServer.

type PrivateLinkResourcesClientListByServerResult added in v0.3.0

type PrivateLinkResourcesClientListByServerResult struct {
	PrivateLinkResourceListResult
}

PrivateLinkResourcesClientListByServerResult contains the result from method PrivateLinkResourcesClient.ListByServer.

type PrivateLinkServiceConnectionStateActionsRequire

type PrivateLinkServiceConnectionStateActionsRequire string

PrivateLinkServiceConnectionStateActionsRequire - The actions required for private link service connection.

const (
	PrivateLinkServiceConnectionStateActionsRequireNone PrivateLinkServiceConnectionStateActionsRequire = "None"
)

func PossiblePrivateLinkServiceConnectionStateActionsRequireValues

func PossiblePrivateLinkServiceConnectionStateActionsRequireValues() []PrivateLinkServiceConnectionStateActionsRequire

PossiblePrivateLinkServiceConnectionStateActionsRequireValues returns the possible values for the PrivateLinkServiceConnectionStateActionsRequire const type.

func (PrivateLinkServiceConnectionStateActionsRequire) ToPtr

ToPtr returns a *PrivateLinkServiceConnectionStateActionsRequire pointing to the current value.

type PrivateLinkServiceConnectionStateProperty

type PrivateLinkServiceConnectionStateProperty struct {
	// REQUIRED; The private link service connection description.
	Description *string `json:"description,omitempty"`

	// REQUIRED; The private link service connection status.
	Status *PrivateLinkServiceConnectionStateStatus `json:"status,omitempty"`

	// READ-ONLY; The actions required for private link service connection.
	ActionsRequired *PrivateLinkServiceConnectionStateActionsRequire `json:"actionsRequired,omitempty" azure:"ro"`
}

type PrivateLinkServiceConnectionStateStatus

type PrivateLinkServiceConnectionStateStatus string

PrivateLinkServiceConnectionStateStatus - The private link service connection status.

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

func PossiblePrivateLinkServiceConnectionStateStatusValues

func PossiblePrivateLinkServiceConnectionStateStatusValues() []PrivateLinkServiceConnectionStateStatus

PossiblePrivateLinkServiceConnectionStateStatusValues returns the possible values for the PrivateLinkServiceConnectionStateStatus const type.

func (PrivateLinkServiceConnectionStateStatus) ToPtr

ToPtr returns a *PrivateLinkServiceConnectionStateStatus pointing to the current value.

type ProvisioningState

type ProvisioningState string

ProvisioningState - The ARM provisioning state of the job execution.

const (
	ProvisioningStateCanceled   ProvisioningState = "Canceled"
	ProvisioningStateCreated    ProvisioningState = "Created"
	ProvisioningStateFailed     ProvisioningState = "Failed"
	ProvisioningStateInProgress ProvisioningState = "InProgress"
	ProvisioningStateSucceeded  ProvisioningState = "Succeeded"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

func (ProvisioningState) ToPtr

ToPtr returns a *ProvisioningState pointing to the current value.

type ProxyResource

type ProxyResource struct {
	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ProxyResource - ARM proxy resource.

type ProxyResourceWithWritableName

type ProxyResourceWithWritableName struct {
	// Resource name.
	Name *string `json:"name,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ProxyResourceWithWritableName - ARM proxy resource.

type QueryMetricInterval

type QueryMetricInterval struct {
	// List of metric objects for this interval
	Metrics []*QueryMetricProperties `json:"metrics,omitempty"`

	// READ-ONLY; Execution count of a query in this interval.
	ExecutionCount *int64 `json:"executionCount,omitempty" azure:"ro"`

	// READ-ONLY; The start time for the metric interval (ISO-8601 format).
	IntervalStartTime *string `json:"intervalStartTime,omitempty" azure:"ro"`

	// READ-ONLY; Interval type (length).
	IntervalType *QueryTimeGrainType `json:"intervalType,omitempty" azure:"ro"`
}

QueryMetricInterval - Properties of a query metrics interval.

func (QueryMetricInterval) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type QueryMetricInterval.

type QueryMetricProperties

type QueryMetricProperties struct {
	// READ-ONLY; Metric value when avg() aggregate function is used over the interval.
	Avg *float64 `json:"avg,omitempty" azure:"ro"`

	// READ-ONLY; The UI appropriate name for the metric.
	DisplayName *string `json:"displayName,omitempty" azure:"ro"`

	// READ-ONLY; Metric value when max() aggregate function is used over the interval.
	Max *float64 `json:"max,omitempty" azure:"ro"`

	// READ-ONLY; Metric value when min() aggregate function is used over the interval.
	Min *float64 `json:"min,omitempty" azure:"ro"`

	// READ-ONLY; The name information for the metric.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Metric value when stdev aggregate function is used over the interval.
	Stdev *float64 `json:"stdev,omitempty" azure:"ro"`

	// READ-ONLY; Metric value when sum() aggregate function is used over the interval.
	Sum *float64 `json:"sum,omitempty" azure:"ro"`

	// READ-ONLY; The unit of the metric.
	Unit *QueryMetricUnitType `json:"unit,omitempty" azure:"ro"`

	// READ-ONLY; The value of the metric.
	Value *float64 `json:"value,omitempty" azure:"ro"`
}

QueryMetricProperties - Properties of a topquery metric in one interval.

type QueryMetricUnitType

type QueryMetricUnitType string

QueryMetricUnitType - The unit of the metric.

const (
	QueryMetricUnitTypeCount        QueryMetricUnitType = "count"
	QueryMetricUnitTypeKB           QueryMetricUnitType = "KB"
	QueryMetricUnitTypeMicroseconds QueryMetricUnitType = "microseconds"
	QueryMetricUnitTypePercentage   QueryMetricUnitType = "percentage"
)

func PossibleQueryMetricUnitTypeValues

func PossibleQueryMetricUnitTypeValues() []QueryMetricUnitType

PossibleQueryMetricUnitTypeValues returns the possible values for the QueryMetricUnitType const type.

func (QueryMetricUnitType) ToPtr

ToPtr returns a *QueryMetricUnitType pointing to the current value.

type QueryProperties

type QueryProperties struct {
	// Query text.
	QueryText *string `json:"queryText,omitempty"`
}

QueryProperties - Properties of a database query.

type QueryStatistics

type QueryStatistics struct {
	// Resource properties.
	Properties *QueryStatisticsProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

type QueryStatisticsProperties

type QueryStatisticsProperties struct {
	// List of intervals with appropriate metric data
	Intervals []*QueryMetricInterval `json:"intervals,omitempty"`

	// READ-ONLY; Database name of the database in which this query was executed.
	DatabaseName *string `json:"databaseName,omitempty" azure:"ro"`

	// READ-ONLY; The end time for the metric (ISO-8601 format).
	EndTime *string `json:"endTime,omitempty" azure:"ro"`

	// READ-ONLY; Unique query id (unique within one database).
	QueryID *string `json:"queryId,omitempty" azure:"ro"`

	// READ-ONLY; The start time for the metric (ISO-8601 format).
	StartTime *string `json:"startTime,omitempty" azure:"ro"`
}

QueryStatisticsProperties - Properties of a query execution statistics.

func (QueryStatisticsProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type QueryStatisticsProperties.

type QueryTimeGrainType

type QueryTimeGrainType string

QueryTimeGrainType - Interval type (length).

const (
	QueryTimeGrainTypeP1D  QueryTimeGrainType = "P1D"
	QueryTimeGrainTypePT1H QueryTimeGrainType = "PT1H"
)

func PossibleQueryTimeGrainTypeValues

func PossibleQueryTimeGrainTypeValues() []QueryTimeGrainType

PossibleQueryTimeGrainTypeValues returns the possible values for the QueryTimeGrainType const type.

func (QueryTimeGrainType) ToPtr

ToPtr returns a *QueryTimeGrainType pointing to the current value.

type ReadOnlyEndpointFailoverPolicy

type ReadOnlyEndpointFailoverPolicy string

ReadOnlyEndpointFailoverPolicy - Failover policy of the read-only endpoint for the failover group.

const (
	ReadOnlyEndpointFailoverPolicyDisabled ReadOnlyEndpointFailoverPolicy = "Disabled"
	ReadOnlyEndpointFailoverPolicyEnabled  ReadOnlyEndpointFailoverPolicy = "Enabled"
)

func PossibleReadOnlyEndpointFailoverPolicyValues

func PossibleReadOnlyEndpointFailoverPolicyValues() []ReadOnlyEndpointFailoverPolicy

PossibleReadOnlyEndpointFailoverPolicyValues returns the possible values for the ReadOnlyEndpointFailoverPolicy const type.

func (ReadOnlyEndpointFailoverPolicy) ToPtr

ToPtr returns a *ReadOnlyEndpointFailoverPolicy pointing to the current value.

type ReadScaleCapability

type ReadScaleCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; The maximum number of read scale replicas.
	MaxNumberOfReplicas *int32 `json:"maxNumberOfReplicas,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`
}

ReadScaleCapability - The read scale capability.

type ReadWriteEndpointFailoverPolicy

type ReadWriteEndpointFailoverPolicy string

ReadWriteEndpointFailoverPolicy - Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.

const (
	ReadWriteEndpointFailoverPolicyAutomatic ReadWriteEndpointFailoverPolicy = "Automatic"
	ReadWriteEndpointFailoverPolicyManual    ReadWriteEndpointFailoverPolicy = "Manual"
)

func PossibleReadWriteEndpointFailoverPolicyValues

func PossibleReadWriteEndpointFailoverPolicyValues() []ReadWriteEndpointFailoverPolicy

PossibleReadWriteEndpointFailoverPolicyValues returns the possible values for the ReadWriteEndpointFailoverPolicy const type.

func (ReadWriteEndpointFailoverPolicy) ToPtr

ToPtr returns a *ReadWriteEndpointFailoverPolicy pointing to the current value.

type RecommendedAction

type RecommendedAction struct {
	// Resource properties.
	Properties *RecommendedActionProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource kind.
	Kind *string `json:"kind,omitempty" azure:"ro"`

	// READ-ONLY; Resource location.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

RecommendedAction - Database, Server or Elastic Pool Recommended Action.

func (RecommendedAction) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RecommendedAction.

type RecommendedActionCurrentState

type RecommendedActionCurrentState string

RecommendedActionCurrentState - Current state the recommended action is in. Some commonly used states are: Active -> recommended action is active and no action has been taken yet. Pending -> recommended action is approved for and is awaiting execution. Executing -> recommended action is being applied on the user database. Verifying -> recommended action was applied and is being verified of its usefulness by the system. Success -> recommended action was applied and improvement found during verification. Pending Revert -> verification found little or no improvement so recommended action is queued for revert or user has manually reverted. Reverting -> changes made while applying recommended action are being reverted on the user database. Reverted -> successfully reverted the changes made by recommended action on user database. Ignored -> user explicitly ignored/discarded the recommended action.

const (
	RecommendedActionCurrentStateActive          RecommendedActionCurrentState = "Active"
	RecommendedActionCurrentStateError           RecommendedActionCurrentState = "Error"
	RecommendedActionCurrentStateExecuting       RecommendedActionCurrentState = "Executing"
	RecommendedActionCurrentStateExpired         RecommendedActionCurrentState = "Expired"
	RecommendedActionCurrentStateIgnored         RecommendedActionCurrentState = "Ignored"
	RecommendedActionCurrentStateMonitoring      RecommendedActionCurrentState = "Monitoring"
	RecommendedActionCurrentStatePending         RecommendedActionCurrentState = "Pending"
	RecommendedActionCurrentStatePendingRevert   RecommendedActionCurrentState = "PendingRevert"
	RecommendedActionCurrentStateResolved        RecommendedActionCurrentState = "Resolved"
	RecommendedActionCurrentStateRevertCancelled RecommendedActionCurrentState = "RevertCancelled"
	RecommendedActionCurrentStateReverted        RecommendedActionCurrentState = "Reverted"
	RecommendedActionCurrentStateReverting       RecommendedActionCurrentState = "Reverting"
	RecommendedActionCurrentStateSuccess         RecommendedActionCurrentState = "Success"
	RecommendedActionCurrentStateVerifying       RecommendedActionCurrentState = "Verifying"
)

func PossibleRecommendedActionCurrentStateValues

func PossibleRecommendedActionCurrentStateValues() []RecommendedActionCurrentState

PossibleRecommendedActionCurrentStateValues returns the possible values for the RecommendedActionCurrentState const type.

func (RecommendedActionCurrentState) ToPtr

ToPtr returns a *RecommendedActionCurrentState pointing to the current value.

type RecommendedActionErrorInfo

type RecommendedActionErrorInfo struct {
	// READ-ONLY; Gets the reason why the recommended action was put to error state. e.g., DatabaseHasQdsOff, IndexAlreadyExists
	ErrorCode *string `json:"errorCode,omitempty" azure:"ro"`

	// READ-ONLY; Gets whether the error could be ignored and recommended action could be retried. Possible values are: Yes/No
	IsRetryable *IsRetryable `json:"isRetryable,omitempty" azure:"ro"`
}

RecommendedActionErrorInfo - Contains error information for an Azure SQL Database, Server or Elastic Pool Recommended Action.

type RecommendedActionImpactRecord

type RecommendedActionImpactRecord struct {
	// READ-ONLY; Gets the absolute value of this dimension if applicable. e.g., Number of Queries affected
	AbsoluteValue *float64 `json:"absoluteValue,omitempty" azure:"ro"`

	// READ-ONLY; Gets the absolute change in the value of this dimension. e.g., Absolute Disk space change in Megabytes
	ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty" azure:"ro"`

	// READ-ONLY; Gets the relative change in the value of this dimension. e.g., Relative Disk space change in Percentage
	ChangeValueRelative *float64 `json:"changeValueRelative,omitempty" azure:"ro"`

	// READ-ONLY; Gets the name of the impact dimension. e.g., CPUChange, DiskSpaceChange, NumberOfQueriesAffected.
	DimensionName *string `json:"dimensionName,omitempty" azure:"ro"`

	// READ-ONLY; Gets the name of the impact dimension. e.g., CPUChange, DiskSpaceChange, NumberOfQueriesAffected.
	Unit *string `json:"unit,omitempty" azure:"ro"`
}

RecommendedActionImpactRecord - Contains information of estimated or observed impact on various metrics for an Azure SQL Database, Server or Elastic Pool Recommended Action.

type RecommendedActionImplementationInfo

type RecommendedActionImplementationInfo struct {
	// READ-ONLY; Gets the method in which this recommended action can be manually implemented. e.g., TSql, AzurePowerShell.
	Method *ImplementationMethod `json:"method,omitempty" azure:"ro"`

	// READ-ONLY; Gets the manual implementation script. e.g., T-SQL script that could be executed on the database.
	Script *string `json:"script,omitempty" azure:"ro"`
}

RecommendedActionImplementationInfo - Contains information for manual implementation for an Azure SQL Database, Server or Elastic Pool Recommended Action.

type RecommendedActionInitiatedBy

type RecommendedActionInitiatedBy string

RecommendedActionInitiatedBy - Gets if approval for applying this recommended action was given by user/system.

const (
	RecommendedActionInitiatedByUser   RecommendedActionInitiatedBy = "User"
	RecommendedActionInitiatedBySystem RecommendedActionInitiatedBy = "System"
)

func PossibleRecommendedActionInitiatedByValues

func PossibleRecommendedActionInitiatedByValues() []RecommendedActionInitiatedBy

PossibleRecommendedActionInitiatedByValues returns the possible values for the RecommendedActionInitiatedBy const type.

func (RecommendedActionInitiatedBy) ToPtr

ToPtr returns a *RecommendedActionInitiatedBy pointing to the current value.

type RecommendedActionMetricInfo

type RecommendedActionMetricInfo struct {
	// READ-ONLY; Gets the name of the metric. e.g., CPU, Number of Queries.
	MetricName *string `json:"metricName,omitempty" azure:"ro"`

	// READ-ONLY; Gets the start time of time interval given by this MetricInfo.
	StartTime *time.Time `json:"startTime,omitempty" azure:"ro"`

	// READ-ONLY; Gets the duration of time interval for the value given by this MetricInfo. e.g., PT1H (1 hour)
	TimeGrain *string `json:"timeGrain,omitempty" azure:"ro"`

	// READ-ONLY; Gets the unit in which metric is measured. e.g., DTU, Frequency
	Unit *string `json:"unit,omitempty" azure:"ro"`

	// READ-ONLY; Gets the value of the metric in the time interval given by this MetricInfo.
	Value *float64 `json:"value,omitempty" azure:"ro"`
}

RecommendedActionMetricInfo - Contains time series of various impacted metrics for an Azure SQL Database, Server or Elastic Pool Recommended Action.

func (RecommendedActionMetricInfo) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RecommendedActionMetricInfo.

func (*RecommendedActionMetricInfo) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionMetricInfo.

type RecommendedActionProperties

type RecommendedActionProperties struct {
	// REQUIRED; Gets the info of the current state the recommended action is in.
	State *RecommendedActionStateInfo `json:"state,omitempty"`

	// READ-ONLY; Gets additional details specific to this recommended action.
	Details map[string]map[string]interface{} `json:"details,omitempty" azure:"ro"`

	// READ-ONLY; Gets the error details if and why this recommended action is put to error state.
	ErrorDetails *RecommendedActionErrorInfo `json:"errorDetails,omitempty" azure:"ro"`

	// READ-ONLY; Gets the estimated impact info for this recommended action e.g., Estimated CPU gain, Estimated Disk Space change
	EstimatedImpact []*RecommendedActionImpactRecord `json:"estimatedImpact,omitempty" azure:"ro"`

	// READ-ONLY; Gets the time taken for applying this recommended action on user resource. e.g., time taken for index creation
	ExecuteActionDuration *string `json:"executeActionDuration,omitempty" azure:"ro"`

	// READ-ONLY; Gets if approval for applying this recommended action was given by user/system.
	ExecuteActionInitiatedBy *RecommendedActionInitiatedBy `json:"executeActionInitiatedBy,omitempty" azure:"ro"`

	// READ-ONLY; Gets the time when this recommended action was approved for execution.
	ExecuteActionInitiatedTime *time.Time `json:"executeActionInitiatedTime,omitempty" azure:"ro"`

	// READ-ONLY; Gets the time when system started applying this recommended action on the user resource. e.g., index creation
	// start time
	ExecuteActionStartTime *time.Time `json:"executeActionStartTime,omitempty" azure:"ro"`

	// READ-ONLY; Gets the implementation details of this recommended action for user to apply it manually.
	ImplementationDetails *RecommendedActionImplementationInfo `json:"implementationDetails,omitempty" azure:"ro"`

	// READ-ONLY; Gets if this recommended action was suggested some time ago but user chose to ignore this and system added a
	// new recommended action again.
	IsArchivedAction *bool `json:"isArchivedAction,omitempty" azure:"ro"`

	// READ-ONLY; Gets if this recommended action is actionable by user
	IsExecutableAction *bool `json:"isExecutableAction,omitempty" azure:"ro"`

	// READ-ONLY; Gets if changes applied by this recommended action can be reverted by user
	IsRevertableAction *bool `json:"isRevertableAction,omitempty" azure:"ro"`

	// READ-ONLY; Gets time when this recommended action was last refreshed.
	LastRefresh *time.Time `json:"lastRefresh,omitempty" azure:"ro"`

	// READ-ONLY; Gets the linked objects, if any.
	LinkedObjects []*string `json:"linkedObjects,omitempty" azure:"ro"`

	// READ-ONLY; Gets the observed/actual impact info for this recommended action e.g., Actual CPU gain, Actual Disk Space change
	ObservedImpact []*RecommendedActionImpactRecord `json:"observedImpact,omitempty" azure:"ro"`

	// READ-ONLY; Gets the reason for recommending this action. e.g., DuplicateIndex
	RecommendationReason *string `json:"recommendationReason,omitempty" azure:"ro"`

	// READ-ONLY; Gets the time taken for reverting changes of this recommended action on user resource. e.g., time taken for
	// dropping the created index.
	RevertActionDuration *string `json:"revertActionDuration,omitempty" azure:"ro"`

	// READ-ONLY; Gets if approval for reverting this recommended action was given by user/system.
	RevertActionInitiatedBy *RecommendedActionInitiatedBy `json:"revertActionInitiatedBy,omitempty" azure:"ro"`

	// READ-ONLY; Gets the time when this recommended action was approved for revert.
	RevertActionInitiatedTime *time.Time `json:"revertActionInitiatedTime,omitempty" azure:"ro"`

	// READ-ONLY; Gets the time when system started reverting changes of this recommended action on user resource. e.g., time
	// when index drop is executed.
	RevertActionStartTime *time.Time `json:"revertActionStartTime,omitempty" azure:"ro"`

	// READ-ONLY; Gets the impact of this recommended action. Possible values are 1 - Low impact, 2 - Medium Impact and 3 - High
	// Impact
	Score *int32 `json:"score,omitempty" azure:"ro"`

	// READ-ONLY; Gets the time series info of metrics for this recommended action e.g., CPU consumption time series
	TimeSeries []*RecommendedActionMetricInfo `json:"timeSeries,omitempty" azure:"ro"`

	// READ-ONLY; Gets the time since when this recommended action is valid.
	ValidSince *time.Time `json:"validSince,omitempty" azure:"ro"`
}

RecommendedActionProperties - Properties for a Database, Server or Elastic Pool Recommended Action.

func (RecommendedActionProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RecommendedActionProperties.

func (*RecommendedActionProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionProperties.

type RecommendedActionStateInfo

type RecommendedActionStateInfo struct {
	// REQUIRED; Current state the recommended action is in. Some commonly used states are: Active -> recommended action is active
	// and no action has been taken yet. Pending -> recommended action is approved for and is
	// awaiting execution. Executing -> recommended action is being applied on the user database. Verifying -> recommended action
	// was applied and is being verified of its usefulness by the system. Success ->
	// recommended action was applied and improvement found during verification. Pending Revert -> verification found little or
	// no improvement so recommended action is queued for revert or user has manually
	// reverted. Reverting -> changes made while applying recommended action are being reverted on the user database. Reverted
	// -> successfully reverted the changes made by recommended action on user
	// database. Ignored -> user explicitly ignored/discarded the recommended action.
	CurrentValue *RecommendedActionCurrentState `json:"currentValue,omitempty"`

	// READ-ONLY; Gets who initiated the execution of this recommended action. Possible Value are: User -> When user explicity
	// notified system to apply the recommended action. System -> When auto-execute status of this
	// advisor was set to 'Enabled', in which case the system applied it.
	ActionInitiatedBy *RecommendedActionInitiatedBy `json:"actionInitiatedBy,omitempty" azure:"ro"`

	// READ-ONLY; Gets the time when the state was last modified
	LastModified *time.Time `json:"lastModified,omitempty" azure:"ro"`
}

RecommendedActionStateInfo - Contains information of current state for an Azure SQL Database, Server or Elastic Pool Recommended Action.

func (RecommendedActionStateInfo) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RecommendedActionStateInfo.

func (*RecommendedActionStateInfo) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionStateInfo.

type RecommendedSensitivityLabelUpdate

type RecommendedSensitivityLabelUpdate struct {
	// Resource properties.
	Properties *RecommendedSensitivityLabelUpdateProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

RecommendedSensitivityLabelUpdate - A recommended sensitivity label update operation.

type RecommendedSensitivityLabelUpdateKind

type RecommendedSensitivityLabelUpdateKind string
const (
	RecommendedSensitivityLabelUpdateKindEnable  RecommendedSensitivityLabelUpdateKind = "enable"
	RecommendedSensitivityLabelUpdateKindDisable RecommendedSensitivityLabelUpdateKind = "disable"
)

func PossibleRecommendedSensitivityLabelUpdateKindValues

func PossibleRecommendedSensitivityLabelUpdateKindValues() []RecommendedSensitivityLabelUpdateKind

PossibleRecommendedSensitivityLabelUpdateKindValues returns the possible values for the RecommendedSensitivityLabelUpdateKind const type.

func (RecommendedSensitivityLabelUpdateKind) ToPtr

ToPtr returns a *RecommendedSensitivityLabelUpdateKind pointing to the current value.

type RecommendedSensitivityLabelUpdateList

type RecommendedSensitivityLabelUpdateList struct {
	Operations []*RecommendedSensitivityLabelUpdate `json:"operations,omitempty"`
}

RecommendedSensitivityLabelUpdateList - A list of recommended sensitivity label update operations.

func (RecommendedSensitivityLabelUpdateList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RecommendedSensitivityLabelUpdateList.

type RecommendedSensitivityLabelUpdateProperties

type RecommendedSensitivityLabelUpdateProperties struct {
	// REQUIRED; Column name to update.
	Column *string `json:"column,omitempty"`

	// REQUIRED
	Op *RecommendedSensitivityLabelUpdateKind `json:"op,omitempty"`

	// REQUIRED; Schema name of the column to update.
	Schema *string `json:"schema,omitempty"`

	// REQUIRED; Table name of the column to update.
	Table *string `json:"table,omitempty"`
}

RecommendedSensitivityLabelUpdateProperties - Properties of an operation executed on a recommended sensitivity label.

type RecommendedSensitivityLabelsClient

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

RecommendedSensitivityLabelsClient contains the methods for the RecommendedSensitivityLabels group. Don't use this type directly, use NewRecommendedSensitivityLabelsClient() instead.

func NewRecommendedSensitivityLabelsClient

func NewRecommendedSensitivityLabelsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *RecommendedSensitivityLabelsClient

NewRecommendedSensitivityLabelsClient creates a new instance of RecommendedSensitivityLabelsClient with the specified values. subscriptionID - The 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 (*RecommendedSensitivityLabelsClient) Update

Update - Update recommended sensitivity labels states of a given database using an operations batch. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - RecommendedSensitivityLabelsClientUpdateOptions contains the optional parameters for the RecommendedSensitivityLabelsClient.Update method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsRecommendedUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewRecommendedSensitivityLabelsClient("<subscription-id>", cred, nil)
	_, err = client.Update(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.RecommendedSensitivityLabelUpdateList{
			Operations: []*armsql.RecommendedSensitivityLabelUpdate{
				{
					Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{
						Schema: to.StringPtr("<schema>"),
						Column: to.StringPtr("<column>"),
						Op:     armsql.RecommendedSensitivityLabelUpdateKindEnable.ToPtr(),
						Table:  to.StringPtr("<table>"),
					},
				},
				{
					Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{
						Schema: to.StringPtr("<schema>"),
						Column: to.StringPtr("<column>"),
						Op:     armsql.RecommendedSensitivityLabelUpdateKindEnable.ToPtr(),
						Table:  to.StringPtr("<table>"),
					},
				},
				{
					Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{
						Schema: to.StringPtr("<schema>"),
						Column: to.StringPtr("<column>"),
						Op:     armsql.RecommendedSensitivityLabelUpdateKindDisable.ToPtr(),
						Table:  to.StringPtr("<table>"),
					},
				}},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

type RecommendedSensitivityLabelsClientUpdateOptions added in v0.3.0

type RecommendedSensitivityLabelsClientUpdateOptions struct {
}

RecommendedSensitivityLabelsClientUpdateOptions contains the optional parameters for the RecommendedSensitivityLabelsClient.Update method.

type RecommendedSensitivityLabelsClientUpdateResponse added in v0.3.0

type RecommendedSensitivityLabelsClientUpdateResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

RecommendedSensitivityLabelsClientUpdateResponse contains the response from method RecommendedSensitivityLabelsClient.Update.

type RecoverableDatabase

type RecoverableDatabase struct {
	// The properties of a recoverable database
	Properties *RecoverableDatabaseProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

RecoverableDatabase - A recoverable database

type RecoverableDatabaseListResult

type RecoverableDatabaseListResult struct {
	// REQUIRED; A list of recoverable databases
	Value []*RecoverableDatabase `json:"value,omitempty"`
}

RecoverableDatabaseListResult - The response to a list recoverable databases request

func (RecoverableDatabaseListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RecoverableDatabaseListResult.

type RecoverableDatabaseProperties

type RecoverableDatabaseProperties struct {
	// READ-ONLY; The edition of the database
	Edition *string `json:"edition,omitempty" azure:"ro"`

	// READ-ONLY; The elastic pool name of the database
	ElasticPoolName *string `json:"elasticPoolName,omitempty" azure:"ro"`

	// READ-ONLY; The last available backup date of the database (ISO8601 format)
	LastAvailableBackupDate *time.Time `json:"lastAvailableBackupDate,omitempty" azure:"ro"`

	// READ-ONLY; The service level objective name of the database
	ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty" azure:"ro"`
}

RecoverableDatabaseProperties - The properties of a recoverable database

func (RecoverableDatabaseProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RecoverableDatabaseProperties.

func (*RecoverableDatabaseProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableDatabaseProperties.

type RecoverableDatabasesClient

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

RecoverableDatabasesClient contains the methods for the RecoverableDatabases group. Don't use this type directly, use NewRecoverableDatabasesClient() instead.

func NewRecoverableDatabasesClient

func NewRecoverableDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *RecoverableDatabasesClient

NewRecoverableDatabasesClient creates a new instance of RecoverableDatabasesClient with the specified values. subscriptionID - The 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 (*RecoverableDatabasesClient) Get

func (client *RecoverableDatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *RecoverableDatabasesClientGetOptions) (RecoverableDatabasesClientGetResponse, error)

Get - Gets a recoverable database, which is a resource representing a database's geo backup If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database options - RecoverableDatabasesClientGetOptions contains the optional parameters for the RecoverableDatabasesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/RecoverableDatabaseGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewRecoverableDatabasesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.RecoverableDatabasesClientGetResult)
}
Output:

func (*RecoverableDatabasesClient) ListByServer

ListByServer - Gets a list of recoverable databases If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - RecoverableDatabasesClientListByServerOptions contains the optional parameters for the RecoverableDatabasesClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/RecoverableDatabaseList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewRecoverableDatabasesClient("<subscription-id>", cred, nil)
	res, err := client.ListByServer(ctx,
		"<resource-group-name>",
		"<server-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.RecoverableDatabasesClientListByServerResult)
}
Output:

type RecoverableDatabasesClientGetOptions added in v0.3.0

type RecoverableDatabasesClientGetOptions struct {
}

RecoverableDatabasesClientGetOptions contains the optional parameters for the RecoverableDatabasesClient.Get method.

type RecoverableDatabasesClientGetResponse added in v0.3.0

type RecoverableDatabasesClientGetResponse struct {
	RecoverableDatabasesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

RecoverableDatabasesClientGetResponse contains the response from method RecoverableDatabasesClient.Get.

type RecoverableDatabasesClientGetResult added in v0.3.0

type RecoverableDatabasesClientGetResult struct {
	RecoverableDatabase
}

RecoverableDatabasesClientGetResult contains the result from method RecoverableDatabasesClient.Get.

type RecoverableDatabasesClientListByServerOptions added in v0.3.0

type RecoverableDatabasesClientListByServerOptions struct {
}

RecoverableDatabasesClientListByServerOptions contains the optional parameters for the RecoverableDatabasesClient.ListByServer method.

type RecoverableDatabasesClientListByServerResponse added in v0.3.0

type RecoverableDatabasesClientListByServerResponse struct {
	RecoverableDatabasesClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

RecoverableDatabasesClientListByServerResponse contains the response from method RecoverableDatabasesClient.ListByServer.

type RecoverableDatabasesClientListByServerResult added in v0.3.0

type RecoverableDatabasesClientListByServerResult struct {
	RecoverableDatabaseListResult
}

RecoverableDatabasesClientListByServerResult contains the result from method RecoverableDatabasesClient.ListByServer.

type RecoverableManagedDatabase

type RecoverableManagedDatabase struct {
	// Resource properties.
	Properties *RecoverableManagedDatabaseProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

RecoverableManagedDatabase - A recoverable managed database resource.

type RecoverableManagedDatabaseListResult

type RecoverableManagedDatabaseListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*RecoverableManagedDatabase `json:"value,omitempty" azure:"ro"`
}

RecoverableManagedDatabaseListResult - A list of recoverable managed databases.

func (RecoverableManagedDatabaseListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RecoverableManagedDatabaseListResult.

type RecoverableManagedDatabaseProperties

type RecoverableManagedDatabaseProperties struct {
	// READ-ONLY; The last available backup date.
	LastAvailableBackupDate *string `json:"lastAvailableBackupDate,omitempty" azure:"ro"`
}

RecoverableManagedDatabaseProperties - The recoverable managed database's properties.

type RecoverableManagedDatabasesClient

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

RecoverableManagedDatabasesClient contains the methods for the RecoverableManagedDatabases group. Don't use this type directly, use NewRecoverableManagedDatabasesClient() instead.

func NewRecoverableManagedDatabasesClient

func NewRecoverableManagedDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *RecoverableManagedDatabasesClient

NewRecoverableManagedDatabasesClient creates a new instance of RecoverableManagedDatabasesClient with the specified values. subscriptionID - The 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 (*RecoverableManagedDatabasesClient) Get

func (client *RecoverableManagedDatabasesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, recoverableDatabaseName string, options *RecoverableManagedDatabasesClientGetOptions) (RecoverableManagedDatabasesClientGetResponse, error)

Get - Gets a recoverable managed database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - RecoverableManagedDatabasesClientGetOptions contains the optional parameters for the RecoverableManagedDatabasesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetRecoverableManagedDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewRecoverableManagedDatabasesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<recoverable-database-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.RecoverableManagedDatabasesClientGetResult)
}
Output:

func (*RecoverableManagedDatabasesClient) ListByInstance

ListByInstance - Gets a list of recoverable managed databases. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - RecoverableManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RecoverableManagedDatabasesClient.ListByInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListRecoverableManagedDatabasesByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewRecoverableManagedDatabasesClient("<subscription-id>", cred, nil)
	pager := client.ListByInstance("<resource-group-name>",
		"<managed-instance-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type RecoverableManagedDatabasesClientGetOptions added in v0.3.0

type RecoverableManagedDatabasesClientGetOptions struct {
}

RecoverableManagedDatabasesClientGetOptions contains the optional parameters for the RecoverableManagedDatabasesClient.Get method.

type RecoverableManagedDatabasesClientGetResponse added in v0.3.0

type RecoverableManagedDatabasesClientGetResponse struct {
	RecoverableManagedDatabasesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

RecoverableManagedDatabasesClientGetResponse contains the response from method RecoverableManagedDatabasesClient.Get.

type RecoverableManagedDatabasesClientGetResult added in v0.3.0

type RecoverableManagedDatabasesClientGetResult struct {
	RecoverableManagedDatabase
}

RecoverableManagedDatabasesClientGetResult contains the result from method RecoverableManagedDatabasesClient.Get.

type RecoverableManagedDatabasesClientListByInstanceOptions added in v0.3.0

type RecoverableManagedDatabasesClientListByInstanceOptions struct {
}

RecoverableManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RecoverableManagedDatabasesClient.ListByInstance method.

type RecoverableManagedDatabasesClientListByInstancePager added in v0.3.0

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

RecoverableManagedDatabasesClientListByInstancePager provides operations for iterating over paged responses.

func (*RecoverableManagedDatabasesClientListByInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*RecoverableManagedDatabasesClientListByInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*RecoverableManagedDatabasesClientListByInstancePager) PageResponse added in v0.3.0

PageResponse returns the current RecoverableManagedDatabasesClientListByInstanceResponse page.

type RecoverableManagedDatabasesClientListByInstanceResponse added in v0.3.0

type RecoverableManagedDatabasesClientListByInstanceResponse struct {
	RecoverableManagedDatabasesClientListByInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

RecoverableManagedDatabasesClientListByInstanceResponse contains the response from method RecoverableManagedDatabasesClient.ListByInstance.

type RecoverableManagedDatabasesClientListByInstanceResult added in v0.3.0

type RecoverableManagedDatabasesClientListByInstanceResult struct {
	RecoverableManagedDatabaseListResult
}

RecoverableManagedDatabasesClientListByInstanceResult contains the result from method RecoverableManagedDatabasesClient.ListByInstance.

type ReplicaType

type ReplicaType string
const (
	ReplicaTypePrimary           ReplicaType = "Primary"
	ReplicaTypeReadableSecondary ReplicaType = "ReadableSecondary"
)

func PossibleReplicaTypeValues

func PossibleReplicaTypeValues() []ReplicaType

PossibleReplicaTypeValues returns the possible values for the ReplicaType const type.

func (ReplicaType) ToPtr

func (c ReplicaType) ToPtr() *ReplicaType

ToPtr returns a *ReplicaType pointing to the current value.

type ReplicationLink struct {
	// Resource properties.
	Properties *ReplicationLinkProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ReplicationLink - A replication link.

type ReplicationLinkListResult

type ReplicationLinkListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ReplicationLink `json:"value,omitempty" azure:"ro"`
}

ReplicationLinkListResult - A list of replication links.

func (ReplicationLinkListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReplicationLinkListResult.

type ReplicationLinkProperties

type ReplicationLinkProperties struct {
	// READ-ONLY; Whether the user is currently allowed to terminate the link.
	IsTerminationAllowed *bool `json:"isTerminationAllowed,omitempty" azure:"ro"`

	// READ-ONLY; Link type (GEO, NAMED).
	LinkType *ReplicationLinkType `json:"linkType,omitempty" azure:"ro"`

	// READ-ONLY; Resource partner database.
	PartnerDatabase *string `json:"partnerDatabase,omitempty" azure:"ro"`

	// READ-ONLY; Resource partner location.
	PartnerLocation *string `json:"partnerLocation,omitempty" azure:"ro"`

	// READ-ONLY; Partner replication role.
	PartnerRole *ReplicationRole `json:"partnerRole,omitempty" azure:"ro"`

	// READ-ONLY; Resource partner server.
	PartnerServer *string `json:"partnerServer,omitempty" azure:"ro"`

	// READ-ONLY; Seeding completion percentage for the link.
	PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"`

	// READ-ONLY; Replication mode.
	ReplicationMode *string `json:"replicationMode,omitempty" azure:"ro"`

	// READ-ONLY; Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED).
	ReplicationState *ReplicationState `json:"replicationState,omitempty" azure:"ro"`

	// READ-ONLY; Local replication role.
	Role *ReplicationRole `json:"role,omitempty" azure:"ro"`

	// READ-ONLY; Time at which the link was created.
	StartTime *time.Time `json:"startTime,omitempty" azure:"ro"`
}

ReplicationLinkProperties - Properties of a replication link.

func (ReplicationLinkProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ReplicationLinkProperties.

func (*ReplicationLinkProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationLinkProperties.

type ReplicationLinkType

type ReplicationLinkType string

ReplicationLinkType - Link type (GEO, NAMED).

const (
	ReplicationLinkTypeGEO   ReplicationLinkType = "GEO"
	ReplicationLinkTypeNAMED ReplicationLinkType = "NAMED"
)

func PossibleReplicationLinkTypeValues

func PossibleReplicationLinkTypeValues() []ReplicationLinkType

PossibleReplicationLinkTypeValues returns the possible values for the ReplicationLinkType const type.

func (ReplicationLinkType) ToPtr

ToPtr returns a *ReplicationLinkType pointing to the current value.

type ReplicationLinksClient

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

ReplicationLinksClient contains the methods for the ReplicationLinks group. Don't use this type directly, use NewReplicationLinksClient() instead.

func NewReplicationLinksClient

func NewReplicationLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ReplicationLinksClient

NewReplicationLinksClient creates a new instance of ReplicationLinksClient with the specified values. subscriptionID - The 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 (*ReplicationLinksClient) BeginFailover

func (client *ReplicationLinksClient) BeginFailover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginFailoverOptions) (ReplicationLinksClientFailoverPollerResponse, error)

BeginFailover - Sets which replica database is primary by failing over from the current primary replica database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database that has the replication link to be failed over. linkID - The ID of the replication link to be failed over. options - ReplicationLinksClientBeginFailoverOptions contains the optional parameters for the ReplicationLinksClient.BeginFailover method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ReplicationLinkFailover.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewReplicationLinksClient("<subscription-id>", cred, nil)
	poller, err := client.BeginFailover(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<link-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ReplicationLinksClient) BeginFailoverAllowDataLoss

func (client *ReplicationLinksClient) BeginFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginFailoverAllowDataLossOptions) (ReplicationLinksClientFailoverAllowDataLossPollerResponse, error)

BeginFailoverAllowDataLoss - Sets which replica database is primary by failing over from the current primary replica database. This operation might result in data loss. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database that has the replication link to be failed over. linkID - The ID of the replication link to be failed over. options - ReplicationLinksClientBeginFailoverAllowDataLossOptions contains the optional parameters for the ReplicationLinksClient.BeginFailoverAllowDataLoss method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ReplicationLinkFailover.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewReplicationLinksClient("<subscription-id>", cred, nil)
	poller, err := client.BeginFailoverAllowDataLoss(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<link-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (client *ReplicationLinksClient) BeginUnlink(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, parameters UnlinkParameters, options *ReplicationLinksClientBeginUnlinkOptions) (ReplicationLinksClientUnlinkPollerResponse, error)

BeginUnlink - Deletes a database replication link in forced or friendly way. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database that has the replication link to be failed over. linkID - The ID of the replication link to be failed over. parameters - The required parameters for unlinking replication link. options - ReplicationLinksClientBeginUnlinkOptions contains the optional parameters for the ReplicationLinksClient.BeginUnlink method.

func (*ReplicationLinksClient) Delete

func (client *ReplicationLinksClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientDeleteOptions) (ReplicationLinksClientDeleteResponse, error)

Delete - Deletes a database replication link. Cannot be done during failover. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database that has the replication link to be dropped. linkID - The ID of the replication link to be deleted. options - ReplicationLinksClientDeleteOptions contains the optional parameters for the ReplicationLinksClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ReplicationLinkDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewReplicationLinksClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<link-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ReplicationLinksClient) Get

func (client *ReplicationLinksClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientGetOptions) (ReplicationLinksClientGetResponse, error)

Get - Gets a replication link. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. linkID - The name of the replication link. options - ReplicationLinksClientGetOptions contains the optional parameters for the ReplicationLinksClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ReplicationLinkGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewReplicationLinksClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<link-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ReplicationLinksClientGetResult)
}
Output:

func (*ReplicationLinksClient) ListByDatabase

func (client *ReplicationLinksClient) ListByDatabase(resourceGroupName string, serverName string, databaseName string, options *ReplicationLinksClientListByDatabaseOptions) *ReplicationLinksClientListByDatabasePager

ListByDatabase - Gets a list of replication links on database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - ReplicationLinksClientListByDatabaseOptions contains the optional parameters for the ReplicationLinksClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ReplicationLinkListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewReplicationLinksClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*ReplicationLinksClient) ListByServer

func (client *ReplicationLinksClient) ListByServer(resourceGroupName string, serverName string, options *ReplicationLinksClientListByServerOptions) *ReplicationLinksClientListByServerPager

ListByServer - Gets a list of replication links. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ReplicationLinksClientListByServerOptions contains the optional parameters for the ReplicationLinksClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ReplicationLinkListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewReplicationLinksClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ReplicationLinksClientBeginFailoverAllowDataLossOptions added in v0.3.0

type ReplicationLinksClientBeginFailoverAllowDataLossOptions struct {
}

ReplicationLinksClientBeginFailoverAllowDataLossOptions contains the optional parameters for the ReplicationLinksClient.BeginFailoverAllowDataLoss method.

type ReplicationLinksClientBeginFailoverOptions added in v0.3.0

type ReplicationLinksClientBeginFailoverOptions struct {
}

ReplicationLinksClientBeginFailoverOptions contains the optional parameters for the ReplicationLinksClient.BeginFailover method.

type ReplicationLinksClientBeginUnlinkOptions added in v0.3.0

type ReplicationLinksClientBeginUnlinkOptions struct {
}

ReplicationLinksClientBeginUnlinkOptions contains the optional parameters for the ReplicationLinksClient.BeginUnlink method.

type ReplicationLinksClientDeleteOptions added in v0.3.0

type ReplicationLinksClientDeleteOptions struct {
}

ReplicationLinksClientDeleteOptions contains the optional parameters for the ReplicationLinksClient.Delete method.

type ReplicationLinksClientDeleteResponse added in v0.3.0

type ReplicationLinksClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ReplicationLinksClientDeleteResponse contains the response from method ReplicationLinksClient.Delete.

type ReplicationLinksClientFailoverAllowDataLossPoller added in v0.3.0

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

ReplicationLinksClientFailoverAllowDataLossPoller provides polling facilities until the operation reaches a terminal state.

func (*ReplicationLinksClientFailoverAllowDataLossPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ReplicationLinksClientFailoverAllowDataLossPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ReplicationLinksClientFailoverAllowDataLossResponse will be returned.

func (*ReplicationLinksClientFailoverAllowDataLossPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ReplicationLinksClientFailoverAllowDataLossPoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ReplicationLinksClientFailoverAllowDataLossPollerResponse added in v0.3.0

type ReplicationLinksClientFailoverAllowDataLossPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ReplicationLinksClientFailoverAllowDataLossPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ReplicationLinksClientFailoverAllowDataLossPollerResponse contains the response from method ReplicationLinksClient.FailoverAllowDataLoss.

func (ReplicationLinksClientFailoverAllowDataLossPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ReplicationLinksClientFailoverAllowDataLossPollerResponse) Resume added in v0.3.0

Resume rehydrates a ReplicationLinksClientFailoverAllowDataLossPollerResponse from the provided client and resume token.

type ReplicationLinksClientFailoverAllowDataLossResponse added in v0.3.0

type ReplicationLinksClientFailoverAllowDataLossResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ReplicationLinksClientFailoverAllowDataLossResponse contains the response from method ReplicationLinksClient.FailoverAllowDataLoss.

type ReplicationLinksClientFailoverPoller added in v0.3.0

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

ReplicationLinksClientFailoverPoller provides polling facilities until the operation reaches a terminal state.

func (*ReplicationLinksClientFailoverPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ReplicationLinksClientFailoverPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ReplicationLinksClientFailoverResponse will be returned.

func (*ReplicationLinksClientFailoverPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ReplicationLinksClientFailoverPoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ReplicationLinksClientFailoverPollerResponse added in v0.3.0

type ReplicationLinksClientFailoverPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ReplicationLinksClientFailoverPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ReplicationLinksClientFailoverPollerResponse contains the response from method ReplicationLinksClient.Failover.

func (ReplicationLinksClientFailoverPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ReplicationLinksClientFailoverPollerResponse) Resume added in v0.3.0

Resume rehydrates a ReplicationLinksClientFailoverPollerResponse from the provided client and resume token.

type ReplicationLinksClientFailoverResponse added in v0.3.0

type ReplicationLinksClientFailoverResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ReplicationLinksClientFailoverResponse contains the response from method ReplicationLinksClient.Failover.

type ReplicationLinksClientGetOptions added in v0.3.0

type ReplicationLinksClientGetOptions struct {
}

ReplicationLinksClientGetOptions contains the optional parameters for the ReplicationLinksClient.Get method.

type ReplicationLinksClientGetResponse added in v0.3.0

type ReplicationLinksClientGetResponse struct {
	ReplicationLinksClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ReplicationLinksClientGetResponse contains the response from method ReplicationLinksClient.Get.

type ReplicationLinksClientGetResult added in v0.3.0

type ReplicationLinksClientGetResult struct {
	ReplicationLink
}

ReplicationLinksClientGetResult contains the result from method ReplicationLinksClient.Get.

type ReplicationLinksClientListByDatabaseOptions added in v0.3.0

type ReplicationLinksClientListByDatabaseOptions struct {
}

ReplicationLinksClientListByDatabaseOptions contains the optional parameters for the ReplicationLinksClient.ListByDatabase method.

type ReplicationLinksClientListByDatabasePager added in v0.3.0

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

ReplicationLinksClientListByDatabasePager provides operations for iterating over paged responses.

func (*ReplicationLinksClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ReplicationLinksClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ReplicationLinksClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current ReplicationLinksClientListByDatabaseResponse page.

type ReplicationLinksClientListByDatabaseResponse added in v0.3.0

type ReplicationLinksClientListByDatabaseResponse struct {
	ReplicationLinksClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ReplicationLinksClientListByDatabaseResponse contains the response from method ReplicationLinksClient.ListByDatabase.

type ReplicationLinksClientListByDatabaseResult added in v0.3.0

type ReplicationLinksClientListByDatabaseResult struct {
	ReplicationLinkListResult
}

ReplicationLinksClientListByDatabaseResult contains the result from method ReplicationLinksClient.ListByDatabase.

type ReplicationLinksClientListByServerOptions added in v0.3.0

type ReplicationLinksClientListByServerOptions struct {
}

ReplicationLinksClientListByServerOptions contains the optional parameters for the ReplicationLinksClient.ListByServer method.

type ReplicationLinksClientListByServerPager added in v0.3.0

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

ReplicationLinksClientListByServerPager provides operations for iterating over paged responses.

func (*ReplicationLinksClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ReplicationLinksClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ReplicationLinksClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current ReplicationLinksClientListByServerResponse page.

type ReplicationLinksClientListByServerResponse added in v0.3.0

type ReplicationLinksClientListByServerResponse struct {
	ReplicationLinksClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ReplicationLinksClientListByServerResponse contains the response from method ReplicationLinksClient.ListByServer.

type ReplicationLinksClientListByServerResult added in v0.3.0

type ReplicationLinksClientListByServerResult struct {
	ReplicationLinkListResult
}

ReplicationLinksClientListByServerResult contains the result from method ReplicationLinksClient.ListByServer.

type ReplicationLinksClientUnlinkPoller added in v0.3.0

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

ReplicationLinksClientUnlinkPoller provides polling facilities until the operation reaches a terminal state.

func (*ReplicationLinksClientUnlinkPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ReplicationLinksClientUnlinkPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ReplicationLinksClientUnlinkResponse will be returned.

func (*ReplicationLinksClientUnlinkPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ReplicationLinksClientUnlinkPoller) ResumeToken added in v0.3.0

func (p *ReplicationLinksClientUnlinkPoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ReplicationLinksClientUnlinkPollerResponse added in v0.3.0

type ReplicationLinksClientUnlinkPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ReplicationLinksClientUnlinkPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ReplicationLinksClientUnlinkPollerResponse contains the response from method ReplicationLinksClient.Unlink.

func (ReplicationLinksClientUnlinkPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ReplicationLinksClientUnlinkPollerResponse) Resume added in v0.3.0

Resume rehydrates a ReplicationLinksClientUnlinkPollerResponse from the provided client and resume token.

type ReplicationLinksClientUnlinkResponse added in v0.3.0

type ReplicationLinksClientUnlinkResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ReplicationLinksClientUnlinkResponse contains the response from method ReplicationLinksClient.Unlink.

type ReplicationRole

type ReplicationRole string

ReplicationRole - Local replication role.

const (
	ReplicationRolePrimary              ReplicationRole = "Primary"
	ReplicationRoleSecondary            ReplicationRole = "Secondary"
	ReplicationRoleNonReadableSecondary ReplicationRole = "NonReadableSecondary"
	ReplicationRoleSource               ReplicationRole = "Source"
	ReplicationRoleCopy                 ReplicationRole = "Copy"
)

func PossibleReplicationRoleValues

func PossibleReplicationRoleValues() []ReplicationRole

PossibleReplicationRoleValues returns the possible values for the ReplicationRole const type.

func (ReplicationRole) ToPtr

func (c ReplicationRole) ToPtr() *ReplicationRole

ToPtr returns a *ReplicationRole pointing to the current value.

type ReplicationState

type ReplicationState string

ReplicationState - Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED).

const (
	ReplicationStateCATCHUP   ReplicationState = "CATCH_UP"
	ReplicationStatePENDING   ReplicationState = "PENDING"
	ReplicationStateSEEDING   ReplicationState = "SEEDING"
	ReplicationStateSUSPENDED ReplicationState = "SUSPENDED"
)

func PossibleReplicationStateValues

func PossibleReplicationStateValues() []ReplicationState

PossibleReplicationStateValues returns the possible values for the ReplicationState const type.

func (ReplicationState) ToPtr

ToPtr returns a *ReplicationState pointing to the current value.

type Resource

type Resource struct {
	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

Resource - ARM resource.

type ResourceIdentity

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

	// The resource ids of the user assigned identities to use
	UserAssignedIdentities map[string]*UserIdentity `json:"userAssignedIdentities,omitempty"`

	// READ-ONLY; The Azure Active Directory principal id.
	PrincipalID *string `json:"principalId,omitempty" azure:"ro"`

	// READ-ONLY; The Azure Active Directory tenant id.
	TenantID *string `json:"tenantId,omitempty" azure:"ro"`
}

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.

type ResourceMoveDefinition

type ResourceMoveDefinition struct {
	// REQUIRED; The target ID for the resource
	ID *string `json:"id,omitempty"`
}

ResourceMoveDefinition - Contains the information necessary to perform a resource move (rename).

type ResourceWithWritableName

type ResourceWithWritableName struct {
	// Resource name.
	Name *string `json:"name,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ResourceWithWritableName - ARM resource.

type RestorableDroppedDatabase

type RestorableDroppedDatabase struct {
	// Resource location.
	Location *string `json:"location,omitempty"`

	// Resource properties.
	Properties *RestorableDroppedDatabaseProperties `json:"properties,omitempty"`

	// The name and tier of the SKU.
	SKU *SKU `json:"sku,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

RestorableDroppedDatabase - A restorable dropped database resource.

func (RestorableDroppedDatabase) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabase.

type RestorableDroppedDatabaseListResult

type RestorableDroppedDatabaseListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*RestorableDroppedDatabase `json:"value,omitempty" azure:"ro"`
}

RestorableDroppedDatabaseListResult - A list of restorable dropped databases.

func (RestorableDroppedDatabaseListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabaseListResult.

type RestorableDroppedDatabaseProperties

type RestorableDroppedDatabaseProperties struct {
	// READ-ONLY; The storage account type used to store backups for this database.
	BackupStorageRedundancy *BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty" azure:"ro"`

	// READ-ONLY; The creation date of the database (ISO8601 format).
	CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"`

	// READ-ONLY; The name of the database.
	DatabaseName *string `json:"databaseName,omitempty" azure:"ro"`

	// READ-ONLY; The deletion date of the database (ISO8601 format).
	DeletionDate *time.Time `json:"deletionDate,omitempty" azure:"ro"`

	// READ-ONLY; The earliest restore date of the database (ISO8601 format).
	EarliestRestoreDate *time.Time `json:"earliestRestoreDate,omitempty" azure:"ro"`

	// READ-ONLY; The max size of the database expressed in bytes.
	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty" azure:"ro"`
}

RestorableDroppedDatabaseProperties - The restorable dropped database's properties.

func (RestorableDroppedDatabaseProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabaseProperties.

func (*RestorableDroppedDatabaseProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedDatabaseProperties.

type RestorableDroppedDatabasesClient

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

RestorableDroppedDatabasesClient contains the methods for the RestorableDroppedDatabases group. Don't use this type directly, use NewRestorableDroppedDatabasesClient() instead.

func NewRestorableDroppedDatabasesClient

func NewRestorableDroppedDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *RestorableDroppedDatabasesClient

NewRestorableDroppedDatabasesClient creates a new instance of RestorableDroppedDatabasesClient with the specified values. subscriptionID - The 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 (*RestorableDroppedDatabasesClient) Get

func (client *RestorableDroppedDatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, restorableDroppedDatabaseID string, options *RestorableDroppedDatabasesClientGetOptions) (RestorableDroppedDatabasesClientGetResponse, error)

Get - Gets a restorable dropped database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - RestorableDroppedDatabasesClientGetOptions contains the optional parameters for the RestorableDroppedDatabasesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetRestorableDroppedDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewRestorableDroppedDatabasesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<restorable-dropped-database-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.RestorableDroppedDatabasesClientGetResult)
}
Output:

func (*RestorableDroppedDatabasesClient) ListByServer

ListByServer - Gets a list of restorable dropped databases. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - RestorableDroppedDatabasesClientListByServerOptions contains the optional parameters for the RestorableDroppedDatabasesClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListRestorableDroppedDatabasesByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewRestorableDroppedDatabasesClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type RestorableDroppedDatabasesClientGetOptions added in v0.3.0

type RestorableDroppedDatabasesClientGetOptions struct {
}

RestorableDroppedDatabasesClientGetOptions contains the optional parameters for the RestorableDroppedDatabasesClient.Get method.

type RestorableDroppedDatabasesClientGetResponse added in v0.3.0

type RestorableDroppedDatabasesClientGetResponse struct {
	RestorableDroppedDatabasesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

RestorableDroppedDatabasesClientGetResponse contains the response from method RestorableDroppedDatabasesClient.Get.

type RestorableDroppedDatabasesClientGetResult added in v0.3.0

type RestorableDroppedDatabasesClientGetResult struct {
	RestorableDroppedDatabase
}

RestorableDroppedDatabasesClientGetResult contains the result from method RestorableDroppedDatabasesClient.Get.

type RestorableDroppedDatabasesClientListByServerOptions added in v0.3.0

type RestorableDroppedDatabasesClientListByServerOptions struct {
}

RestorableDroppedDatabasesClientListByServerOptions contains the optional parameters for the RestorableDroppedDatabasesClient.ListByServer method.

type RestorableDroppedDatabasesClientListByServerPager added in v0.3.0

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

RestorableDroppedDatabasesClientListByServerPager provides operations for iterating over paged responses.

func (*RestorableDroppedDatabasesClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*RestorableDroppedDatabasesClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*RestorableDroppedDatabasesClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current RestorableDroppedDatabasesClientListByServerResponse page.

type RestorableDroppedDatabasesClientListByServerResponse added in v0.3.0

type RestorableDroppedDatabasesClientListByServerResponse struct {
	RestorableDroppedDatabasesClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

RestorableDroppedDatabasesClientListByServerResponse contains the response from method RestorableDroppedDatabasesClient.ListByServer.

type RestorableDroppedDatabasesClientListByServerResult added in v0.3.0

type RestorableDroppedDatabasesClientListByServerResult struct {
	RestorableDroppedDatabaseListResult
}

RestorableDroppedDatabasesClientListByServerResult contains the result from method RestorableDroppedDatabasesClient.ListByServer.

type RestorableDroppedManagedDatabase

type RestorableDroppedManagedDatabase struct {
	// REQUIRED; Resource location.
	Location *string `json:"location,omitempty"`

	// Resource properties.
	Properties *RestorableDroppedManagedDatabaseProperties `json:"properties,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

RestorableDroppedManagedDatabase - A restorable dropped managed database resource.

func (RestorableDroppedManagedDatabase) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorableDroppedManagedDatabase.

type RestorableDroppedManagedDatabaseListResult

type RestorableDroppedManagedDatabaseListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*RestorableDroppedManagedDatabase `json:"value,omitempty" azure:"ro"`
}

RestorableDroppedManagedDatabaseListResult - A list of restorable dropped managed databases.

func (RestorableDroppedManagedDatabaseListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type RestorableDroppedManagedDatabaseListResult.

type RestorableDroppedManagedDatabaseProperties

type RestorableDroppedManagedDatabaseProperties struct {
	// READ-ONLY; The creation date of the database (ISO8601 format).
	CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"`

	// READ-ONLY; The name of the database.
	DatabaseName *string `json:"databaseName,omitempty" azure:"ro"`

	// READ-ONLY; The deletion date of the database (ISO8601 format).
	DeletionDate *time.Time `json:"deletionDate,omitempty" azure:"ro"`

	// READ-ONLY; The earliest restore date of the database (ISO8601 format).
	EarliestRestoreDate *time.Time `json:"earliestRestoreDate,omitempty" azure:"ro"`
}

RestorableDroppedManagedDatabaseProperties - The restorable dropped managed database's properties.

func (RestorableDroppedManagedDatabaseProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type RestorableDroppedManagedDatabaseProperties.

func (*RestorableDroppedManagedDatabaseProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedManagedDatabaseProperties.

type RestorableDroppedManagedDatabasesClient

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

RestorableDroppedManagedDatabasesClient contains the methods for the RestorableDroppedManagedDatabases group. Don't use this type directly, use NewRestorableDroppedManagedDatabasesClient() instead.

func NewRestorableDroppedManagedDatabasesClient

func NewRestorableDroppedManagedDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *RestorableDroppedManagedDatabasesClient

NewRestorableDroppedManagedDatabasesClient creates a new instance of RestorableDroppedManagedDatabasesClient with the specified values. subscriptionID - The 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 (*RestorableDroppedManagedDatabasesClient) Get

Get - Gets a restorable dropped managed database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - RestorableDroppedManagedDatabasesClientGetOptions contains the optional parameters for the RestorableDroppedManagedDatabasesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetRestorableDroppedManagedDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewRestorableDroppedManagedDatabasesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<managed-instance-name>",
		"<restorable-dropped-database-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.RestorableDroppedManagedDatabasesClientGetResult)
}
Output:

func (*RestorableDroppedManagedDatabasesClient) ListByInstance

ListByInstance - Gets a list of restorable dropped managed databases. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - RestorableDroppedManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RestorableDroppedManagedDatabasesClient.ListByInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/RestorableDroppedManagedDatabaseListByManagedInstance.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewRestorableDroppedManagedDatabasesClient("<subscription-id>", cred, nil)
	pager := client.ListByInstance("<resource-group-name>",
		"<managed-instance-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type RestorableDroppedManagedDatabasesClientGetOptions added in v0.3.0

type RestorableDroppedManagedDatabasesClientGetOptions struct {
}

RestorableDroppedManagedDatabasesClientGetOptions contains the optional parameters for the RestorableDroppedManagedDatabasesClient.Get method.

type RestorableDroppedManagedDatabasesClientGetResponse added in v0.3.0

type RestorableDroppedManagedDatabasesClientGetResponse struct {
	RestorableDroppedManagedDatabasesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

RestorableDroppedManagedDatabasesClientGetResponse contains the response from method RestorableDroppedManagedDatabasesClient.Get.

type RestorableDroppedManagedDatabasesClientGetResult added in v0.3.0

type RestorableDroppedManagedDatabasesClientGetResult struct {
	RestorableDroppedManagedDatabase
}

RestorableDroppedManagedDatabasesClientGetResult contains the result from method RestorableDroppedManagedDatabasesClient.Get.

type RestorableDroppedManagedDatabasesClientListByInstanceOptions added in v0.3.0

type RestorableDroppedManagedDatabasesClientListByInstanceOptions struct {
}

RestorableDroppedManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RestorableDroppedManagedDatabasesClient.ListByInstance method.

type RestorableDroppedManagedDatabasesClientListByInstancePager added in v0.3.0

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

RestorableDroppedManagedDatabasesClientListByInstancePager provides operations for iterating over paged responses.

func (*RestorableDroppedManagedDatabasesClientListByInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*RestorableDroppedManagedDatabasesClientListByInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*RestorableDroppedManagedDatabasesClientListByInstancePager) PageResponse added in v0.3.0

PageResponse returns the current RestorableDroppedManagedDatabasesClientListByInstanceResponse page.

type RestorableDroppedManagedDatabasesClientListByInstanceResponse added in v0.3.0

type RestorableDroppedManagedDatabasesClientListByInstanceResponse struct {
	RestorableDroppedManagedDatabasesClientListByInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

RestorableDroppedManagedDatabasesClientListByInstanceResponse contains the response from method RestorableDroppedManagedDatabasesClient.ListByInstance.

type RestorableDroppedManagedDatabasesClientListByInstanceResult added in v0.3.0

type RestorableDroppedManagedDatabasesClientListByInstanceResult struct {
	RestorableDroppedManagedDatabaseListResult
}

RestorableDroppedManagedDatabasesClientListByInstanceResult contains the result from method RestorableDroppedManagedDatabasesClient.ListByInstance.

type RestoreDetailsName

type RestoreDetailsName string
const (
	RestoreDetailsNameDefault RestoreDetailsName = "Default"
)

func PossibleRestoreDetailsNameValues

func PossibleRestoreDetailsNameValues() []RestoreDetailsName

PossibleRestoreDetailsNameValues returns the possible values for the RestoreDetailsName const type.

func (RestoreDetailsName) ToPtr

ToPtr returns a *RestoreDetailsName pointing to the current value.

type RestorePoint

type RestorePoint struct {
	// Resource properties.
	Properties *RestorePointProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource location.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

RestorePoint - Database restore points.

type RestorePointListResult

type RestorePointListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*RestorePoint `json:"value,omitempty" azure:"ro"`
}

RestorePointListResult - A list of long term retention backups.

func (RestorePointListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorePointListResult.

type RestorePointProperties

type RestorePointProperties struct {
	// READ-ONLY; The earliest time to which this database can be restored
	EarliestRestoreDate *time.Time `json:"earliestRestoreDate,omitempty" azure:"ro"`

	// READ-ONLY; The time the backup was taken
	RestorePointCreationDate *time.Time `json:"restorePointCreationDate,omitempty" azure:"ro"`

	// READ-ONLY; The label of restore point for backup request by user
	RestorePointLabel *string `json:"restorePointLabel,omitempty" azure:"ro"`

	// READ-ONLY; The type of restore point
	RestorePointType *RestorePointType `json:"restorePointType,omitempty" azure:"ro"`
}

RestorePointProperties - Properties of a database restore point

func (RestorePointProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RestorePointProperties.

func (*RestorePointProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointProperties.

type RestorePointType

type RestorePointType string

RestorePointType - The type of restore point

const (
	RestorePointTypeCONTINUOUS RestorePointType = "CONTINUOUS"
	RestorePointTypeDISCRETE   RestorePointType = "DISCRETE"
)

func PossibleRestorePointTypeValues

func PossibleRestorePointTypeValues() []RestorePointType

PossibleRestorePointTypeValues returns the possible values for the RestorePointType const type.

func (RestorePointType) ToPtr

ToPtr returns a *RestorePointType pointing to the current value.

type RestorePointsClient

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

RestorePointsClient contains the methods for the RestorePoints group. Don't use this type directly, use NewRestorePointsClient() instead.

func NewRestorePointsClient

func NewRestorePointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *RestorePointsClient

NewRestorePointsClient creates a new instance of RestorePointsClient with the specified values. subscriptionID - The 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 (*RestorePointsClient) BeginCreate

func (client *RestorePointsClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters CreateDatabaseRestorePointDefinition, options *RestorePointsClientBeginCreateOptions) (RestorePointsClientCreatePollerResponse, error)

BeginCreate - Creates a restore point for a data warehouse. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. parameters - The definition for creating the restore point of this database. options - RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsPost.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewRestorePointsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.CreateDatabaseRestorePointDefinition{
			RestorePointLabel: to.StringPtr("<restore-point-label>"),
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.RestorePointsClientCreateResult)
}
Output:

func (*RestorePointsClient) Delete

func (client *RestorePointsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, restorePointName string, options *RestorePointsClientDeleteOptions) (RestorePointsClientDeleteResponse, error)

Delete - Deletes a restore point. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. restorePointName - The name of the restore point. options - RestorePointsClientDeleteOptions contains the optional parameters for the RestorePointsClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewRestorePointsClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<restore-point-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*RestorePointsClient) Get

func (client *RestorePointsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, restorePointName string, options *RestorePointsClientGetOptions) (RestorePointsClientGetResponse, error)

Get - Gets a restore point. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. restorePointName - The name of the restore point. options - RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewRestorePointsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<restore-point-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.RestorePointsClientGetResult)
}
Output:

func (*RestorePointsClient) ListByDatabase

func (client *RestorePointsClient) ListByDatabase(resourceGroupName string, serverName string, databaseName string, options *RestorePointsClientListByDatabaseOptions) *RestorePointsClientListByDatabasePager

ListByDatabase - Gets a list of database restore points. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - RestorePointsClientListByDatabaseOptions contains the optional parameters for the RestorePointsClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewRestorePointsClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type RestorePointsClientBeginCreateOptions added in v0.3.0

type RestorePointsClientBeginCreateOptions struct {
}

RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate method.

type RestorePointsClientCreatePoller added in v0.3.0

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

RestorePointsClientCreatePoller provides polling facilities until the operation reaches a terminal state.

func (*RestorePointsClientCreatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*RestorePointsClientCreatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final RestorePointsClientCreateResponse will be returned.

func (*RestorePointsClientCreatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*RestorePointsClientCreatePoller) ResumeToken added in v0.3.0

func (p *RestorePointsClientCreatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type RestorePointsClientCreatePollerResponse added in v0.3.0

type RestorePointsClientCreatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *RestorePointsClientCreatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

RestorePointsClientCreatePollerResponse contains the response from method RestorePointsClient.Create.

func (RestorePointsClientCreatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*RestorePointsClientCreatePollerResponse) Resume added in v0.3.0

Resume rehydrates a RestorePointsClientCreatePollerResponse from the provided client and resume token.

type RestorePointsClientCreateResponse added in v0.3.0

type RestorePointsClientCreateResponse struct {
	RestorePointsClientCreateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

RestorePointsClientCreateResponse contains the response from method RestorePointsClient.Create.

type RestorePointsClientCreateResult added in v0.3.0

type RestorePointsClientCreateResult struct {
	RestorePoint
}

RestorePointsClientCreateResult contains the result from method RestorePointsClient.Create.

type RestorePointsClientDeleteOptions added in v0.3.0

type RestorePointsClientDeleteOptions struct {
}

RestorePointsClientDeleteOptions contains the optional parameters for the RestorePointsClient.Delete method.

type RestorePointsClientDeleteResponse added in v0.3.0

type RestorePointsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

RestorePointsClientDeleteResponse contains the response from method RestorePointsClient.Delete.

type RestorePointsClientGetOptions added in v0.3.0

type RestorePointsClientGetOptions struct {
}

RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method.

type RestorePointsClientGetResponse added in v0.3.0

type RestorePointsClientGetResponse struct {
	RestorePointsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

RestorePointsClientGetResponse contains the response from method RestorePointsClient.Get.

type RestorePointsClientGetResult added in v0.3.0

type RestorePointsClientGetResult struct {
	RestorePoint
}

RestorePointsClientGetResult contains the result from method RestorePointsClient.Get.

type RestorePointsClientListByDatabaseOptions added in v0.3.0

type RestorePointsClientListByDatabaseOptions struct {
}

RestorePointsClientListByDatabaseOptions contains the optional parameters for the RestorePointsClient.ListByDatabase method.

type RestorePointsClientListByDatabasePager added in v0.3.0

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

RestorePointsClientListByDatabasePager provides operations for iterating over paged responses.

func (*RestorePointsClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*RestorePointsClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*RestorePointsClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current RestorePointsClientListByDatabaseResponse page.

type RestorePointsClientListByDatabaseResponse added in v0.3.0

type RestorePointsClientListByDatabaseResponse struct {
	RestorePointsClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

RestorePointsClientListByDatabaseResponse contains the response from method RestorePointsClient.ListByDatabase.

type RestorePointsClientListByDatabaseResult added in v0.3.0

type RestorePointsClientListByDatabaseResult struct {
	RestorePointListResult
}

RestorePointsClientListByDatabaseResult contains the result from method RestorePointsClient.ListByDatabase.

type SKU

type SKU struct {
	// REQUIRED; The name of the SKU, typically, a letter + Number code, e.g. P3.
	Name *string `json:"name,omitempty"`

	// Capacity of the particular SKU.
	Capacity *int32 `json:"capacity,omitempty"`

	// If the service has different generations of hardware, for the same SKU, then that can be captured here.
	Family *string `json:"family,omitempty"`

	// Size of the particular SKU
	Size *string `json:"size,omitempty"`

	// The tier or edition of the particular SKU, e.g. Basic, Premium.
	Tier *string `json:"tier,omitempty"`
}

SKU - An ARM Resource SKU.

type SQLAgentConfigurationPropertiesState

type SQLAgentConfigurationPropertiesState string

SQLAgentConfigurationPropertiesState - The state of Sql Agent.

const (
	SQLAgentConfigurationPropertiesStateDisabled SQLAgentConfigurationPropertiesState = "Disabled"
	SQLAgentConfigurationPropertiesStateEnabled  SQLAgentConfigurationPropertiesState = "Enabled"
)

func PossibleSQLAgentConfigurationPropertiesStateValues

func PossibleSQLAgentConfigurationPropertiesStateValues() []SQLAgentConfigurationPropertiesState

PossibleSQLAgentConfigurationPropertiesStateValues returns the possible values for the SQLAgentConfigurationPropertiesState const type.

func (SQLAgentConfigurationPropertiesState) ToPtr

ToPtr returns a *SQLAgentConfigurationPropertiesState pointing to the current value.

type SampleName

type SampleName string

SampleName - The name of the sample schema to apply when creating this database.

const (
	SampleNameAdventureWorksLT       SampleName = "AdventureWorksLT"
	SampleNameWideWorldImportersFull SampleName = "WideWorldImportersFull"
	SampleNameWideWorldImportersStd  SampleName = "WideWorldImportersStd"
)

func PossibleSampleNameValues

func PossibleSampleNameValues() []SampleName

PossibleSampleNameValues returns the possible values for the SampleName const type.

func (SampleName) ToPtr

func (c SampleName) ToPtr() *SampleName

ToPtr returns a *SampleName pointing to the current value.

type SecondaryType

type SecondaryType string

SecondaryType - The secondary type of the database if it is a secondary. Valid values are Geo and Named.

const (
	SecondaryTypeGeo   SecondaryType = "Geo"
	SecondaryTypeNamed SecondaryType = "Named"
)

func PossibleSecondaryTypeValues

func PossibleSecondaryTypeValues() []SecondaryType

PossibleSecondaryTypeValues returns the possible values for the SecondaryType const type.

func (SecondaryType) ToPtr

func (c SecondaryType) ToPtr() *SecondaryType

ToPtr returns a *SecondaryType pointing to the current value.

type SecurityAlertPolicyName

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

func PossibleSecurityAlertPolicyNameValues

func PossibleSecurityAlertPolicyNameValues() []SecurityAlertPolicyName

PossibleSecurityAlertPolicyNameValues returns the possible values for the SecurityAlertPolicyName const type.

func (SecurityAlertPolicyName) ToPtr

ToPtr returns a *SecurityAlertPolicyName pointing to the current value.

type SecurityAlertPolicyProperties

type SecurityAlertPolicyProperties struct {
	// REQUIRED; Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on
	// the specific database.
	State *SecurityAlertPolicyState `json:"state,omitempty"`

	// Specifies an array of alerts that are disabled. Allowed values are: SqlInjection, SqlInjectionVulnerability, AccessAnomaly,
	// DataExfiltration, UnsafeAction, Brute_Force
	DisabledAlerts []*string `json:"disabledAlerts,omitempty"`

	// Specifies that the alert is sent to the account administrators.
	EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"`

	// Specifies an array of e-mail addresses to which the alert is sent.
	EmailAddresses []*string `json:"emailAddresses,omitempty"`

	// Specifies the number of days to keep in the Threat Detection audit logs.
	RetentionDays *int32 `json:"retentionDays,omitempty"`

	// Specifies the identifier key of the Threat Detection audit storage account.
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`

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

	// READ-ONLY; Specifies the UTC creation time of the policy.
	CreationTime *time.Time `json:"creationTime,omitempty" azure:"ro"`
}

SecurityAlertPolicyProperties - Properties of a security alert policy.

func (SecurityAlertPolicyProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SecurityAlertPolicyProperties.

func (*SecurityAlertPolicyProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertPolicyProperties.

type SecurityAlertPolicyState

type SecurityAlertPolicyState string

SecurityAlertPolicyState - Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific database.

const (
	SecurityAlertPolicyStateNew      SecurityAlertPolicyState = "New"
	SecurityAlertPolicyStateEnabled  SecurityAlertPolicyState = "Enabled"
	SecurityAlertPolicyStateDisabled SecurityAlertPolicyState = "Disabled"
)

func PossibleSecurityAlertPolicyStateValues

func PossibleSecurityAlertPolicyStateValues() []SecurityAlertPolicyState

PossibleSecurityAlertPolicyStateValues returns the possible values for the SecurityAlertPolicyState const type.

func (SecurityAlertPolicyState) ToPtr

ToPtr returns a *SecurityAlertPolicyState pointing to the current value.

type SecurityAlertsPolicyProperties

type SecurityAlertsPolicyProperties struct {
	// REQUIRED; Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on
	// the specific database.
	State *SecurityAlertsPolicyState `json:"state,omitempty"`

	// Specifies an array of alerts that are disabled. Allowed values are: SqlInjection, SqlInjectionVulnerability, AccessAnomaly,
	// DataExfiltration, UnsafeAction, Brute_Force
	DisabledAlerts []*string `json:"disabledAlerts,omitempty"`

	// Specifies that the alert is sent to the account administrators.
	EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"`

	// Specifies an array of e-mail addresses to which the alert is sent.
	EmailAddresses []*string `json:"emailAddresses,omitempty"`

	// Specifies the number of days to keep in the Threat Detection audit logs.
	RetentionDays *int32 `json:"retentionDays,omitempty"`

	// Specifies the identifier key of the Threat Detection audit storage account.
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`

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

	// READ-ONLY; Specifies the UTC creation time of the policy.
	CreationTime *time.Time `json:"creationTime,omitempty" azure:"ro"`
}

SecurityAlertsPolicyProperties - Properties of a security alert policy.

func (SecurityAlertsPolicyProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SecurityAlertsPolicyProperties.

func (*SecurityAlertsPolicyProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertsPolicyProperties.

type SecurityAlertsPolicyState

type SecurityAlertsPolicyState string

SecurityAlertsPolicyState - Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific database.

const (
	SecurityAlertsPolicyStateEnabled  SecurityAlertsPolicyState = "Enabled"
	SecurityAlertsPolicyStateDisabled SecurityAlertsPolicyState = "Disabled"
)

func PossibleSecurityAlertsPolicyStateValues

func PossibleSecurityAlertsPolicyStateValues() []SecurityAlertsPolicyState

PossibleSecurityAlertsPolicyStateValues returns the possible values for the SecurityAlertsPolicyState const type.

func (SecurityAlertsPolicyState) ToPtr

ToPtr returns a *SecurityAlertsPolicyState pointing to the current value.

type SecurityEvent

type SecurityEvent struct {
	// Resource properties.
	Properties *SecurityEventProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

SecurityEvent - A security event.

type SecurityEventCollection

type SecurityEventCollection struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*SecurityEvent `json:"value,omitempty" azure:"ro"`
}

SecurityEventCollection - A list of security events.

func (SecurityEventCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SecurityEventCollection.

type SecurityEventProperties

type SecurityEventProperties struct {
	// READ-ONLY; The application used to execute the statement.
	ApplicationName *string `json:"applicationName,omitempty" azure:"ro"`

	// READ-ONLY; The IP address of the client who executed the statement.
	ClientIP *string `json:"clientIp,omitempty" azure:"ro"`

	// READ-ONLY; The database name
	Database *string `json:"database,omitempty" azure:"ro"`

	// READ-ONLY; The time when the security event occurred.
	EventTime *time.Time `json:"eventTime,omitempty" azure:"ro"`

	// READ-ONLY; The principal user who executed the statement
	PrincipalName *string `json:"principalName,omitempty" azure:"ro"`

	// READ-ONLY; The sql injection additional properties, populated only if the type of the security event is sql injection.
	SecurityEventSQLInjectionAdditionalProperties *SecurityEventSQLInjectionAdditionalProperties `json:"securityEventSqlInjectionAdditionalProperties,omitempty" azure:"ro"`

	// READ-ONLY; The type of the security event.
	SecurityEventType *SecurityEventType `json:"securityEventType,omitempty" azure:"ro"`

	// READ-ONLY; The server name
	Server *string `json:"server,omitempty" azure:"ro"`

	// READ-ONLY; The subscription name
	Subscription *string `json:"subscription,omitempty" azure:"ro"`
}

SecurityEventProperties - The properties of a security event.

func (SecurityEventProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SecurityEventProperties.

func (*SecurityEventProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEventProperties.

type SecurityEventSQLInjectionAdditionalProperties

type SecurityEventSQLInjectionAdditionalProperties struct {
	// READ-ONLY; The sql error code
	ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"`

	// READ-ONLY; The sql error message
	ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"`

	// READ-ONLY; The sql error severity
	ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"`

	// READ-ONLY; The statement
	Statement *string `json:"statement,omitempty" azure:"ro"`

	// READ-ONLY; The statement highlight length
	StatementHighlightLength *int32 `json:"statementHighlightLength,omitempty" azure:"ro"`

	// READ-ONLY; The statement highlight offset
	StatementHighlightOffset *int32 `json:"statementHighlightOffset,omitempty" azure:"ro"`

	// READ-ONLY; The threat ID.
	ThreatID *string `json:"threatId,omitempty" azure:"ro"`
}

SecurityEventSQLInjectionAdditionalProperties - The properties of a security event sql injection additional properties.

type SecurityEventType

type SecurityEventType string

SecurityEventType - The type of the security event.

const (
	SecurityEventTypeUndefined                 SecurityEventType = "Undefined"
	SecurityEventTypeSQLInjectionVulnerability SecurityEventType = "SqlInjectionVulnerability"
	SecurityEventTypeSQLInjectionExploit       SecurityEventType = "SqlInjectionExploit"
)

func PossibleSecurityEventTypeValues

func PossibleSecurityEventTypeValues() []SecurityEventType

PossibleSecurityEventTypeValues returns the possible values for the SecurityEventType const type.

func (SecurityEventType) ToPtr

ToPtr returns a *SecurityEventType pointing to the current value.

type SecurityEventsFilterParameters

type SecurityEventsFilterParameters struct {
	// Filter on the event time.
	EventTime *time.Time `json:"eventTime,omitempty"`

	// Whether to show server records or not.
	ShowServerRecords *bool `json:"showServerRecords,omitempty"`
}

SecurityEventsFilterParameters - The properties that are supported in the $filter operation.

func (SecurityEventsFilterParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SecurityEventsFilterParameters.

func (*SecurityEventsFilterParameters) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEventsFilterParameters.

type SensitivityLabel

type SensitivityLabel struct {
	// Resource properties.
	Properties *SensitivityLabelProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource that manages the sensitivity label.
	ManagedBy *string `json:"managedBy,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

SensitivityLabel - A sensitivity label.

type SensitivityLabelListResult

type SensitivityLabelListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*SensitivityLabel `json:"value,omitempty" azure:"ro"`
}

SensitivityLabelListResult - A list of sensitivity labels.

func (SensitivityLabelListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SensitivityLabelListResult.

type SensitivityLabelProperties

type SensitivityLabelProperties struct {
	// The information type.
	InformationType *string `json:"informationType,omitempty"`

	// The information type ID.
	InformationTypeID *string `json:"informationTypeId,omitempty"`

	// The label ID.
	LabelID *string `json:"labelId,omitempty"`

	// The label name.
	LabelName *string               `json:"labelName,omitempty"`
	Rank      *SensitivityLabelRank `json:"rank,omitempty"`

	// READ-ONLY; The column name.
	ColumnName *string `json:"columnName,omitempty" azure:"ro"`

	// READ-ONLY; Is sensitivity recommendation disabled. Applicable for recommended sensitivity label only. Specifies whether
	// the sensitivity recommendation on this column is disabled (dismissed) or not.
	IsDisabled *bool `json:"isDisabled,omitempty" azure:"ro"`

	// READ-ONLY; The schema name.
	SchemaName *string `json:"schemaName,omitempty" azure:"ro"`

	// READ-ONLY; The table name.
	TableName *string `json:"tableName,omitempty" azure:"ro"`
}

SensitivityLabelProperties - Properties of a sensitivity label.

type SensitivityLabelRank

type SensitivityLabelRank string
const (
	SensitivityLabelRankNone     SensitivityLabelRank = "None"
	SensitivityLabelRankLow      SensitivityLabelRank = "Low"
	SensitivityLabelRankMedium   SensitivityLabelRank = "Medium"
	SensitivityLabelRankHigh     SensitivityLabelRank = "High"
	SensitivityLabelRankCritical SensitivityLabelRank = "Critical"
)

func PossibleSensitivityLabelRankValues

func PossibleSensitivityLabelRankValues() []SensitivityLabelRank

PossibleSensitivityLabelRankValues returns the possible values for the SensitivityLabelRank const type.

func (SensitivityLabelRank) ToPtr

ToPtr returns a *SensitivityLabelRank pointing to the current value.

type SensitivityLabelSource

type SensitivityLabelSource string
const (
	SensitivityLabelSourceCurrent     SensitivityLabelSource = "current"
	SensitivityLabelSourceRecommended SensitivityLabelSource = "recommended"
)

func PossibleSensitivityLabelSourceValues

func PossibleSensitivityLabelSourceValues() []SensitivityLabelSource

PossibleSensitivityLabelSourceValues returns the possible values for the SensitivityLabelSource const type.

func (SensitivityLabelSource) ToPtr

ToPtr returns a *SensitivityLabelSource pointing to the current value.

type SensitivityLabelUpdate

type SensitivityLabelUpdate struct {
	// Resource properties.
	Properties *SensitivityLabelUpdateProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

SensitivityLabelUpdate - A sensitivity label update operation.

type SensitivityLabelUpdateKind

type SensitivityLabelUpdateKind string
const (
	SensitivityLabelUpdateKindSet    SensitivityLabelUpdateKind = "set"
	SensitivityLabelUpdateKindRemove SensitivityLabelUpdateKind = "remove"
)

func PossibleSensitivityLabelUpdateKindValues

func PossibleSensitivityLabelUpdateKindValues() []SensitivityLabelUpdateKind

PossibleSensitivityLabelUpdateKindValues returns the possible values for the SensitivityLabelUpdateKind const type.

func (SensitivityLabelUpdateKind) ToPtr

ToPtr returns a *SensitivityLabelUpdateKind pointing to the current value.

type SensitivityLabelUpdateList

type SensitivityLabelUpdateList struct {
	Operations []*SensitivityLabelUpdate `json:"operations,omitempty"`
}

SensitivityLabelUpdateList - A list of sensitivity label update operations.

func (SensitivityLabelUpdateList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SensitivityLabelUpdateList.

type SensitivityLabelUpdateProperties

type SensitivityLabelUpdateProperties struct {
	// REQUIRED; Column name to update.
	Column *string `json:"column,omitempty"`

	// REQUIRED
	Op *SensitivityLabelUpdateKind `json:"op,omitempty"`

	// REQUIRED; Schema name of the column to update.
	Schema *string `json:"schema,omitempty"`

	// REQUIRED; Table name of the column to update.
	Table *string `json:"table,omitempty"`

	// The sensitivity label information to apply on a column.
	SensitivityLabel *SensitivityLabel `json:"sensitivityLabel,omitempty"`
}

SensitivityLabelUpdateProperties - Properties of an operation executed on a sensitivity label.

type SensitivityLabelsClient

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

SensitivityLabelsClient contains the methods for the SensitivityLabels group. Don't use this type directly, use NewSensitivityLabelsClient() instead.

func NewSensitivityLabelsClient

func NewSensitivityLabelsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SensitivityLabelsClient

NewSensitivityLabelsClient creates a new instance of SensitivityLabelsClient with the specified values. subscriptionID - The 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 (*SensitivityLabelsClient) CreateOrUpdate

func (client *SensitivityLabelsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, parameters SensitivityLabel, options *SensitivityLabelsClientCreateOrUpdateOptions) (SensitivityLabelsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates the sensitivity label of a given column If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. columnName - The name of the column. parameters - The column sensitivity label resource. options - SensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the SensitivityLabelsClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelCreateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSensitivityLabelsClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		"<column-name>",
		armsql.SensitivityLabel{
			Properties: &armsql.SensitivityLabelProperties{
				InformationType:   to.StringPtr("<information-type>"),
				InformationTypeID: to.StringPtr("<information-type-id>"),
				LabelID:           to.StringPtr("<label-id>"),
				LabelName:         to.StringPtr("<label-name>"),
				Rank:              armsql.SensitivityLabelRankLow.ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.SensitivityLabelsClientCreateOrUpdateResult)
}
Output:

func (*SensitivityLabelsClient) Delete

func (client *SensitivityLabelsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, options *SensitivityLabelsClientDeleteOptions) (SensitivityLabelsClientDeleteResponse, error)

Delete - Deletes the sensitivity label of a given column If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. columnName - The name of the column. options - SensitivityLabelsClientDeleteOptions contains the optional parameters for the SensitivityLabelsClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSensitivityLabelsClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		"<column-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*SensitivityLabelsClient) DisableRecommendation

func (client *SensitivityLabelsClient) DisableRecommendation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, options *SensitivityLabelsClientDisableRecommendationOptions) (SensitivityLabelsClientDisableRecommendationResponse, error)

DisableRecommendation - Disables sensitivity recommendations on a given column If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. columnName - The name of the column. options - SensitivityLabelsClientDisableRecommendationOptions contains the optional parameters for the SensitivityLabelsClient.DisableRecommendation method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelDisable.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSensitivityLabelsClient("<subscription-id>", cred, nil)
	_, err = client.DisableRecommendation(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		"<column-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*SensitivityLabelsClient) EnableRecommendation

func (client *SensitivityLabelsClient) EnableRecommendation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, options *SensitivityLabelsClientEnableRecommendationOptions) (SensitivityLabelsClientEnableRecommendationResponse, error)

EnableRecommendation - Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns) If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. columnName - The name of the column. options - SensitivityLabelsClientEnableRecommendationOptions contains the optional parameters for the SensitivityLabelsClient.EnableRecommendation method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelEnable.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSensitivityLabelsClient("<subscription-id>", cred, nil)
	_, err = client.EnableRecommendation(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		"<column-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*SensitivityLabelsClient) Get

func (client *SensitivityLabelsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource SensitivityLabelSource, options *SensitivityLabelsClientGetOptions) (SensitivityLabelsClientGetResponse, error)

Get - Gets the sensitivity label of a given column If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. schemaName - The name of the schema. tableName - The name of the table. columnName - The name of the column. sensitivityLabelSource - The source of the sensitivity label. options - SensitivityLabelsClientGetOptions contains the optional parameters for the SensitivityLabelsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSensitivityLabelsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<schema-name>",
		"<table-name>",
		"<column-name>",
		armsql.SensitivityLabelSourceCurrent,
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.SensitivityLabelsClientGetResult)
}
Output:

func (*SensitivityLabelsClient) ListCurrentByDatabase

func (client *SensitivityLabelsClient) ListCurrentByDatabase(resourceGroupName string, serverName string, databaseName string, options *SensitivityLabelsClientListCurrentByDatabaseOptions) *SensitivityLabelsClientListCurrentByDatabasePager

ListCurrentByDatabase - Gets the sensitivity labels of a given database If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - SensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.ListCurrentByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceCurrent.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSensitivityLabelsClient("<subscription-id>", cred, nil)
	pager := client.ListCurrentByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		&armsql.SensitivityLabelsClientListCurrentByDatabaseOptions{SkipToken: nil,
			Count:  nil,
			Filter: nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*SensitivityLabelsClient) ListRecommendedByDatabase

func (client *SensitivityLabelsClient) ListRecommendedByDatabase(resourceGroupName string, serverName string, databaseName string, options *SensitivityLabelsClientListRecommendedByDatabaseOptions) *SensitivityLabelsClientListRecommendedByDatabasePager

ListRecommendedByDatabase - Gets the sensitivity labels of a given database If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - SensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.ListRecommendedByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceRecommended.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSensitivityLabelsClient("<subscription-id>", cred, nil)
	pager := client.ListRecommendedByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		&armsql.SensitivityLabelsClientListRecommendedByDatabaseOptions{SkipToken: nil,
			IncludeDisabledRecommendations: nil,
			Filter:                         nil,
		})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*SensitivityLabelsClient) Update

func (client *SensitivityLabelsClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters SensitivityLabelUpdateList, options *SensitivityLabelsClientUpdateOptions) (SensitivityLabelsClientUpdateResponse, error)

Update - Update sensitivity labels of a given database using an operations batch. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - SensitivityLabelsClientUpdateOptions contains the optional parameters for the SensitivityLabelsClient.Update method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsCurrentUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSensitivityLabelsClient("<subscription-id>", cred, nil)
	_, err = client.Update(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.SensitivityLabelUpdateList{
			Operations: []*armsql.SensitivityLabelUpdate{
				{
					Properties: &armsql.SensitivityLabelUpdateProperties{
						Schema: to.StringPtr("<schema>"),
						Column: to.StringPtr("<column>"),
						Op:     armsql.SensitivityLabelUpdateKindSet.ToPtr(),
						SensitivityLabel: &armsql.SensitivityLabel{
							Properties: &armsql.SensitivityLabelProperties{
								InformationType:   to.StringPtr("<information-type>"),
								InformationTypeID: to.StringPtr("<information-type-id>"),
								LabelID:           to.StringPtr("<label-id>"),
								LabelName:         to.StringPtr("<label-name>"),
								Rank:              armsql.SensitivityLabelRankLow.ToPtr(),
							},
						},
						Table: to.StringPtr("<table>"),
					},
				},
				{
					Properties: &armsql.SensitivityLabelUpdateProperties{
						Schema: to.StringPtr("<schema>"),
						Column: to.StringPtr("<column>"),
						Op:     armsql.SensitivityLabelUpdateKindSet.ToPtr(),
						SensitivityLabel: &armsql.SensitivityLabel{
							Properties: &armsql.SensitivityLabelProperties{
								InformationType:   to.StringPtr("<information-type>"),
								InformationTypeID: to.StringPtr("<information-type-id>"),
								LabelID:           to.StringPtr("<label-id>"),
								LabelName:         to.StringPtr("<label-name>"),
								Rank:              armsql.SensitivityLabelRankCritical.ToPtr(),
							},
						},
						Table: to.StringPtr("<table>"),
					},
				},
				{
					Properties: &armsql.SensitivityLabelUpdateProperties{
						Schema: to.StringPtr("<schema>"),
						Column: to.StringPtr("<column>"),
						Op:     armsql.SensitivityLabelUpdateKindRemove.ToPtr(),
						Table:  to.StringPtr("<table>"),
					},
				}},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

type SensitivityLabelsClientCreateOrUpdateOptions added in v0.3.0

type SensitivityLabelsClientCreateOrUpdateOptions struct {
}

SensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the SensitivityLabelsClient.CreateOrUpdate method.

type SensitivityLabelsClientCreateOrUpdateResponse added in v0.3.0

type SensitivityLabelsClientCreateOrUpdateResponse struct {
	SensitivityLabelsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SensitivityLabelsClientCreateOrUpdateResponse contains the response from method SensitivityLabelsClient.CreateOrUpdate.

type SensitivityLabelsClientCreateOrUpdateResult added in v0.3.0

type SensitivityLabelsClientCreateOrUpdateResult struct {
	SensitivityLabel
}

SensitivityLabelsClientCreateOrUpdateResult contains the result from method SensitivityLabelsClient.CreateOrUpdate.

type SensitivityLabelsClientDeleteOptions added in v0.3.0

type SensitivityLabelsClientDeleteOptions struct {
}

SensitivityLabelsClientDeleteOptions contains the optional parameters for the SensitivityLabelsClient.Delete method.

type SensitivityLabelsClientDeleteResponse added in v0.3.0

type SensitivityLabelsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SensitivityLabelsClientDeleteResponse contains the response from method SensitivityLabelsClient.Delete.

type SensitivityLabelsClientDisableRecommendationOptions added in v0.3.0

type SensitivityLabelsClientDisableRecommendationOptions struct {
}

SensitivityLabelsClientDisableRecommendationOptions contains the optional parameters for the SensitivityLabelsClient.DisableRecommendation method.

type SensitivityLabelsClientDisableRecommendationResponse added in v0.3.0

type SensitivityLabelsClientDisableRecommendationResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SensitivityLabelsClientDisableRecommendationResponse contains the response from method SensitivityLabelsClient.DisableRecommendation.

type SensitivityLabelsClientEnableRecommendationOptions added in v0.3.0

type SensitivityLabelsClientEnableRecommendationOptions struct {
}

SensitivityLabelsClientEnableRecommendationOptions contains the optional parameters for the SensitivityLabelsClient.EnableRecommendation method.

type SensitivityLabelsClientEnableRecommendationResponse added in v0.3.0

type SensitivityLabelsClientEnableRecommendationResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SensitivityLabelsClientEnableRecommendationResponse contains the response from method SensitivityLabelsClient.EnableRecommendation.

type SensitivityLabelsClientGetOptions added in v0.3.0

type SensitivityLabelsClientGetOptions struct {
}

SensitivityLabelsClientGetOptions contains the optional parameters for the SensitivityLabelsClient.Get method.

type SensitivityLabelsClientGetResponse added in v0.3.0

type SensitivityLabelsClientGetResponse struct {
	SensitivityLabelsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SensitivityLabelsClientGetResponse contains the response from method SensitivityLabelsClient.Get.

type SensitivityLabelsClientGetResult added in v0.3.0

type SensitivityLabelsClientGetResult struct {
	SensitivityLabel
}

SensitivityLabelsClientGetResult contains the result from method SensitivityLabelsClient.Get.

type SensitivityLabelsClientListCurrentByDatabaseOptions added in v0.3.0

type SensitivityLabelsClientListCurrentByDatabaseOptions struct {
	Count *bool
	// An OData filter expression that filters elements in the collection.
	Filter    *string
	SkipToken *string
}

SensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.ListCurrentByDatabase method.

type SensitivityLabelsClientListCurrentByDatabasePager added in v0.3.0

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

SensitivityLabelsClientListCurrentByDatabasePager provides operations for iterating over paged responses.

func (*SensitivityLabelsClientListCurrentByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*SensitivityLabelsClientListCurrentByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*SensitivityLabelsClientListCurrentByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current SensitivityLabelsClientListCurrentByDatabaseResponse page.

type SensitivityLabelsClientListCurrentByDatabaseResponse added in v0.3.0

type SensitivityLabelsClientListCurrentByDatabaseResponse struct {
	SensitivityLabelsClientListCurrentByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SensitivityLabelsClientListCurrentByDatabaseResponse contains the response from method SensitivityLabelsClient.ListCurrentByDatabase.

type SensitivityLabelsClientListCurrentByDatabaseResult added in v0.3.0

type SensitivityLabelsClientListCurrentByDatabaseResult struct {
	SensitivityLabelListResult
}

SensitivityLabelsClientListCurrentByDatabaseResult contains the result from method SensitivityLabelsClient.ListCurrentByDatabase.

type SensitivityLabelsClientListRecommendedByDatabaseOptions added in v0.3.0

type SensitivityLabelsClientListRecommendedByDatabaseOptions struct {
	// An OData filter expression that filters elements in the collection.
	Filter *string
	// Specifies whether to include disabled recommendations or not.
	IncludeDisabledRecommendations *bool
	SkipToken                      *string
}

SensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.ListRecommendedByDatabase method.

type SensitivityLabelsClientListRecommendedByDatabasePager added in v0.3.0

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

SensitivityLabelsClientListRecommendedByDatabasePager provides operations for iterating over paged responses.

func (*SensitivityLabelsClientListRecommendedByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*SensitivityLabelsClientListRecommendedByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*SensitivityLabelsClientListRecommendedByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current SensitivityLabelsClientListRecommendedByDatabaseResponse page.

type SensitivityLabelsClientListRecommendedByDatabaseResponse added in v0.3.0

type SensitivityLabelsClientListRecommendedByDatabaseResponse struct {
	SensitivityLabelsClientListRecommendedByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SensitivityLabelsClientListRecommendedByDatabaseResponse contains the response from method SensitivityLabelsClient.ListRecommendedByDatabase.

type SensitivityLabelsClientListRecommendedByDatabaseResult added in v0.3.0

type SensitivityLabelsClientListRecommendedByDatabaseResult struct {
	SensitivityLabelListResult
}

SensitivityLabelsClientListRecommendedByDatabaseResult contains the result from method SensitivityLabelsClient.ListRecommendedByDatabase.

type SensitivityLabelsClientUpdateOptions added in v0.3.0

type SensitivityLabelsClientUpdateOptions struct {
}

SensitivityLabelsClientUpdateOptions contains the optional parameters for the SensitivityLabelsClient.Update method.

type SensitivityLabelsClientUpdateResponse added in v0.3.0

type SensitivityLabelsClientUpdateResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SensitivityLabelsClientUpdateResponse contains the response from method SensitivityLabelsClient.Update.

type Server

type Server struct {
	// REQUIRED; Resource location.
	Location *string `json:"location,omitempty"`

	// The Azure Active Directory identity of the server.
	Identity *ResourceIdentity `json:"identity,omitempty"`

	// Resource properties.
	Properties *ServerProperties `json:"properties,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Kind of sql server. This is metadata used for the Azure portal experience.
	Kind *string `json:"kind,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

Server - An Azure SQL Database server.

func (Server) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Server.

type ServerAdvisorsClient

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

ServerAdvisorsClient contains the methods for the ServerAdvisors group. Don't use this type directly, use NewServerAdvisorsClient() instead.

func NewServerAdvisorsClient

func NewServerAdvisorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerAdvisorsClient

NewServerAdvisorsClient creates a new instance of ServerAdvisorsClient with the specified values. subscriptionID - The 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 (*ServerAdvisorsClient) Get

func (client *ServerAdvisorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, advisorName string, options *ServerAdvisorsClientGetOptions) (ServerAdvisorsClientGetResponse, error)

Get - Gets a server advisor. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. advisorName - The name of the Server Advisor. options - ServerAdvisorsClientGetOptions contains the optional parameters for the ServerAdvisorsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerAdvisorsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<advisor-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerAdvisorsClientGetResult)
}
Output:

func (*ServerAdvisorsClient) ListByServer

ListByServer - Gets a list of server advisors. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServerAdvisorsClientListByServerOptions contains the optional parameters for the ServerAdvisorsClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerAdvisorsClient("<subscription-id>", cred, nil)
	res, err := client.ListByServer(ctx,
		"<resource-group-name>",
		"<server-name>",
		&armsql.ServerAdvisorsClientListByServerOptions{Expand: nil})
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerAdvisorsClientListByServerResult)
}
Output:

func (*ServerAdvisorsClient) Update

func (client *ServerAdvisorsClient) Update(ctx context.Context, resourceGroupName string, serverName string, advisorName string, parameters Advisor, options *ServerAdvisorsClientUpdateOptions) (ServerAdvisorsClientUpdateResponse, error)

Update - Updates a server advisor. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. advisorName - The name of the Server Advisor. parameters - The requested advisor resource state. options - ServerAdvisorsClientUpdateOptions contains the optional parameters for the ServerAdvisorsClient.Update method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerAdvisorsClient("<subscription-id>", cred, nil)
	res, err := client.Update(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<advisor-name>",
		armsql.Advisor{
			Properties: &armsql.AdvisorProperties{
				AutoExecuteStatus: armsql.AutoExecuteStatusDisabled.ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerAdvisorsClientUpdateResult)
}
Output:

type ServerAdvisorsClientGetOptions added in v0.3.0

type ServerAdvisorsClientGetOptions struct {
}

ServerAdvisorsClientGetOptions contains the optional parameters for the ServerAdvisorsClient.Get method.

type ServerAdvisorsClientGetResponse added in v0.3.0

type ServerAdvisorsClientGetResponse struct {
	ServerAdvisorsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAdvisorsClientGetResponse contains the response from method ServerAdvisorsClient.Get.

type ServerAdvisorsClientGetResult added in v0.3.0

type ServerAdvisorsClientGetResult struct {
	Advisor
}

ServerAdvisorsClientGetResult contains the result from method ServerAdvisorsClient.Get.

type ServerAdvisorsClientListByServerOptions added in v0.3.0

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

ServerAdvisorsClientListByServerOptions contains the optional parameters for the ServerAdvisorsClient.ListByServer method.

type ServerAdvisorsClientListByServerResponse added in v0.3.0

type ServerAdvisorsClientListByServerResponse struct {
	ServerAdvisorsClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAdvisorsClientListByServerResponse contains the response from method ServerAdvisorsClient.ListByServer.

type ServerAdvisorsClientListByServerResult added in v0.3.0

type ServerAdvisorsClientListByServerResult struct {
	// Array of Advisor
	AdvisorArray []*Advisor
}

ServerAdvisorsClientListByServerResult contains the result from method ServerAdvisorsClient.ListByServer.

type ServerAdvisorsClientUpdateOptions added in v0.3.0

type ServerAdvisorsClientUpdateOptions struct {
}

ServerAdvisorsClientUpdateOptions contains the optional parameters for the ServerAdvisorsClient.Update method.

type ServerAdvisorsClientUpdateResponse added in v0.3.0

type ServerAdvisorsClientUpdateResponse struct {
	ServerAdvisorsClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAdvisorsClientUpdateResponse contains the response from method ServerAdvisorsClient.Update.

type ServerAdvisorsClientUpdateResult added in v0.3.0

type ServerAdvisorsClientUpdateResult struct {
	Advisor
}

ServerAdvisorsClientUpdateResult contains the result from method ServerAdvisorsClient.Update.

type ServerAutomaticTuning

type ServerAutomaticTuning struct {
	// Resource properties.
	Properties *AutomaticTuningServerProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServerAutomaticTuning - Server-level Automatic Tuning.

func (ServerAutomaticTuning) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerAutomaticTuning.

type ServerAutomaticTuningClient

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

ServerAutomaticTuningClient contains the methods for the ServerAutomaticTuning group. Don't use this type directly, use NewServerAutomaticTuningClient() instead.

func NewServerAutomaticTuningClient

func NewServerAutomaticTuningClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerAutomaticTuningClient

NewServerAutomaticTuningClient creates a new instance of ServerAutomaticTuningClient with the specified values. subscriptionID - The 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 (*ServerAutomaticTuningClient) Get

Get - Retrieves server automatic tuning options. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServerAutomaticTuningClientGetOptions contains the optional parameters for the ServerAutomaticTuningClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerAutomaticTuningClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerAutomaticTuningClientGetResult)
}
Output:

func (*ServerAutomaticTuningClient) Update

Update - Update automatic tuning options on server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. parameters - The requested automatic tuning resource state. options - ServerAutomaticTuningClientUpdateOptions contains the optional parameters for the ServerAutomaticTuningClient.Update method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningUpdateMax.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerAutomaticTuningClient("<subscription-id>", cred, nil)
	res, err := client.Update(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.ServerAutomaticTuning{
			Properties: &armsql.AutomaticTuningServerProperties{
				DesiredState: armsql.AutomaticTuningServerModeAuto.ToPtr(),
				Options: map[string]*armsql.AutomaticTuningServerOptions{
					"createIndex": {
						DesiredState: armsql.AutomaticTuningOptionModeDesiredOff.ToPtr(),
					},
					"dropIndex": {
						DesiredState: armsql.AutomaticTuningOptionModeDesiredOn.ToPtr(),
					},
					"forceLastGoodPlan": {
						DesiredState: armsql.AutomaticTuningOptionModeDesiredDefault.ToPtr(),
					},
				},
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerAutomaticTuningClientUpdateResult)
}
Output:

type ServerAutomaticTuningClientGetOptions added in v0.3.0

type ServerAutomaticTuningClientGetOptions struct {
}

ServerAutomaticTuningClientGetOptions contains the optional parameters for the ServerAutomaticTuningClient.Get method.

type ServerAutomaticTuningClientGetResponse added in v0.3.0

type ServerAutomaticTuningClientGetResponse struct {
	ServerAutomaticTuningClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAutomaticTuningClientGetResponse contains the response from method ServerAutomaticTuningClient.Get.

type ServerAutomaticTuningClientGetResult added in v0.3.0

type ServerAutomaticTuningClientGetResult struct {
	ServerAutomaticTuning
}

ServerAutomaticTuningClientGetResult contains the result from method ServerAutomaticTuningClient.Get.

type ServerAutomaticTuningClientUpdateOptions added in v0.3.0

type ServerAutomaticTuningClientUpdateOptions struct {
}

ServerAutomaticTuningClientUpdateOptions contains the optional parameters for the ServerAutomaticTuningClient.Update method.

type ServerAutomaticTuningClientUpdateResponse added in v0.3.0

type ServerAutomaticTuningClientUpdateResponse struct {
	ServerAutomaticTuningClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAutomaticTuningClientUpdateResponse contains the response from method ServerAutomaticTuningClient.Update.

type ServerAutomaticTuningClientUpdateResult added in v0.3.0

type ServerAutomaticTuningClientUpdateResult struct {
	ServerAutomaticTuning
}

ServerAutomaticTuningClientUpdateResult contains the result from method ServerAutomaticTuningClient.Update.

type ServerAzureADAdministrator

type ServerAzureADAdministrator struct {
	// Resource properties.
	Properties *AdministratorProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServerAzureADAdministrator - Azure Active Directory administrator.

type ServerAzureADAdministratorsClient

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

ServerAzureADAdministratorsClient contains the methods for the ServerAzureADAdministrators group. Don't use this type directly, use NewServerAzureADAdministratorsClient() instead.

func NewServerAzureADAdministratorsClient

func NewServerAzureADAdministratorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerAzureADAdministratorsClient

NewServerAzureADAdministratorsClient creates a new instance of ServerAzureADAdministratorsClient with the specified values. subscriptionID - The 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 (*ServerAzureADAdministratorsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates an existing Azure Active Directory administrator. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. administratorName - The name of server active directory administrator. parameters - The requested Azure Active Directory administrator Resource state. options - ServerAzureADAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAzureADAdministratorsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorCreateOrUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerAzureADAdministratorsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.AdministratorName("ActiveDirectory"),
		armsql.ServerAzureADAdministrator{
			Properties: &armsql.AdministratorProperties{
				AdministratorType: armsql.AdministratorType("ActiveDirectory").ToPtr(),
				Login:             to.StringPtr("<login>"),
				Sid:               to.StringPtr("<sid>"),
				TenantID:          to.StringPtr("<tenant-id>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerAzureADAdministratorsClientCreateOrUpdateResult)
}
Output:

func (*ServerAzureADAdministratorsClient) BeginDelete

BeginDelete - Deletes the Azure Active Directory administrator with the given name. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. administratorName - The name of server active directory administrator. options - ServerAzureADAdministratorsClientBeginDeleteOptions contains the optional parameters for the ServerAzureADAdministratorsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerAzureADAdministratorsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.AdministratorName("ActiveDirectory"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ServerAzureADAdministratorsClient) Get

Get - Gets a Azure Active Directory administrator. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. administratorName - The name of server active directory administrator. options - ServerAzureADAdministratorsClientGetOptions contains the optional parameters for the ServerAzureADAdministratorsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerAzureADAdministratorsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.AdministratorName("ActiveDirectory"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerAzureADAdministratorsClientGetResult)
}
Output:

func (*ServerAzureADAdministratorsClient) ListByServer

ListByServer - Gets a list of Azure Active Directory administrators in a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServerAzureADAdministratorsClientListByServerOptions contains the optional parameters for the ServerAzureADAdministratorsClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerAzureADAdministratorsClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ServerAzureADAdministratorsClientBeginCreateOrUpdateOptions added in v0.3.0

type ServerAzureADAdministratorsClientBeginCreateOrUpdateOptions struct {
}

ServerAzureADAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAzureADAdministratorsClient.BeginCreateOrUpdate method.

type ServerAzureADAdministratorsClientBeginDeleteOptions added in v0.3.0

type ServerAzureADAdministratorsClientBeginDeleteOptions struct {
}

ServerAzureADAdministratorsClientBeginDeleteOptions contains the optional parameters for the ServerAzureADAdministratorsClient.BeginDelete method.

type ServerAzureADAdministratorsClientCreateOrUpdatePoller added in v0.3.0

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

ServerAzureADAdministratorsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerAzureADAdministratorsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerAzureADAdministratorsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerAzureADAdministratorsClientCreateOrUpdateResponse will be returned.

func (*ServerAzureADAdministratorsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerAzureADAdministratorsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerAzureADAdministratorsClientCreateOrUpdatePollerResponse added in v0.3.0

type ServerAzureADAdministratorsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerAzureADAdministratorsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAzureADAdministratorsClientCreateOrUpdatePollerResponse contains the response from method ServerAzureADAdministratorsClient.CreateOrUpdate.

func (ServerAzureADAdministratorsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerAzureADAdministratorsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerAzureADAdministratorsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ServerAzureADAdministratorsClientCreateOrUpdateResponse added in v0.3.0

type ServerAzureADAdministratorsClientCreateOrUpdateResponse struct {
	ServerAzureADAdministratorsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAzureADAdministratorsClientCreateOrUpdateResponse contains the response from method ServerAzureADAdministratorsClient.CreateOrUpdate.

type ServerAzureADAdministratorsClientCreateOrUpdateResult added in v0.3.0

type ServerAzureADAdministratorsClientCreateOrUpdateResult struct {
	ServerAzureADAdministrator
}

ServerAzureADAdministratorsClientCreateOrUpdateResult contains the result from method ServerAzureADAdministratorsClient.CreateOrUpdate.

type ServerAzureADAdministratorsClientDeletePoller added in v0.3.0

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

ServerAzureADAdministratorsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerAzureADAdministratorsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerAzureADAdministratorsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerAzureADAdministratorsClientDeleteResponse will be returned.

func (*ServerAzureADAdministratorsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerAzureADAdministratorsClientDeletePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerAzureADAdministratorsClientDeletePollerResponse added in v0.3.0

type ServerAzureADAdministratorsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerAzureADAdministratorsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAzureADAdministratorsClientDeletePollerResponse contains the response from method ServerAzureADAdministratorsClient.Delete.

func (ServerAzureADAdministratorsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerAzureADAdministratorsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerAzureADAdministratorsClientDeletePollerResponse from the provided client and resume token.

type ServerAzureADAdministratorsClientDeleteResponse added in v0.3.0

type ServerAzureADAdministratorsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAzureADAdministratorsClientDeleteResponse contains the response from method ServerAzureADAdministratorsClient.Delete.

type ServerAzureADAdministratorsClientGetOptions added in v0.3.0

type ServerAzureADAdministratorsClientGetOptions struct {
}

ServerAzureADAdministratorsClientGetOptions contains the optional parameters for the ServerAzureADAdministratorsClient.Get method.

type ServerAzureADAdministratorsClientGetResponse added in v0.3.0

type ServerAzureADAdministratorsClientGetResponse struct {
	ServerAzureADAdministratorsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAzureADAdministratorsClientGetResponse contains the response from method ServerAzureADAdministratorsClient.Get.

type ServerAzureADAdministratorsClientGetResult added in v0.3.0

type ServerAzureADAdministratorsClientGetResult struct {
	ServerAzureADAdministrator
}

ServerAzureADAdministratorsClientGetResult contains the result from method ServerAzureADAdministratorsClient.Get.

type ServerAzureADAdministratorsClientListByServerOptions added in v0.3.0

type ServerAzureADAdministratorsClientListByServerOptions struct {
}

ServerAzureADAdministratorsClientListByServerOptions contains the optional parameters for the ServerAzureADAdministratorsClient.ListByServer method.

type ServerAzureADAdministratorsClientListByServerPager added in v0.3.0

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

ServerAzureADAdministratorsClientListByServerPager provides operations for iterating over paged responses.

func (*ServerAzureADAdministratorsClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ServerAzureADAdministratorsClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServerAzureADAdministratorsClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current ServerAzureADAdministratorsClientListByServerResponse page.

type ServerAzureADAdministratorsClientListByServerResponse added in v0.3.0

type ServerAzureADAdministratorsClientListByServerResponse struct {
	ServerAzureADAdministratorsClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAzureADAdministratorsClientListByServerResponse contains the response from method ServerAzureADAdministratorsClient.ListByServer.

type ServerAzureADAdministratorsClientListByServerResult added in v0.3.0

type ServerAzureADAdministratorsClientListByServerResult struct {
	AdministratorListResult
}

ServerAzureADAdministratorsClientListByServerResult contains the result from method ServerAzureADAdministratorsClient.ListByServer.

type ServerAzureADOnlyAuthentication

type ServerAzureADOnlyAuthentication struct {
	// Resource properties.
	Properties *AzureADOnlyAuthProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServerAzureADOnlyAuthentication - Azure Active Directory only authentication.

type ServerAzureADOnlyAuthenticationsClient

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

ServerAzureADOnlyAuthenticationsClient contains the methods for the ServerAzureADOnlyAuthentications group. Don't use this type directly, use NewServerAzureADOnlyAuthenticationsClient() instead.

func NewServerAzureADOnlyAuthenticationsClient

func NewServerAzureADOnlyAuthenticationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerAzureADOnlyAuthenticationsClient

NewServerAzureADOnlyAuthenticationsClient creates a new instance of ServerAzureADOnlyAuthenticationsClient with the specified values. subscriptionID - The 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 (*ServerAzureADOnlyAuthenticationsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Sets Server Active Directory only authentication property or updates an existing server Active Directory only authentication property. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. authenticationName - The name of server azure active directory only authentication. parameters - The required parameters for creating or updating an Active Directory only authentication property. options - ServerAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthCreateOrUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerAzureADOnlyAuthenticationsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.AuthenticationName("Default"),
		armsql.ServerAzureADOnlyAuthentication{
			Properties: &armsql.AzureADOnlyAuthProperties{
				AzureADOnlyAuthentication: to.BoolPtr(false),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResult)
}
Output:

func (*ServerAzureADOnlyAuthenticationsClient) BeginDelete

BeginDelete - Deletes an existing server Active Directory only authentication property. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. authenticationName - The name of server azure active directory only authentication. options - ServerAzureADOnlyAuthenticationsClientBeginDeleteOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerAzureADOnlyAuthenticationsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.AuthenticationName("Default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ServerAzureADOnlyAuthenticationsClient) Get

Get - Gets a specific Azure Active Directory only authentication property. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. authenticationName - The name of server azure active directory only authentication. options - ServerAzureADOnlyAuthenticationsClientGetOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerAzureADOnlyAuthenticationsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.AuthenticationName("Default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerAzureADOnlyAuthenticationsClientGetResult)
}
Output:

func (*ServerAzureADOnlyAuthenticationsClient) ListByServer

ListByServer - Gets a list of server Azure Active Directory only authentications. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServerAzureADOnlyAuthenticationsClientListByServerOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerAzureADOnlyAuthenticationsClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ServerAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions added in v0.3.0

type ServerAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions struct {
}

ServerAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate method.

type ServerAzureADOnlyAuthenticationsClientBeginDeleteOptions added in v0.3.0

type ServerAzureADOnlyAuthenticationsClientBeginDeleteOptions struct {
}

ServerAzureADOnlyAuthenticationsClientBeginDeleteOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.BeginDelete method.

type ServerAzureADOnlyAuthenticationsClientCreateOrUpdatePoller added in v0.3.0

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

ServerAzureADOnlyAuthenticationsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerAzureADOnlyAuthenticationsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerAzureADOnlyAuthenticationsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResponse will be returned.

func (*ServerAzureADOnlyAuthenticationsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerAzureADOnlyAuthenticationsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerAzureADOnlyAuthenticationsClientCreateOrUpdatePollerResponse added in v0.3.0

type ServerAzureADOnlyAuthenticationsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerAzureADOnlyAuthenticationsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAzureADOnlyAuthenticationsClientCreateOrUpdatePollerResponse contains the response from method ServerAzureADOnlyAuthenticationsClient.CreateOrUpdate.

func (ServerAzureADOnlyAuthenticationsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerAzureADOnlyAuthenticationsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerAzureADOnlyAuthenticationsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResponse added in v0.3.0

type ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResponse struct {
	ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResponse contains the response from method ServerAzureADOnlyAuthenticationsClient.CreateOrUpdate.

type ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResult added in v0.3.0

type ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResult struct {
	ServerAzureADOnlyAuthentication
}

ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResult contains the result from method ServerAzureADOnlyAuthenticationsClient.CreateOrUpdate.

type ServerAzureADOnlyAuthenticationsClientDeletePoller added in v0.3.0

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

ServerAzureADOnlyAuthenticationsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerAzureADOnlyAuthenticationsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerAzureADOnlyAuthenticationsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerAzureADOnlyAuthenticationsClientDeleteResponse will be returned.

func (*ServerAzureADOnlyAuthenticationsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerAzureADOnlyAuthenticationsClientDeletePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerAzureADOnlyAuthenticationsClientDeletePollerResponse added in v0.3.0

type ServerAzureADOnlyAuthenticationsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerAzureADOnlyAuthenticationsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAzureADOnlyAuthenticationsClientDeletePollerResponse contains the response from method ServerAzureADOnlyAuthenticationsClient.Delete.

func (ServerAzureADOnlyAuthenticationsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerAzureADOnlyAuthenticationsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerAzureADOnlyAuthenticationsClientDeletePollerResponse from the provided client and resume token.

type ServerAzureADOnlyAuthenticationsClientDeleteResponse added in v0.3.0

type ServerAzureADOnlyAuthenticationsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAzureADOnlyAuthenticationsClientDeleteResponse contains the response from method ServerAzureADOnlyAuthenticationsClient.Delete.

type ServerAzureADOnlyAuthenticationsClientGetOptions added in v0.3.0

type ServerAzureADOnlyAuthenticationsClientGetOptions struct {
}

ServerAzureADOnlyAuthenticationsClientGetOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.Get method.

type ServerAzureADOnlyAuthenticationsClientGetResponse added in v0.3.0

type ServerAzureADOnlyAuthenticationsClientGetResponse struct {
	ServerAzureADOnlyAuthenticationsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAzureADOnlyAuthenticationsClientGetResponse contains the response from method ServerAzureADOnlyAuthenticationsClient.Get.

type ServerAzureADOnlyAuthenticationsClientGetResult added in v0.3.0

type ServerAzureADOnlyAuthenticationsClientGetResult struct {
	ServerAzureADOnlyAuthentication
}

ServerAzureADOnlyAuthenticationsClientGetResult contains the result from method ServerAzureADOnlyAuthenticationsClient.Get.

type ServerAzureADOnlyAuthenticationsClientListByServerOptions added in v0.3.0

type ServerAzureADOnlyAuthenticationsClientListByServerOptions struct {
}

ServerAzureADOnlyAuthenticationsClientListByServerOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.ListByServer method.

type ServerAzureADOnlyAuthenticationsClientListByServerPager added in v0.3.0

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

ServerAzureADOnlyAuthenticationsClientListByServerPager provides operations for iterating over paged responses.

func (*ServerAzureADOnlyAuthenticationsClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ServerAzureADOnlyAuthenticationsClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServerAzureADOnlyAuthenticationsClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current ServerAzureADOnlyAuthenticationsClientListByServerResponse page.

type ServerAzureADOnlyAuthenticationsClientListByServerResponse added in v0.3.0

type ServerAzureADOnlyAuthenticationsClientListByServerResponse struct {
	ServerAzureADOnlyAuthenticationsClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerAzureADOnlyAuthenticationsClientListByServerResponse contains the response from method ServerAzureADOnlyAuthenticationsClient.ListByServer.

type ServerAzureADOnlyAuthenticationsClientListByServerResult added in v0.3.0

type ServerAzureADOnlyAuthenticationsClientListByServerResult struct {
	AzureADOnlyAuthListResult
}

ServerAzureADOnlyAuthenticationsClientListByServerResult contains the result from method ServerAzureADOnlyAuthenticationsClient.ListByServer.

type ServerBlobAuditingPoliciesClient

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

ServerBlobAuditingPoliciesClient contains the methods for the ServerBlobAuditingPolicies group. Don't use this type directly, use NewServerBlobAuditingPoliciesClient() instead.

func NewServerBlobAuditingPoliciesClient

func NewServerBlobAuditingPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerBlobAuditingPoliciesClient

NewServerBlobAuditingPoliciesClient creates a new instance of ServerBlobAuditingPoliciesClient with the specified values. subscriptionID - The 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 (*ServerBlobAuditingPoliciesClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates a server's blob auditing policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. parameters - Properties of blob auditing policy options - ServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerBlobAuditingCreateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerBlobAuditingPoliciesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.ServerBlobAuditingPolicy{
			Properties: &armsql.ServerBlobAuditingPolicyProperties{
				AuditActionsAndGroups: []*string{
					to.StringPtr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"),
					to.StringPtr("FAILED_DATABASE_AUTHENTICATION_GROUP"),
					to.StringPtr("BATCH_COMPLETED_GROUP")},
				IsAzureMonitorTargetEnabled:  to.BoolPtr(true),
				IsStorageSecondaryKeyInUse:   to.BoolPtr(false),
				QueueDelayMs:                 to.Int32Ptr(4000),
				RetentionDays:                to.Int32Ptr(6),
				State:                        armsql.BlobAuditingPolicyStateEnabled.ToPtr(),
				StorageAccountAccessKey:      to.StringPtr("<storage-account-access-key>"),
				StorageAccountSubscriptionID: to.StringPtr("<storage-account-subscription-id>"),
				StorageEndpoint:              to.StringPtr("<storage-endpoint>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerBlobAuditingPoliciesClientCreateOrUpdateResult)
}
Output:

func (*ServerBlobAuditingPoliciesClient) Get

Get - Gets a server's blob auditing policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServerBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerBlobAuditingGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerBlobAuditingPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerBlobAuditingPoliciesClientGetResult)
}
Output:

func (*ServerBlobAuditingPoliciesClient) ListByServer

ListByServer - Lists auditing settings of a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAuditingSettingsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerBlobAuditingPoliciesClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions added in v0.3.0

type ServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions struct {
}

ServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.BeginCreateOrUpdate method.

type ServerBlobAuditingPoliciesClientCreateOrUpdatePoller added in v0.3.0

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

ServerBlobAuditingPoliciesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerBlobAuditingPoliciesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerBlobAuditingPoliciesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerBlobAuditingPoliciesClientCreateOrUpdateResponse will be returned.

func (*ServerBlobAuditingPoliciesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerBlobAuditingPoliciesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerBlobAuditingPoliciesClientCreateOrUpdatePollerResponse added in v0.3.0

type ServerBlobAuditingPoliciesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerBlobAuditingPoliciesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerBlobAuditingPoliciesClientCreateOrUpdatePollerResponse contains the response from method ServerBlobAuditingPoliciesClient.CreateOrUpdate.

func (ServerBlobAuditingPoliciesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerBlobAuditingPoliciesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerBlobAuditingPoliciesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ServerBlobAuditingPoliciesClientCreateOrUpdateResponse added in v0.3.0

type ServerBlobAuditingPoliciesClientCreateOrUpdateResponse struct {
	ServerBlobAuditingPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerBlobAuditingPoliciesClientCreateOrUpdateResponse contains the response from method ServerBlobAuditingPoliciesClient.CreateOrUpdate.

type ServerBlobAuditingPoliciesClientCreateOrUpdateResult added in v0.3.0

type ServerBlobAuditingPoliciesClientCreateOrUpdateResult struct {
	ServerBlobAuditingPolicy
}

ServerBlobAuditingPoliciesClientCreateOrUpdateResult contains the result from method ServerBlobAuditingPoliciesClient.CreateOrUpdate.

type ServerBlobAuditingPoliciesClientGetOptions added in v0.3.0

type ServerBlobAuditingPoliciesClientGetOptions struct {
}

ServerBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.Get method.

type ServerBlobAuditingPoliciesClientGetResponse added in v0.3.0

type ServerBlobAuditingPoliciesClientGetResponse struct {
	ServerBlobAuditingPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerBlobAuditingPoliciesClientGetResponse contains the response from method ServerBlobAuditingPoliciesClient.Get.

type ServerBlobAuditingPoliciesClientGetResult added in v0.3.0

type ServerBlobAuditingPoliciesClientGetResult struct {
	ServerBlobAuditingPolicy
}

ServerBlobAuditingPoliciesClientGetResult contains the result from method ServerBlobAuditingPoliciesClient.Get.

type ServerBlobAuditingPoliciesClientListByServerOptions added in v0.3.0

type ServerBlobAuditingPoliciesClientListByServerOptions struct {
}

ServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.ListByServer method.

type ServerBlobAuditingPoliciesClientListByServerPager added in v0.3.0

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

ServerBlobAuditingPoliciesClientListByServerPager provides operations for iterating over paged responses.

func (*ServerBlobAuditingPoliciesClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ServerBlobAuditingPoliciesClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServerBlobAuditingPoliciesClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current ServerBlobAuditingPoliciesClientListByServerResponse page.

type ServerBlobAuditingPoliciesClientListByServerResponse added in v0.3.0

type ServerBlobAuditingPoliciesClientListByServerResponse struct {
	ServerBlobAuditingPoliciesClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerBlobAuditingPoliciesClientListByServerResponse contains the response from method ServerBlobAuditingPoliciesClient.ListByServer.

type ServerBlobAuditingPoliciesClientListByServerResult added in v0.3.0

type ServerBlobAuditingPoliciesClientListByServerResult struct {
	ServerBlobAuditingPolicyListResult
}

ServerBlobAuditingPoliciesClientListByServerResult contains the result from method ServerBlobAuditingPoliciesClient.ListByServer.

type ServerBlobAuditingPolicy

type ServerBlobAuditingPolicy struct {
	// Resource properties.
	Properties *ServerBlobAuditingPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServerBlobAuditingPolicy - A server blob auditing policy.

type ServerBlobAuditingPolicyListResult

type ServerBlobAuditingPolicyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ServerBlobAuditingPolicy `json:"value,omitempty" azure:"ro"`
}

ServerBlobAuditingPolicyListResult - A list of server auditing settings.

func (ServerBlobAuditingPolicyListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyListResult.

type ServerBlobAuditingPolicyProperties

type ServerBlobAuditingPolicyProperties struct {
	// REQUIRED; Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
	State *BlobAuditingPolicyState `json:"state,omitempty"`

	// Specifies the Actions-Groups and Actions to audit.
	// The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures
	// executed against the database, as well as successful and failed logins:
	// BATCHCOMPLETEDGROUP, SUCCESSFULDATABASEAUTHENTICATIONGROUP, FAILEDDATABASEAUTHENTICATIONGROUP.
	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
	// The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary
	// groups could lead to very large quantities of audit records):
	// APPLICATIONROLECHANGEPASSWORDGROUP BACKUPRESTOREGROUP DATABASELOGOUTGROUP DATABASEOBJECTCHANGEGROUP DATABASEOBJECTOWNERSHIPCHANGEGROUP
	// DATABASEOBJECTPERMISSIONCHANGEGROUP DATABASEOPERATIONGROUP
	// DATABASEPERMISSIONCHANGEGROUP DATABASEPRINCIPALCHANGEGROUP DATABASEPRINCIPALIMPERSONATIONGROUP DATABASEROLEMEMBERCHANGEGROUP
	// FAILEDDATABASEAUTHENTICATIONGROUP SCHEMAOBJECTACCESSGROUP SCHEMAOBJECT
	// CHANGEGROUP SCHEMAOBJECTOWNERSHIPCHANGEGROUP SCHEMAOBJECTPERMISSIONCHANGEGROUP SUCCESSFULDATABASEAUTHENTICATIONGROUP USERCHANGEPASSWORDGROUP
	// BATCHSTARTEDGROUP BATCHCOMPLETED_GROUP
	// These are groups that cover all sql statements and stored procedures executed against the database, and should not be used
	// in combination with other groups as this will result in duplicate audit logs.
	// For more information, see Database-Level Audit Action Groups
	// [https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups].
	// For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server
	// auditing policy). The supported actions to audit are: SELECT UPDATE INSERT DELETE
	// EXECUTE RECEIVE REFERENCES
	// The general form for defining an action to be audited is: {action} ON {object} BY {principal}
	// Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or
	// schema. For the latter cases, the forms DATABASE::{dbname} and SCHEMA::{schema
	// name} are used, respectively.
	// For example: SELECT on dbo.myTable by public SELECT on DATABASE::myDatabase by public SELECT on SCHEMA::mySchema by public
	// For more information, see Database-Level Audit Actions
	// [https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions]
	AuditActionsAndGroups []*string `json:"auditActionsAndGroups,omitempty"`

	// Specifies whether audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify 'State'
	// as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on
	// the database should be also created. Note that for server level audit you
	// should use the 'master' database as {databaseName}.
	// Diagnostic Settings URI format: PUT
	// https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
	// For more information, see Diagnostic Settings REST API [https://go.microsoft.com/fwlink/?linkid=2033207]or Diagnostic Settings
	// PowerShell [https://go.microsoft.com/fwlink/?linkid=2033043]
	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`

	// Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure Monitor. In order to send the
	// events to Azure Monitor, specify 'State' as 'Enabled',
	// 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true
	// When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on
	// the master database should also be created.
	// Diagnostic Settings URI format: PUT
	// https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
	// For more information, see Diagnostic Settings REST API [https://go.microsoft.com/fwlink/?linkid=2033207]or Diagnostic Settings
	// PowerShell [https://go.microsoft.com/fwlink/?linkid=2033043]
	IsDevopsAuditEnabled *bool `json:"isDevopsAuditEnabled,omitempty"`

	// Specifies whether storageAccountAccessKey value is the storage's secondary key.
	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`

	// Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. The default
	// minimum value is 1000 (1 second). The maximum is 2,147,483,647.
	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`

	// Specifies the number of days to keep in the audit logs in the storage account.
	RetentionDays *int32 `json:"retentionDays,omitempty"`

	// Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, not
	// specifying the storageAccountAccessKey will use SQL server system-assigned
	// managed identity to access the storage. Prerequisites for using managed identity authentication:
	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server
	// identity. For more information, see Auditing to storage using Managed
	// Identity authentication [https://go.microsoft.com/fwlink/?linkid=2114355]
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`

	// Specifies the blob storage subscription Id.
	StorageAccountSubscriptionID *string `json:"storageAccountSubscriptionId,omitempty"`

	// Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint
	// or isAzureMonitorTargetEnabled is required.
	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
}

ServerBlobAuditingPolicyProperties - Properties of a server blob auditing policy.

func (ServerBlobAuditingPolicyProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyProperties.

type ServerCommunicationLink struct {
	// The properties of resource.
	Properties *ServerCommunicationLinkProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Communication link kind. This property is used for Azure Portal metadata.
	Kind *string `json:"kind,omitempty" azure:"ro"`

	// READ-ONLY; Communication link location.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServerCommunicationLink - Server communication link.

type ServerCommunicationLinkListResult

type ServerCommunicationLinkListResult struct {
	// The list of server communication links.
	Value []*ServerCommunicationLink `json:"value,omitempty"`
}

ServerCommunicationLinkListResult - A list of server communication links.

func (ServerCommunicationLinkListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerCommunicationLinkListResult.

type ServerCommunicationLinkProperties

type ServerCommunicationLinkProperties struct {
	// REQUIRED; The name of the partner server.
	PartnerServer *string `json:"partnerServer,omitempty"`

	// READ-ONLY; The state.
	State *string `json:"state,omitempty" azure:"ro"`
}

ServerCommunicationLinkProperties - The properties of a server communication link.

type ServerCommunicationLinksClient

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

ServerCommunicationLinksClient contains the methods for the ServerCommunicationLinks group. Don't use this type directly, use NewServerCommunicationLinksClient() instead.

func NewServerCommunicationLinksClient

func NewServerCommunicationLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerCommunicationLinksClient

NewServerCommunicationLinksClient creates a new instance of ServerCommunicationLinksClient with the specified values. subscriptionID - The 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 (*ServerCommunicationLinksClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates a server communication link. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. communicationLinkName - The name of the server communication link. parameters - The required parameters for creating a server communication link. options - ServerCommunicationLinksClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerCommunicationLinksClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkCreateOrUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerCommunicationLinksClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<communication-link-name>",
		armsql.ServerCommunicationLink{
			Properties: &armsql.ServerCommunicationLinkProperties{
				PartnerServer: to.StringPtr("<partner-server>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ServerCommunicationLinksClient) Delete

func (client *ServerCommunicationLinksClient) Delete(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, options *ServerCommunicationLinksClientDeleteOptions) (ServerCommunicationLinksClientDeleteResponse, error)

Delete - Deletes a server communication link. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. communicationLinkName - The name of the server communication link. options - ServerCommunicationLinksClientDeleteOptions contains the optional parameters for the ServerCommunicationLinksClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerCommunicationLinksClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<communication-link-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ServerCommunicationLinksClient) Get

func (client *ServerCommunicationLinksClient) Get(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, options *ServerCommunicationLinksClientGetOptions) (ServerCommunicationLinksClientGetResponse, error)

Get - Returns a server communication link. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. communicationLinkName - The name of the server communication link. options - ServerCommunicationLinksClientGetOptions contains the optional parameters for the ServerCommunicationLinksClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerCommunicationLinksClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<communication-link-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerCommunicationLinksClientGetResult)
}
Output:

func (*ServerCommunicationLinksClient) ListByServer

ListByServer - Gets a list of server communication links. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServerCommunicationLinksClientListByServerOptions contains the optional parameters for the ServerCommunicationLinksClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerCommunicationLinksClient("<subscription-id>", cred, nil)
	res, err := client.ListByServer(ctx,
		"<resource-group-name>",
		"<server-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerCommunicationLinksClientListByServerResult)
}
Output:

type ServerCommunicationLinksClientBeginCreateOrUpdateOptions added in v0.3.0

type ServerCommunicationLinksClientBeginCreateOrUpdateOptions struct {
}

ServerCommunicationLinksClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerCommunicationLinksClient.BeginCreateOrUpdate method.

type ServerCommunicationLinksClientCreateOrUpdatePoller added in v0.3.0

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

ServerCommunicationLinksClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerCommunicationLinksClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerCommunicationLinksClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerCommunicationLinksClientCreateOrUpdateResponse will be returned.

func (*ServerCommunicationLinksClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerCommunicationLinksClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerCommunicationLinksClientCreateOrUpdatePollerResponse added in v0.3.0

type ServerCommunicationLinksClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerCommunicationLinksClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerCommunicationLinksClientCreateOrUpdatePollerResponse contains the response from method ServerCommunicationLinksClient.CreateOrUpdate.

func (ServerCommunicationLinksClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerCommunicationLinksClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerCommunicationLinksClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ServerCommunicationLinksClientCreateOrUpdateResponse added in v0.3.0

type ServerCommunicationLinksClientCreateOrUpdateResponse struct {
	ServerCommunicationLinksClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerCommunicationLinksClientCreateOrUpdateResponse contains the response from method ServerCommunicationLinksClient.CreateOrUpdate.

type ServerCommunicationLinksClientCreateOrUpdateResult added in v0.3.0

type ServerCommunicationLinksClientCreateOrUpdateResult struct {
	ServerCommunicationLink
}

ServerCommunicationLinksClientCreateOrUpdateResult contains the result from method ServerCommunicationLinksClient.CreateOrUpdate.

type ServerCommunicationLinksClientDeleteOptions added in v0.3.0

type ServerCommunicationLinksClientDeleteOptions struct {
}

ServerCommunicationLinksClientDeleteOptions contains the optional parameters for the ServerCommunicationLinksClient.Delete method.

type ServerCommunicationLinksClientDeleteResponse added in v0.3.0

type ServerCommunicationLinksClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerCommunicationLinksClientDeleteResponse contains the response from method ServerCommunicationLinksClient.Delete.

type ServerCommunicationLinksClientGetOptions added in v0.3.0

type ServerCommunicationLinksClientGetOptions struct {
}

ServerCommunicationLinksClientGetOptions contains the optional parameters for the ServerCommunicationLinksClient.Get method.

type ServerCommunicationLinksClientGetResponse added in v0.3.0

type ServerCommunicationLinksClientGetResponse struct {
	ServerCommunicationLinksClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerCommunicationLinksClientGetResponse contains the response from method ServerCommunicationLinksClient.Get.

type ServerCommunicationLinksClientGetResult added in v0.3.0

type ServerCommunicationLinksClientGetResult struct {
	ServerCommunicationLink
}

ServerCommunicationLinksClientGetResult contains the result from method ServerCommunicationLinksClient.Get.

type ServerCommunicationLinksClientListByServerOptions added in v0.3.0

type ServerCommunicationLinksClientListByServerOptions struct {
}

ServerCommunicationLinksClientListByServerOptions contains the optional parameters for the ServerCommunicationLinksClient.ListByServer method.

type ServerCommunicationLinksClientListByServerResponse added in v0.3.0

type ServerCommunicationLinksClientListByServerResponse struct {
	ServerCommunicationLinksClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerCommunicationLinksClientListByServerResponse contains the response from method ServerCommunicationLinksClient.ListByServer.

type ServerCommunicationLinksClientListByServerResult added in v0.3.0

type ServerCommunicationLinksClientListByServerResult struct {
	ServerCommunicationLinkListResult
}

ServerCommunicationLinksClientListByServerResult contains the result from method ServerCommunicationLinksClient.ListByServer.

type ServerConnectionPoliciesClient

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

ServerConnectionPoliciesClient contains the methods for the ServerConnectionPolicies group. Don't use this type directly, use NewServerConnectionPoliciesClient() instead.

func NewServerConnectionPoliciesClient

func NewServerConnectionPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerConnectionPoliciesClient

NewServerConnectionPoliciesClient creates a new instance of ServerConnectionPoliciesClient with the specified values. subscriptionID - The 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 (*ServerConnectionPoliciesClient) BeginCreateOrUpdate added in v0.3.0

BeginCreateOrUpdate - Updates a server connection policy If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. connectionPolicyName - The name of the connection policy. parameters - The required parameters for updating a server connection policy. options - ServerConnectionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerConnectionPoliciesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesUpdate.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerConnectionPoliciesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.ConnectionPolicyName("default"),
		armsql.ServerConnectionPolicy{
			Properties: &armsql.ServerConnectionPolicyProperties{
				ConnectionType: armsql.ServerConnectionType("Redirect").ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerConnectionPoliciesClientCreateOrUpdateResult)
}
Output:

func (*ServerConnectionPoliciesClient) Get

Get - Gets a server connection policy If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. connectionPolicyName - The name of the connection policy. options - ServerConnectionPoliciesClientGetOptions contains the optional parameters for the ServerConnectionPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerConnectionPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.ConnectionPolicyName("default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerConnectionPoliciesClientGetResult)
}
Output:

func (*ServerConnectionPoliciesClient) ListByServer added in v0.3.0

ListByServer - Lists connection policy If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServerConnectionPoliciesClientListByServerOptions contains the optional parameters for the ServerConnectionPoliciesClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerConnectionPoliciesClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ServerConnectionPoliciesClientBeginCreateOrUpdateOptions added in v0.3.0

type ServerConnectionPoliciesClientBeginCreateOrUpdateOptions struct {
}

ServerConnectionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerConnectionPoliciesClient.BeginCreateOrUpdate method.

type ServerConnectionPoliciesClientCreateOrUpdatePoller added in v0.3.0

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

ServerConnectionPoliciesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerConnectionPoliciesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerConnectionPoliciesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerConnectionPoliciesClientCreateOrUpdateResponse will be returned.

func (*ServerConnectionPoliciesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerConnectionPoliciesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerConnectionPoliciesClientCreateOrUpdatePollerResponse added in v0.3.0

type ServerConnectionPoliciesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerConnectionPoliciesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerConnectionPoliciesClientCreateOrUpdatePollerResponse contains the response from method ServerConnectionPoliciesClient.CreateOrUpdate.

func (ServerConnectionPoliciesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerConnectionPoliciesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerConnectionPoliciesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ServerConnectionPoliciesClientCreateOrUpdateResponse added in v0.3.0

type ServerConnectionPoliciesClientCreateOrUpdateResponse struct {
	ServerConnectionPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerConnectionPoliciesClientCreateOrUpdateResponse contains the response from method ServerConnectionPoliciesClient.CreateOrUpdate.

type ServerConnectionPoliciesClientCreateOrUpdateResult added in v0.3.0

type ServerConnectionPoliciesClientCreateOrUpdateResult struct {
	ServerConnectionPolicy
}

ServerConnectionPoliciesClientCreateOrUpdateResult contains the result from method ServerConnectionPoliciesClient.CreateOrUpdate.

type ServerConnectionPoliciesClientGetOptions added in v0.3.0

type ServerConnectionPoliciesClientGetOptions struct {
}

ServerConnectionPoliciesClientGetOptions contains the optional parameters for the ServerConnectionPoliciesClient.Get method.

type ServerConnectionPoliciesClientGetResponse added in v0.3.0

type ServerConnectionPoliciesClientGetResponse struct {
	ServerConnectionPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerConnectionPoliciesClientGetResponse contains the response from method ServerConnectionPoliciesClient.Get.

type ServerConnectionPoliciesClientGetResult added in v0.3.0

type ServerConnectionPoliciesClientGetResult struct {
	ServerConnectionPolicy
}

ServerConnectionPoliciesClientGetResult contains the result from method ServerConnectionPoliciesClient.Get.

type ServerConnectionPoliciesClientListByServerOptions added in v0.3.0

type ServerConnectionPoliciesClientListByServerOptions struct {
}

ServerConnectionPoliciesClientListByServerOptions contains the optional parameters for the ServerConnectionPoliciesClient.ListByServer method.

type ServerConnectionPoliciesClientListByServerPager added in v0.3.0

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

ServerConnectionPoliciesClientListByServerPager provides operations for iterating over paged responses.

func (*ServerConnectionPoliciesClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ServerConnectionPoliciesClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServerConnectionPoliciesClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current ServerConnectionPoliciesClientListByServerResponse page.

type ServerConnectionPoliciesClientListByServerResponse added in v0.3.0

type ServerConnectionPoliciesClientListByServerResponse struct {
	ServerConnectionPoliciesClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerConnectionPoliciesClientListByServerResponse contains the response from method ServerConnectionPoliciesClient.ListByServer.

type ServerConnectionPoliciesClientListByServerResult added in v0.3.0

type ServerConnectionPoliciesClientListByServerResult struct {
	ServerConnectionPolicyListResult
}

ServerConnectionPoliciesClientListByServerResult contains the result from method ServerConnectionPoliciesClient.ListByServer.

type ServerConnectionPolicy

type ServerConnectionPolicy struct {
	// Resource properties.
	Properties *ServerConnectionPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Metadata used for the Azure portal experience.
	Kind *string `json:"kind,omitempty" azure:"ro"`

	// READ-ONLY; Resource location.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServerConnectionPolicy - A server connection policy

type ServerConnectionPolicyListResult added in v0.3.0

type ServerConnectionPolicyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ServerConnectionPolicy `json:"value,omitempty" azure:"ro"`
}

ServerConnectionPolicyListResult - A list of server connection policy objects.

func (ServerConnectionPolicyListResult) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ServerConnectionPolicyListResult.

type ServerConnectionPolicyProperties

type ServerConnectionPolicyProperties struct {
	// REQUIRED; The server connection type.
	ConnectionType *ServerConnectionType `json:"connectionType,omitempty"`
}

ServerConnectionPolicyProperties - The properties of a server connection policy.

type ServerConnectionType

type ServerConnectionType string

ServerConnectionType - The server connection type.

const (
	ServerConnectionTypeDefault  ServerConnectionType = "Default"
	ServerConnectionTypeProxy    ServerConnectionType = "Proxy"
	ServerConnectionTypeRedirect ServerConnectionType = "Redirect"
)

func PossibleServerConnectionTypeValues

func PossibleServerConnectionTypeValues() []ServerConnectionType

PossibleServerConnectionTypeValues returns the possible values for the ServerConnectionType const type.

func (ServerConnectionType) ToPtr

ToPtr returns a *ServerConnectionType pointing to the current value.

type ServerDNSAlias

type ServerDNSAlias struct {
	// Resource properties.
	Properties *ServerDNSAliasProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServerDNSAlias - A server DNS alias.

type ServerDNSAliasAcquisition

type ServerDNSAliasAcquisition struct {
	// REQUIRED; The id of the server alias that will be acquired to point to this server instead.
	OldServerDNSAliasID *string `json:"oldServerDnsAliasId,omitempty"`
}

ServerDNSAliasAcquisition - A server dns alias acquisition request.

type ServerDNSAliasListResult

type ServerDNSAliasListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ServerDNSAlias `json:"value,omitempty" azure:"ro"`
}

ServerDNSAliasListResult - A list of server DNS aliases.

func (ServerDNSAliasListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerDNSAliasListResult.

type ServerDNSAliasProperties

type ServerDNSAliasProperties struct {
	// READ-ONLY; The fully qualified DNS record for alias
	AzureDNSRecord *string `json:"azureDnsRecord,omitempty" azure:"ro"`
}

ServerDNSAliasProperties - Properties of a server DNS alias.

type ServerDNSAliasesClient

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

ServerDNSAliasesClient contains the methods for the ServerDNSAliases group. Don't use this type directly, use NewServerDNSAliasesClient() instead.

func NewServerDNSAliasesClient

func NewServerDNSAliasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerDNSAliasesClient

NewServerDNSAliasesClient creates a new instance of ServerDNSAliasesClient with the specified values. subscriptionID - The 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 (*ServerDNSAliasesClient) BeginAcquire

func (client *ServerDNSAliasesClient) BeginAcquire(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, parameters ServerDNSAliasAcquisition, options *ServerDNSAliasesClientBeginAcquireOptions) (ServerDNSAliasesClientAcquirePollerResponse, error)

BeginAcquire - Acquires server DNS alias from another server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server that the alias is pointing to. dnsAliasName - The name of the server dns alias. options - ServerDNSAliasesClientBeginAcquireOptions contains the optional parameters for the ServerDNSAliasesClient.BeginAcquire method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasAcquire.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerDNSAliasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginAcquire(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<dns-alias-name>",
		armsql.ServerDNSAliasAcquisition{
			OldServerDNSAliasID: to.StringPtr("<old-server-dnsalias-id>"),
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerDNSAliasesClientAcquireResult)
}
Output:

func (*ServerDNSAliasesClient) BeginCreateOrUpdate

func (client *ServerDNSAliasesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, options *ServerDNSAliasesClientBeginCreateOrUpdateOptions) (ServerDNSAliasesClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates a server DNS alias. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server that the alias is pointing to. dnsAliasName - The name of the server dns alias. options - ServerDNSAliasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerDNSAliasesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasCreateOrUpdate.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerDNSAliasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<dns-alias-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerDNSAliasesClientCreateOrUpdateResult)
}
Output:

func (*ServerDNSAliasesClient) BeginDelete

func (client *ServerDNSAliasesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, options *ServerDNSAliasesClientBeginDeleteOptions) (ServerDNSAliasesClientDeletePollerResponse, error)

BeginDelete - Deletes the server DNS alias with the given name. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server that the alias is pointing to. dnsAliasName - The name of the server dns alias. options - ServerDNSAliasesClientBeginDeleteOptions contains the optional parameters for the ServerDNSAliasesClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerDNSAliasesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<dns-alias-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ServerDNSAliasesClient) Get

func (client *ServerDNSAliasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, options *ServerDNSAliasesClientGetOptions) (ServerDNSAliasesClientGetResponse, error)

Get - Gets a server DNS alias. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server that the alias is pointing to. dnsAliasName - The name of the server dns alias. options - ServerDNSAliasesClientGetOptions contains the optional parameters for the ServerDNSAliasesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerDNSAliasesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<dns-alias-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerDNSAliasesClientGetResult)
}
Output:

func (*ServerDNSAliasesClient) ListByServer

func (client *ServerDNSAliasesClient) ListByServer(resourceGroupName string, serverName string, options *ServerDNSAliasesClientListByServerOptions) *ServerDNSAliasesClientListByServerPager

ListByServer - Gets a list of server DNS aliases for a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server that the alias is pointing to. options - ServerDNSAliasesClientListByServerOptions contains the optional parameters for the ServerDNSAliasesClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerDNSAliasesClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ServerDNSAliasesClientAcquirePoller added in v0.3.0

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

ServerDNSAliasesClientAcquirePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerDNSAliasesClientAcquirePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerDNSAliasesClientAcquirePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerDNSAliasesClientAcquireResponse will be returned.

func (*ServerDNSAliasesClientAcquirePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerDNSAliasesClientAcquirePoller) ResumeToken added in v0.3.0

func (p *ServerDNSAliasesClientAcquirePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerDNSAliasesClientAcquirePollerResponse added in v0.3.0

type ServerDNSAliasesClientAcquirePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerDNSAliasesClientAcquirePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerDNSAliasesClientAcquirePollerResponse contains the response from method ServerDNSAliasesClient.Acquire.

func (ServerDNSAliasesClientAcquirePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerDNSAliasesClientAcquirePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerDNSAliasesClientAcquirePollerResponse from the provided client and resume token.

type ServerDNSAliasesClientAcquireResponse added in v0.3.0

type ServerDNSAliasesClientAcquireResponse struct {
	ServerDNSAliasesClientAcquireResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerDNSAliasesClientAcquireResponse contains the response from method ServerDNSAliasesClient.Acquire.

type ServerDNSAliasesClientAcquireResult added in v0.3.0

type ServerDNSAliasesClientAcquireResult struct {
	ServerDNSAlias
}

ServerDNSAliasesClientAcquireResult contains the result from method ServerDNSAliasesClient.Acquire.

type ServerDNSAliasesClientBeginAcquireOptions added in v0.3.0

type ServerDNSAliasesClientBeginAcquireOptions struct {
}

ServerDNSAliasesClientBeginAcquireOptions contains the optional parameters for the ServerDNSAliasesClient.BeginAcquire method.

type ServerDNSAliasesClientBeginCreateOrUpdateOptions added in v0.3.0

type ServerDNSAliasesClientBeginCreateOrUpdateOptions struct {
}

ServerDNSAliasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerDNSAliasesClient.BeginCreateOrUpdate method.

type ServerDNSAliasesClientBeginDeleteOptions added in v0.3.0

type ServerDNSAliasesClientBeginDeleteOptions struct {
}

ServerDNSAliasesClientBeginDeleteOptions contains the optional parameters for the ServerDNSAliasesClient.BeginDelete method.

type ServerDNSAliasesClientCreateOrUpdatePoller added in v0.3.0

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

ServerDNSAliasesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerDNSAliasesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerDNSAliasesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerDNSAliasesClientCreateOrUpdateResponse will be returned.

func (*ServerDNSAliasesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerDNSAliasesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerDNSAliasesClientCreateOrUpdatePollerResponse added in v0.3.0

type ServerDNSAliasesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerDNSAliasesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerDNSAliasesClientCreateOrUpdatePollerResponse contains the response from method ServerDNSAliasesClient.CreateOrUpdate.

func (ServerDNSAliasesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerDNSAliasesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerDNSAliasesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ServerDNSAliasesClientCreateOrUpdateResponse added in v0.3.0

type ServerDNSAliasesClientCreateOrUpdateResponse struct {
	ServerDNSAliasesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerDNSAliasesClientCreateOrUpdateResponse contains the response from method ServerDNSAliasesClient.CreateOrUpdate.

type ServerDNSAliasesClientCreateOrUpdateResult added in v0.3.0

type ServerDNSAliasesClientCreateOrUpdateResult struct {
	ServerDNSAlias
}

ServerDNSAliasesClientCreateOrUpdateResult contains the result from method ServerDNSAliasesClient.CreateOrUpdate.

type ServerDNSAliasesClientDeletePoller added in v0.3.0

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

ServerDNSAliasesClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerDNSAliasesClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerDNSAliasesClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerDNSAliasesClientDeleteResponse will be returned.

func (*ServerDNSAliasesClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerDNSAliasesClientDeletePoller) ResumeToken added in v0.3.0

func (p *ServerDNSAliasesClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerDNSAliasesClientDeletePollerResponse added in v0.3.0

type ServerDNSAliasesClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerDNSAliasesClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerDNSAliasesClientDeletePollerResponse contains the response from method ServerDNSAliasesClient.Delete.

func (ServerDNSAliasesClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerDNSAliasesClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerDNSAliasesClientDeletePollerResponse from the provided client and resume token.

type ServerDNSAliasesClientDeleteResponse added in v0.3.0

type ServerDNSAliasesClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerDNSAliasesClientDeleteResponse contains the response from method ServerDNSAliasesClient.Delete.

type ServerDNSAliasesClientGetOptions added in v0.3.0

type ServerDNSAliasesClientGetOptions struct {
}

ServerDNSAliasesClientGetOptions contains the optional parameters for the ServerDNSAliasesClient.Get method.

type ServerDNSAliasesClientGetResponse added in v0.3.0

type ServerDNSAliasesClientGetResponse struct {
	ServerDNSAliasesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerDNSAliasesClientGetResponse contains the response from method ServerDNSAliasesClient.Get.

type ServerDNSAliasesClientGetResult added in v0.3.0

type ServerDNSAliasesClientGetResult struct {
	ServerDNSAlias
}

ServerDNSAliasesClientGetResult contains the result from method ServerDNSAliasesClient.Get.

type ServerDNSAliasesClientListByServerOptions added in v0.3.0

type ServerDNSAliasesClientListByServerOptions struct {
}

ServerDNSAliasesClientListByServerOptions contains the optional parameters for the ServerDNSAliasesClient.ListByServer method.

type ServerDNSAliasesClientListByServerPager added in v0.3.0

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

ServerDNSAliasesClientListByServerPager provides operations for iterating over paged responses.

func (*ServerDNSAliasesClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ServerDNSAliasesClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServerDNSAliasesClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current ServerDNSAliasesClientListByServerResponse page.

type ServerDNSAliasesClientListByServerResponse added in v0.3.0

type ServerDNSAliasesClientListByServerResponse struct {
	ServerDNSAliasesClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerDNSAliasesClientListByServerResponse contains the response from method ServerDNSAliasesClient.ListByServer.

type ServerDNSAliasesClientListByServerResult added in v0.3.0

type ServerDNSAliasesClientListByServerResult struct {
	ServerDNSAliasListResult
}

ServerDNSAliasesClientListByServerResult contains the result from method ServerDNSAliasesClient.ListByServer.

type ServerDevOpsAuditSettingsClient

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

ServerDevOpsAuditSettingsClient contains the methods for the ServerDevOpsAuditSettings group. Don't use this type directly, use NewServerDevOpsAuditSettingsClient() instead.

func NewServerDevOpsAuditSettingsClient

func NewServerDevOpsAuditSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerDevOpsAuditSettingsClient

NewServerDevOpsAuditSettingsClient creates a new instance of ServerDevOpsAuditSettingsClient with the specified values. subscriptionID - The 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 (*ServerDevOpsAuditSettingsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates a server's DevOps audit settings. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. devOpsAuditingSettingsName - The name of the devops audit settings. This should always be 'default'. parameters - Properties of DevOps audit settings options - ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDevOpsAuditCreateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerDevOpsAuditSettingsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<dev-ops-auditing-settings-name>",
		armsql.ServerDevOpsAuditingSettings{
			Properties: &armsql.ServerDevOpsAuditSettingsProperties{
				IsAzureMonitorTargetEnabled:  to.BoolPtr(true),
				State:                        armsql.BlobAuditingPolicyStateEnabled.ToPtr(),
				StorageAccountAccessKey:      to.StringPtr("<storage-account-access-key>"),
				StorageAccountSubscriptionID: to.StringPtr("<storage-account-subscription-id>"),
				StorageEndpoint:              to.StringPtr("<storage-endpoint>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerDevOpsAuditSettingsClientCreateOrUpdateResult)
}
Output:

func (*ServerDevOpsAuditSettingsClient) Get

func (client *ServerDevOpsAuditSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName string, options *ServerDevOpsAuditSettingsClientGetOptions) (ServerDevOpsAuditSettingsClientGetResponse, error)

Get - Gets a server's DevOps audit settings. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. devOpsAuditingSettingsName - The name of the devops audit settings. This should always be 'default'. options - ServerDevOpsAuditSettingsClientGetOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDevOpsAuditGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerDevOpsAuditSettingsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<dev-ops-auditing-settings-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerDevOpsAuditSettingsClientGetResult)
}
Output:

func (*ServerDevOpsAuditSettingsClient) ListByServer

ListByServer - Lists DevOps audit settings of a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServerDevOpsAuditSettingsClientListByServerOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDevOpsAuditSettingsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerDevOpsAuditSettingsClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions added in v0.3.0

type ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions struct {
}

ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.BeginCreateOrUpdate method.

type ServerDevOpsAuditSettingsClientCreateOrUpdatePoller added in v0.3.0

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

ServerDevOpsAuditSettingsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerDevOpsAuditSettingsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerDevOpsAuditSettingsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerDevOpsAuditSettingsClientCreateOrUpdateResponse will be returned.

func (*ServerDevOpsAuditSettingsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerDevOpsAuditSettingsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerDevOpsAuditSettingsClientCreateOrUpdatePollerResponse added in v0.3.0

type ServerDevOpsAuditSettingsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerDevOpsAuditSettingsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerDevOpsAuditSettingsClientCreateOrUpdatePollerResponse contains the response from method ServerDevOpsAuditSettingsClient.CreateOrUpdate.

func (ServerDevOpsAuditSettingsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerDevOpsAuditSettingsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerDevOpsAuditSettingsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ServerDevOpsAuditSettingsClientCreateOrUpdateResponse added in v0.3.0

type ServerDevOpsAuditSettingsClientCreateOrUpdateResponse struct {
	ServerDevOpsAuditSettingsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerDevOpsAuditSettingsClientCreateOrUpdateResponse contains the response from method ServerDevOpsAuditSettingsClient.CreateOrUpdate.

type ServerDevOpsAuditSettingsClientCreateOrUpdateResult added in v0.3.0

type ServerDevOpsAuditSettingsClientCreateOrUpdateResult struct {
	ServerDevOpsAuditingSettings
}

ServerDevOpsAuditSettingsClientCreateOrUpdateResult contains the result from method ServerDevOpsAuditSettingsClient.CreateOrUpdate.

type ServerDevOpsAuditSettingsClientGetOptions added in v0.3.0

type ServerDevOpsAuditSettingsClientGetOptions struct {
}

ServerDevOpsAuditSettingsClientGetOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.Get method.

type ServerDevOpsAuditSettingsClientGetResponse added in v0.3.0

type ServerDevOpsAuditSettingsClientGetResponse struct {
	ServerDevOpsAuditSettingsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerDevOpsAuditSettingsClientGetResponse contains the response from method ServerDevOpsAuditSettingsClient.Get.

type ServerDevOpsAuditSettingsClientGetResult added in v0.3.0

type ServerDevOpsAuditSettingsClientGetResult struct {
	ServerDevOpsAuditingSettings
}

ServerDevOpsAuditSettingsClientGetResult contains the result from method ServerDevOpsAuditSettingsClient.Get.

type ServerDevOpsAuditSettingsClientListByServerOptions added in v0.3.0

type ServerDevOpsAuditSettingsClientListByServerOptions struct {
}

ServerDevOpsAuditSettingsClientListByServerOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.ListByServer method.

type ServerDevOpsAuditSettingsClientListByServerPager added in v0.3.0

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

ServerDevOpsAuditSettingsClientListByServerPager provides operations for iterating over paged responses.

func (*ServerDevOpsAuditSettingsClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ServerDevOpsAuditSettingsClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServerDevOpsAuditSettingsClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current ServerDevOpsAuditSettingsClientListByServerResponse page.

type ServerDevOpsAuditSettingsClientListByServerResponse added in v0.3.0

type ServerDevOpsAuditSettingsClientListByServerResponse struct {
	ServerDevOpsAuditSettingsClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerDevOpsAuditSettingsClientListByServerResponse contains the response from method ServerDevOpsAuditSettingsClient.ListByServer.

type ServerDevOpsAuditSettingsClientListByServerResult added in v0.3.0

type ServerDevOpsAuditSettingsClientListByServerResult struct {
	ServerDevOpsAuditSettingsListResult
}

ServerDevOpsAuditSettingsClientListByServerResult contains the result from method ServerDevOpsAuditSettingsClient.ListByServer.

type ServerDevOpsAuditSettingsListResult

type ServerDevOpsAuditSettingsListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ServerDevOpsAuditingSettings `json:"value,omitempty" azure:"ro"`
}

ServerDevOpsAuditSettingsListResult - A list of server DevOps audit settings.

func (ServerDevOpsAuditSettingsListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerDevOpsAuditSettingsListResult.

type ServerDevOpsAuditSettingsProperties

type ServerDevOpsAuditSettingsProperties struct {
	// REQUIRED; Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
	State *BlobAuditingPolicyState `json:"state,omitempty"`

	// Specifies whether DevOps audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify
	// 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
	// When using REST API to configure DevOps audit, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category
	// on the master database should be also created.
	// Diagnostic Settings URI format: PUT
	// https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
	// For more information, see Diagnostic Settings REST API [https://go.microsoft.com/fwlink/?linkid=2033207]or Diagnostic Settings
	// PowerShell [https://go.microsoft.com/fwlink/?linkid=2033043]
	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`

	// Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, not
	// specifying the storageAccountAccessKey will use SQL server system-assigned
	// managed identity to access the storage. Prerequisites for using managed identity authentication:
	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server
	// identity. For more information, see Auditing to storage using Managed
	// Identity authentication [https://go.microsoft.com/fwlink/?linkid=2114355]
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`

	// Specifies the blob storage subscription Id.
	StorageAccountSubscriptionID *string `json:"storageAccountSubscriptionId,omitempty"`

	// Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint
	// or isAzureMonitorTargetEnabled is required.
	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
}

ServerDevOpsAuditSettingsProperties - Properties of a server DevOps audit settings.

type ServerDevOpsAuditingSettings

type ServerDevOpsAuditingSettings struct {
	// Resource properties.
	Properties *ServerDevOpsAuditSettingsProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; SystemData of ServerDevOpsAuditSettingsResource.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServerDevOpsAuditingSettings - A server DevOps auditing settings.

type ServerExternalAdministrator

type ServerExternalAdministrator struct {
	// Type of the sever administrator.
	AdministratorType *AdministratorType `json:"administratorType,omitempty"`

	// Azure Active Directory only Authentication enabled.
	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`

	// Login name of the server administrator.
	Login *string `json:"login,omitempty"`

	// Principal Type of the sever administrator.
	PrincipalType *PrincipalType `json:"principalType,omitempty"`

	// SID (object ID) of the server administrator.
	Sid *string `json:"sid,omitempty"`

	// Tenant ID of the administrator.
	TenantID *string `json:"tenantId,omitempty"`
}

ServerExternalAdministrator - Properties of a active directory administrator.

type ServerFirewallRuleProperties

type ServerFirewallRuleProperties struct {
	// The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. Use value
	// '0.0.0.0' for all Azure-internal IP addresses.
	EndIPAddress *string `json:"endIpAddress,omitempty"`

	// The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' for all Azure-internal IP addresses.
	StartIPAddress *string `json:"startIpAddress,omitempty"`
}

ServerFirewallRuleProperties - The properties of a server firewall rule.

type ServerInfo

type ServerInfo struct {
	// REQUIRED; Server Id.
	ServerID *string `json:"serverId,omitempty"`
}

ServerInfo - Server info for the server trust group.

type ServerKey

type ServerKey struct {
	// Resource properties.
	Properties *ServerKeyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
	Kind *string `json:"kind,omitempty" azure:"ro"`

	// READ-ONLY; Resource location.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServerKey - A server key.

type ServerKeyListResult

type ServerKeyListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ServerKey `json:"value,omitempty" azure:"ro"`
}

ServerKeyListResult - A list of server keys.

func (ServerKeyListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerKeyListResult.

type ServerKeyProperties

type ServerKeyProperties struct {
	// REQUIRED; The server key type like 'ServiceManaged', 'AzureKeyVault'.
	ServerKeyType *ServerKeyType `json:"serverKeyType,omitempty"`

	// The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is required.
	URI *string `json:"uri,omitempty"`

	// READ-ONLY; Key auto rotation opt-in flag. Either true or false.
	AutoRotationEnabled *bool `json:"autoRotationEnabled,omitempty" azure:"ro"`

	// READ-ONLY; The server key creation date.
	CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"`

	// READ-ONLY; Subregion of the server key.
	Subregion *string `json:"subregion,omitempty" azure:"ro"`

	// READ-ONLY; Thumbprint of the server key.
	Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"`
}

ServerKeyProperties - Properties for a server key execution.

func (ServerKeyProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerKeyProperties.

func (*ServerKeyProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerKeyProperties.

type ServerKeyType

type ServerKeyType string

ServerKeyType - The encryption protector type like 'ServiceManaged', 'AzureKeyVault'.

const (
	ServerKeyTypeAzureKeyVault  ServerKeyType = "AzureKeyVault"
	ServerKeyTypeServiceManaged ServerKeyType = "ServiceManaged"
)

func PossibleServerKeyTypeValues

func PossibleServerKeyTypeValues() []ServerKeyType

PossibleServerKeyTypeValues returns the possible values for the ServerKeyType const type.

func (ServerKeyType) ToPtr

func (c ServerKeyType) ToPtr() *ServerKeyType

ToPtr returns a *ServerKeyType pointing to the current value.

type ServerKeysClient

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

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

func NewServerKeysClient

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

NewServerKeysClient creates a new instance of ServerKeysClient with the specified values. subscriptionID - The 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 (*ServerKeysClient) BeginCreateOrUpdate

func (client *ServerKeysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, keyName string, parameters ServerKey, options *ServerKeysClientBeginCreateOrUpdateOptions) (ServerKeysClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates a server key. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. keyName - The name of the server key to be operated on (updated or created). The key name is required to be in the format of 'vaultkeyversion'. For example, if the keyId is https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name should be formatted as: YourVaultNameYourKeyNameYourKeyVersion parameters - The requested server key resource state. options - ServerKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerKeysClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyCreateOrUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerKeysClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<key-name>",
		armsql.ServerKey{
			Properties: &armsql.ServerKeyProperties{
				ServerKeyType: armsql.ServerKeyType("AzureKeyVault").ToPtr(),
				URI:           to.StringPtr("<uri>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerKeysClientCreateOrUpdateResult)
}
Output:

func (*ServerKeysClient) BeginDelete

func (client *ServerKeysClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, keyName string, options *ServerKeysClientBeginDeleteOptions) (ServerKeysClientDeletePollerResponse, error)

BeginDelete - Deletes the server key with the given name. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. keyName - The name of the server key to be deleted. options - ServerKeysClientBeginDeleteOptions contains the optional parameters for the ServerKeysClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerKeysClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<key-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ServerKeysClient) Get

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

Get - Gets a server key. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. keyName - The name of the server key to be retrieved. options - ServerKeysClientGetOptions contains the optional parameters for the ServerKeysClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerKeysClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<key-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerKeysClientGetResult)
}
Output:

func (*ServerKeysClient) ListByServer

func (client *ServerKeysClient) ListByServer(resourceGroupName string, serverName string, options *ServerKeysClientListByServerOptions) *ServerKeysClientListByServerPager

ListByServer - Gets a list of server keys. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServerKeysClientListByServerOptions contains the optional parameters for the ServerKeysClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerKeysClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ServerKeysClientBeginCreateOrUpdateOptions added in v0.3.0

type ServerKeysClientBeginCreateOrUpdateOptions struct {
}

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

type ServerKeysClientBeginDeleteOptions added in v0.3.0

type ServerKeysClientBeginDeleteOptions struct {
}

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

type ServerKeysClientCreateOrUpdatePoller added in v0.3.0

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

ServerKeysClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerKeysClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerKeysClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerKeysClientCreateOrUpdateResponse will be returned.

func (*ServerKeysClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerKeysClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerKeysClientCreateOrUpdatePollerResponse added in v0.3.0

type ServerKeysClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerKeysClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerKeysClientCreateOrUpdatePollerResponse contains the response from method ServerKeysClient.CreateOrUpdate.

func (ServerKeysClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerKeysClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerKeysClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ServerKeysClientCreateOrUpdateResponse added in v0.3.0

type ServerKeysClientCreateOrUpdateResponse struct {
	ServerKeysClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerKeysClientCreateOrUpdateResponse contains the response from method ServerKeysClient.CreateOrUpdate.

type ServerKeysClientCreateOrUpdateResult added in v0.3.0

type ServerKeysClientCreateOrUpdateResult struct {
	ServerKey
}

ServerKeysClientCreateOrUpdateResult contains the result from method ServerKeysClient.CreateOrUpdate.

type ServerKeysClientDeletePoller added in v0.3.0

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

ServerKeysClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerKeysClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerKeysClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerKeysClientDeleteResponse will be returned.

func (*ServerKeysClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerKeysClientDeletePoller) ResumeToken added in v0.3.0

func (p *ServerKeysClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerKeysClientDeletePollerResponse added in v0.3.0

type ServerKeysClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerKeysClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerKeysClientDeletePollerResponse contains the response from method ServerKeysClient.Delete.

func (ServerKeysClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerKeysClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerKeysClientDeletePollerResponse from the provided client and resume token.

type ServerKeysClientDeleteResponse added in v0.3.0

type ServerKeysClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerKeysClientDeleteResponse contains the response from method ServerKeysClient.Delete.

type ServerKeysClientGetOptions added in v0.3.0

type ServerKeysClientGetOptions struct {
}

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

type ServerKeysClientGetResponse added in v0.3.0

type ServerKeysClientGetResponse struct {
	ServerKeysClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerKeysClientGetResponse contains the response from method ServerKeysClient.Get.

type ServerKeysClientGetResult added in v0.3.0

type ServerKeysClientGetResult struct {
	ServerKey
}

ServerKeysClientGetResult contains the result from method ServerKeysClient.Get.

type ServerKeysClientListByServerOptions added in v0.3.0

type ServerKeysClientListByServerOptions struct {
}

ServerKeysClientListByServerOptions contains the optional parameters for the ServerKeysClient.ListByServer method.

type ServerKeysClientListByServerPager added in v0.3.0

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

ServerKeysClientListByServerPager provides operations for iterating over paged responses.

func (*ServerKeysClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ServerKeysClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServerKeysClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current ServerKeysClientListByServerResponse page.

type ServerKeysClientListByServerResponse added in v0.3.0

type ServerKeysClientListByServerResponse struct {
	ServerKeysClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerKeysClientListByServerResponse contains the response from method ServerKeysClient.ListByServer.

type ServerKeysClientListByServerResult added in v0.3.0

type ServerKeysClientListByServerResult struct {
	ServerKeyListResult
}

ServerKeysClientListByServerResult contains the result from method ServerKeysClient.ListByServer.

type ServerListResult

type ServerListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*Server `json:"value,omitempty" azure:"ro"`
}

ServerListResult - A list of servers.

func (ServerListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerListResult.

type ServerNetworkAccessFlag

type ServerNetworkAccessFlag string

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

const (
	ServerNetworkAccessFlagDisabled ServerNetworkAccessFlag = "Disabled"
	ServerNetworkAccessFlagEnabled  ServerNetworkAccessFlag = "Enabled"
)

func PossibleServerNetworkAccessFlagValues

func PossibleServerNetworkAccessFlagValues() []ServerNetworkAccessFlag

PossibleServerNetworkAccessFlagValues returns the possible values for the ServerNetworkAccessFlag const type.

func (ServerNetworkAccessFlag) ToPtr

ToPtr returns a *ServerNetworkAccessFlag pointing to the current value.

type ServerOperation

type ServerOperation struct {
	// Resource properties.
	Properties *ServerOperationProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServerOperation - A server operation.

type ServerOperationListResult

type ServerOperationListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ServerOperation `json:"value,omitempty" azure:"ro"`
}

ServerOperationListResult - The response to a list server operations request

func (ServerOperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerOperationListResult.

type ServerOperationProperties

type ServerOperationProperties struct {
	// READ-ONLY; The operation description.
	Description *string `json:"description,omitempty" azure:"ro"`

	// READ-ONLY; The operation error code.
	ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"`

	// READ-ONLY; The operation error description.
	ErrorDescription *string `json:"errorDescription,omitempty" azure:"ro"`

	// READ-ONLY; The operation error severity.
	ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"`

	// READ-ONLY; The estimated completion time of the operation.
	EstimatedCompletionTime *time.Time `json:"estimatedCompletionTime,omitempty" azure:"ro"`

	// READ-ONLY; Whether the operation can be cancelled.
	IsCancellable *bool `json:"isCancellable,omitempty" azure:"ro"`

	// READ-ONLY; Whether or not the error is a user error.
	IsUserError *bool `json:"isUserError,omitempty" azure:"ro"`

	// READ-ONLY; The name of operation.
	Operation *string `json:"operation,omitempty" azure:"ro"`

	// READ-ONLY; The friendly name of operation.
	OperationFriendlyName *string `json:"operationFriendlyName,omitempty" azure:"ro"`

	// READ-ONLY; The percentage of the operation completed.
	PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"`

	// READ-ONLY; The name of the server.
	ServerName *string `json:"serverName,omitempty" azure:"ro"`

	// READ-ONLY; The operation start time.
	StartTime *time.Time `json:"startTime,omitempty" azure:"ro"`

	// READ-ONLY; The operation state.
	State *ManagementOperationState `json:"state,omitempty" azure:"ro"`
}

ServerOperationProperties - The properties of a server operation.

func (ServerOperationProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerOperationProperties.

func (*ServerOperationProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerOperationProperties.

type ServerOperationsClient

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

ServerOperationsClient contains the methods for the ServerOperations group. Don't use this type directly, use NewServerOperationsClient() instead.

func NewServerOperationsClient

func NewServerOperationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerOperationsClient

NewServerOperationsClient creates a new instance of ServerOperationsClient with the specified values. subscriptionID - The 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 (*ServerOperationsClient) ListByServer

func (client *ServerOperationsClient) ListByServer(resourceGroupName string, serverName string, options *ServerOperationsClientListByServerOptions) *ServerOperationsClientListByServerPager

ListByServer - Gets a list of operations performed on the server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServerOperationsClientListByServerOptions contains the optional parameters for the ServerOperationsClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListServerOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerOperationsClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ServerOperationsClientListByServerOptions added in v0.3.0

type ServerOperationsClientListByServerOptions struct {
}

ServerOperationsClientListByServerOptions contains the optional parameters for the ServerOperationsClient.ListByServer method.

type ServerOperationsClientListByServerPager added in v0.3.0

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

ServerOperationsClientListByServerPager provides operations for iterating over paged responses.

func (*ServerOperationsClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ServerOperationsClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServerOperationsClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current ServerOperationsClientListByServerResponse page.

type ServerOperationsClientListByServerResponse added in v0.3.0

type ServerOperationsClientListByServerResponse struct {
	ServerOperationsClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerOperationsClientListByServerResponse contains the response from method ServerOperationsClient.ListByServer.

type ServerOperationsClientListByServerResult added in v0.3.0

type ServerOperationsClientListByServerResult struct {
	ServerOperationListResult
}

ServerOperationsClientListByServerResult contains the result from method ServerOperationsClient.ListByServer.

type ServerPrivateEndpointConnection

type ServerPrivateEndpointConnection struct {
	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Private endpoint connection properties
	Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty" azure:"ro"`
}

ServerPrivateEndpointConnection - A private endpoint connection under a server

type ServerProperties

type ServerProperties struct {
	// Administrator username for the server. Once created it cannot be changed.
	AdministratorLogin *string `json:"administratorLogin,omitempty"`

	// The administrator login password (required for server creation).
	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`

	// The Azure Active Directory identity of the server.
	Administrators *ServerExternalAdministrator `json:"administrators,omitempty"`

	// The Client id used for cross tenant CMK scenario
	FederatedClientID *string `json:"federatedClientId,omitempty"`

	// A CMK URI of the key to use for encryption.
	KeyID *string `json:"keyId,omitempty"`

	// Minimal TLS version. Allowed values: '1.0', '1.1', '1.2'
	MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"`

	// The resource id of a user assigned identity to be used by default.
	PrimaryUserAssignedIdentityID *string `json:"primaryUserAssignedIdentityId,omitempty"`

	// Whether or not public endpoint access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	PublicNetworkAccess *ServerNetworkAccessFlag `json:"publicNetworkAccess,omitempty"`

	// Whether or not to restrict outbound network access for this server. Value is optional but if passed in, must be 'Enabled'
	// or 'Disabled'
	RestrictOutboundNetworkAccess *ServerNetworkAccessFlag `json:"restrictOutboundNetworkAccess,omitempty"`

	// The version of the server.
	Version *string `json:"version,omitempty"`

	// READ-ONLY; The fully qualified domain name of the server.
	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty" azure:"ro"`

	// READ-ONLY; List of private endpoint connections on a server
	PrivateEndpointConnections []*ServerPrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"`

	// READ-ONLY; The state of the server.
	State *string `json:"state,omitempty" azure:"ro"`

	// READ-ONLY; Whether or not existing server has a workspace created and if it allows connection from workspace
	WorkspaceFeature *ServerWorkspaceFeature `json:"workspaceFeature,omitempty" azure:"ro"`
}

ServerProperties - The properties of a server.

func (ServerProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerProperties.

type ServerSecurityAlertPoliciesClient

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

ServerSecurityAlertPoliciesClient contains the methods for the ServerSecurityAlertPolicies group. Don't use this type directly, use NewServerSecurityAlertPoliciesClient() instead.

func NewServerSecurityAlertPoliciesClient

func NewServerSecurityAlertPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerSecurityAlertPoliciesClient

NewServerSecurityAlertPoliciesClient creates a new instance of ServerSecurityAlertPoliciesClient with the specified values. subscriptionID - The 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 (*ServerSecurityAlertPoliciesClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates a threat detection policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. securityAlertPolicyName - The name of the threat detection policy. parameters - The server security alert policy. options - ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsCreateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerSecurityAlertPoliciesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.SecurityAlertPolicyName("Default"),
		armsql.ServerSecurityAlertPolicy{
			Properties: &armsql.SecurityAlertsPolicyProperties{
				DisabledAlerts: []*string{
					to.StringPtr("Access_Anomaly"),
					to.StringPtr("Usage_Anomaly")},
				EmailAccountAdmins: to.BoolPtr(true),
				EmailAddresses: []*string{
					to.StringPtr("testSecurityAlert@microsoft.com")},
				RetentionDays:           to.Int32Ptr(5),
				State:                   armsql.SecurityAlertsPolicyStateEnabled.ToPtr(),
				StorageAccountAccessKey: to.StringPtr("<storage-account-access-key>"),
				StorageEndpoint:         to.StringPtr("<storage-endpoint>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerSecurityAlertPoliciesClientCreateOrUpdateResult)
}
Output:

func (*ServerSecurityAlertPoliciesClient) Get

Get - Get a server's security alert policy. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. securityAlertPolicyName - The name of the security alert policy. options - ServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerSecurityAlertPoliciesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.SecurityAlertPolicyName("Default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerSecurityAlertPoliciesClientGetResult)
}
Output:

func (*ServerSecurityAlertPoliciesClient) ListByServer

ListByServer - Get the server's threat detection policies. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServerSecurityAlertPoliciesClientListByServerOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerSecurityAlertPoliciesClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions added in v0.3.0

type ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions struct {
}

ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate method.

type ServerSecurityAlertPoliciesClientCreateOrUpdatePoller added in v0.3.0

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

ServerSecurityAlertPoliciesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerSecurityAlertPoliciesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerSecurityAlertPoliciesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerSecurityAlertPoliciesClientCreateOrUpdateResponse will be returned.

func (*ServerSecurityAlertPoliciesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerSecurityAlertPoliciesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerSecurityAlertPoliciesClientCreateOrUpdatePollerResponse added in v0.3.0

type ServerSecurityAlertPoliciesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerSecurityAlertPoliciesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerSecurityAlertPoliciesClientCreateOrUpdatePollerResponse contains the response from method ServerSecurityAlertPoliciesClient.CreateOrUpdate.

func (ServerSecurityAlertPoliciesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerSecurityAlertPoliciesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerSecurityAlertPoliciesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ServerSecurityAlertPoliciesClientCreateOrUpdateResponse added in v0.3.0

type ServerSecurityAlertPoliciesClientCreateOrUpdateResponse struct {
	ServerSecurityAlertPoliciesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method ServerSecurityAlertPoliciesClient.CreateOrUpdate.

type ServerSecurityAlertPoliciesClientCreateOrUpdateResult added in v0.3.0

type ServerSecurityAlertPoliciesClientCreateOrUpdateResult struct {
	ServerSecurityAlertPolicy
}

ServerSecurityAlertPoliciesClientCreateOrUpdateResult contains the result from method ServerSecurityAlertPoliciesClient.CreateOrUpdate.

type ServerSecurityAlertPoliciesClientGetOptions added in v0.3.0

type ServerSecurityAlertPoliciesClientGetOptions struct {
}

ServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.Get method.

type ServerSecurityAlertPoliciesClientGetResponse added in v0.3.0

type ServerSecurityAlertPoliciesClientGetResponse struct {
	ServerSecurityAlertPoliciesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerSecurityAlertPoliciesClientGetResponse contains the response from method ServerSecurityAlertPoliciesClient.Get.

type ServerSecurityAlertPoliciesClientGetResult added in v0.3.0

type ServerSecurityAlertPoliciesClientGetResult struct {
	ServerSecurityAlertPolicy
}

ServerSecurityAlertPoliciesClientGetResult contains the result from method ServerSecurityAlertPoliciesClient.Get.

type ServerSecurityAlertPoliciesClientListByServerOptions added in v0.3.0

type ServerSecurityAlertPoliciesClientListByServerOptions struct {
}

ServerSecurityAlertPoliciesClientListByServerOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.ListByServer method.

type ServerSecurityAlertPoliciesClientListByServerPager added in v0.3.0

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

ServerSecurityAlertPoliciesClientListByServerPager provides operations for iterating over paged responses.

func (*ServerSecurityAlertPoliciesClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ServerSecurityAlertPoliciesClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServerSecurityAlertPoliciesClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current ServerSecurityAlertPoliciesClientListByServerResponse page.

type ServerSecurityAlertPoliciesClientListByServerResponse added in v0.3.0

type ServerSecurityAlertPoliciesClientListByServerResponse struct {
	ServerSecurityAlertPoliciesClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerSecurityAlertPoliciesClientListByServerResponse contains the response from method ServerSecurityAlertPoliciesClient.ListByServer.

type ServerSecurityAlertPoliciesClientListByServerResult added in v0.3.0

type ServerSecurityAlertPoliciesClientListByServerResult struct {
	LogicalServerSecurityAlertPolicyListResult
}

ServerSecurityAlertPoliciesClientListByServerResult contains the result from method ServerSecurityAlertPoliciesClient.ListByServer.

type ServerSecurityAlertPolicy

type ServerSecurityAlertPolicy struct {
	// Resource properties.
	Properties *SecurityAlertsPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; SystemData of SecurityAlertPolicyResource.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServerSecurityAlertPolicy - A server security alert policy.

type ServerTrustGroup

type ServerTrustGroup struct {
	// Resource properties.
	Properties *ServerTrustGroupProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServerTrustGroup - A server trust group.

type ServerTrustGroupListResult

type ServerTrustGroupListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ServerTrustGroup `json:"value,omitempty" azure:"ro"`
}

ServerTrustGroupListResult - A list of server trust groups.

func (ServerTrustGroupListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerTrustGroupListResult.

type ServerTrustGroupProperties

type ServerTrustGroupProperties struct {
	// REQUIRED; Group members information for the server trust group.
	GroupMembers []*ServerInfo `json:"groupMembers,omitempty"`

	// REQUIRED; Trust scope of the server trust group.
	TrustScopes []*ServerTrustGroupPropertiesTrustScopesItem `json:"trustScopes,omitempty"`
}

ServerTrustGroupProperties - Properties of a server trust group.

func (ServerTrustGroupProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerTrustGroupProperties.

type ServerTrustGroupPropertiesTrustScopesItem

type ServerTrustGroupPropertiesTrustScopesItem string
const (
	ServerTrustGroupPropertiesTrustScopesItemGlobalTransactions ServerTrustGroupPropertiesTrustScopesItem = "GlobalTransactions"
	ServerTrustGroupPropertiesTrustScopesItemServiceBroker      ServerTrustGroupPropertiesTrustScopesItem = "ServiceBroker"
)

func PossibleServerTrustGroupPropertiesTrustScopesItemValues

func PossibleServerTrustGroupPropertiesTrustScopesItemValues() []ServerTrustGroupPropertiesTrustScopesItem

PossibleServerTrustGroupPropertiesTrustScopesItemValues returns the possible values for the ServerTrustGroupPropertiesTrustScopesItem const type.

func (ServerTrustGroupPropertiesTrustScopesItem) ToPtr

ToPtr returns a *ServerTrustGroupPropertiesTrustScopesItem pointing to the current value.

type ServerTrustGroupsClient

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

ServerTrustGroupsClient contains the methods for the ServerTrustGroups group. Don't use this type directly, use NewServerTrustGroupsClient() instead.

func NewServerTrustGroupsClient

func NewServerTrustGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerTrustGroupsClient

NewServerTrustGroupsClient creates a new instance of ServerTrustGroupsClient with the specified values. subscriptionID - The 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 (*ServerTrustGroupsClient) BeginCreateOrUpdate

func (client *ServerTrustGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, locationName string, serverTrustGroupName string, parameters ServerTrustGroup, options *ServerTrustGroupsClientBeginCreateOrUpdateOptions) (ServerTrustGroupsClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates a server trust group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The name of the region where the resource is located. serverTrustGroupName - The name of the server trust group. parameters - The server trust group parameters. options - ServerTrustGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerTrustGroupsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupCreate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerTrustGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<location-name>",
		"<server-trust-group-name>",
		armsql.ServerTrustGroup{
			Properties: &armsql.ServerTrustGroupProperties{
				GroupMembers: []*armsql.ServerInfo{
					{
						ServerID: to.StringPtr("<server-id>"),
					},
					{
						ServerID: to.StringPtr("<server-id>"),
					}},
				TrustScopes: []*armsql.ServerTrustGroupPropertiesTrustScopesItem{
					armsql.ServerTrustGroupPropertiesTrustScopesItem("GlobalTransactions").ToPtr(),
					armsql.ServerTrustGroupPropertiesTrustScopesItem("ServiceBroker").ToPtr()},
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerTrustGroupsClientCreateOrUpdateResult)
}
Output:

func (*ServerTrustGroupsClient) BeginDelete

func (client *ServerTrustGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, locationName string, serverTrustGroupName string, options *ServerTrustGroupsClientBeginDeleteOptions) (ServerTrustGroupsClientDeletePollerResponse, error)

BeginDelete - Deletes a server trust group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The name of the region where the resource is located. serverTrustGroupName - The name of the server trust group. options - ServerTrustGroupsClientBeginDeleteOptions contains the optional parameters for the ServerTrustGroupsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerTrustGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<location-name>",
		"<server-trust-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ServerTrustGroupsClient) Get

func (client *ServerTrustGroupsClient) Get(ctx context.Context, resourceGroupName string, locationName string, serverTrustGroupName string, options *ServerTrustGroupsClientGetOptions) (ServerTrustGroupsClientGetResponse, error)

Get - Gets a server trust group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The name of the region where the resource is located. serverTrustGroupName - The name of the server trust group. options - ServerTrustGroupsClientGetOptions contains the optional parameters for the ServerTrustGroupsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerTrustGroupsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<location-name>",
		"<server-trust-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerTrustGroupsClientGetResult)
}
Output:

func (*ServerTrustGroupsClient) ListByInstance

func (client *ServerTrustGroupsClient) ListByInstance(resourceGroupName string, managedInstanceName string, options *ServerTrustGroupsClientListByInstanceOptions) *ServerTrustGroupsClientListByInstancePager

ListByInstance - Gets a server trust groups by instance name. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. managedInstanceName - The name of the managed instance. options - ServerTrustGroupsClientListByInstanceOptions contains the optional parameters for the ServerTrustGroupsClient.ListByInstance method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupListByManagedInstance.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerTrustGroupsClient("<subscription-id>", cred, nil)
	pager := client.ListByInstance("<resource-group-name>",
		"<managed-instance-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*ServerTrustGroupsClient) ListByLocation

ListByLocation - Lists a server trust group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. locationName - The name of the region where the resource is located. options - ServerTrustGroupsClientListByLocationOptions contains the optional parameters for the ServerTrustGroupsClient.ListByLocation method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerTrustGroupsClient("<subscription-id>", cred, nil)
	pager := client.ListByLocation("<resource-group-name>",
		"<location-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ServerTrustGroupsClientBeginCreateOrUpdateOptions added in v0.3.0

type ServerTrustGroupsClientBeginCreateOrUpdateOptions struct {
}

ServerTrustGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerTrustGroupsClient.BeginCreateOrUpdate method.

type ServerTrustGroupsClientBeginDeleteOptions added in v0.3.0

type ServerTrustGroupsClientBeginDeleteOptions struct {
}

ServerTrustGroupsClientBeginDeleteOptions contains the optional parameters for the ServerTrustGroupsClient.BeginDelete method.

type ServerTrustGroupsClientCreateOrUpdatePoller added in v0.3.0

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

ServerTrustGroupsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerTrustGroupsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerTrustGroupsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerTrustGroupsClientCreateOrUpdateResponse will be returned.

func (*ServerTrustGroupsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerTrustGroupsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerTrustGroupsClientCreateOrUpdatePollerResponse added in v0.3.0

type ServerTrustGroupsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerTrustGroupsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerTrustGroupsClientCreateOrUpdatePollerResponse contains the response from method ServerTrustGroupsClient.CreateOrUpdate.

func (ServerTrustGroupsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerTrustGroupsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerTrustGroupsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ServerTrustGroupsClientCreateOrUpdateResponse added in v0.3.0

type ServerTrustGroupsClientCreateOrUpdateResponse struct {
	ServerTrustGroupsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerTrustGroupsClientCreateOrUpdateResponse contains the response from method ServerTrustGroupsClient.CreateOrUpdate.

type ServerTrustGroupsClientCreateOrUpdateResult added in v0.3.0

type ServerTrustGroupsClientCreateOrUpdateResult struct {
	ServerTrustGroup
}

ServerTrustGroupsClientCreateOrUpdateResult contains the result from method ServerTrustGroupsClient.CreateOrUpdate.

type ServerTrustGroupsClientDeletePoller added in v0.3.0

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

ServerTrustGroupsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*ServerTrustGroupsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServerTrustGroupsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServerTrustGroupsClientDeleteResponse will be returned.

func (*ServerTrustGroupsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServerTrustGroupsClientDeletePoller) ResumeToken added in v0.3.0

func (p *ServerTrustGroupsClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServerTrustGroupsClientDeletePollerResponse added in v0.3.0

type ServerTrustGroupsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServerTrustGroupsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerTrustGroupsClientDeletePollerResponse contains the response from method ServerTrustGroupsClient.Delete.

func (ServerTrustGroupsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServerTrustGroupsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServerTrustGroupsClientDeletePollerResponse from the provided client and resume token.

type ServerTrustGroupsClientDeleteResponse added in v0.3.0

type ServerTrustGroupsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerTrustGroupsClientDeleteResponse contains the response from method ServerTrustGroupsClient.Delete.

type ServerTrustGroupsClientGetOptions added in v0.3.0

type ServerTrustGroupsClientGetOptions struct {
}

ServerTrustGroupsClientGetOptions contains the optional parameters for the ServerTrustGroupsClient.Get method.

type ServerTrustGroupsClientGetResponse added in v0.3.0

type ServerTrustGroupsClientGetResponse struct {
	ServerTrustGroupsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerTrustGroupsClientGetResponse contains the response from method ServerTrustGroupsClient.Get.

type ServerTrustGroupsClientGetResult added in v0.3.0

type ServerTrustGroupsClientGetResult struct {
	ServerTrustGroup
}

ServerTrustGroupsClientGetResult contains the result from method ServerTrustGroupsClient.Get.

type ServerTrustGroupsClientListByInstanceOptions added in v0.3.0

type ServerTrustGroupsClientListByInstanceOptions struct {
}

ServerTrustGroupsClientListByInstanceOptions contains the optional parameters for the ServerTrustGroupsClient.ListByInstance method.

type ServerTrustGroupsClientListByInstancePager added in v0.3.0

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

ServerTrustGroupsClientListByInstancePager provides operations for iterating over paged responses.

func (*ServerTrustGroupsClientListByInstancePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ServerTrustGroupsClientListByInstancePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServerTrustGroupsClientListByInstancePager) PageResponse added in v0.3.0

PageResponse returns the current ServerTrustGroupsClientListByInstanceResponse page.

type ServerTrustGroupsClientListByInstanceResponse added in v0.3.0

type ServerTrustGroupsClientListByInstanceResponse struct {
	ServerTrustGroupsClientListByInstanceResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerTrustGroupsClientListByInstanceResponse contains the response from method ServerTrustGroupsClient.ListByInstance.

type ServerTrustGroupsClientListByInstanceResult added in v0.3.0

type ServerTrustGroupsClientListByInstanceResult struct {
	ServerTrustGroupListResult
}

ServerTrustGroupsClientListByInstanceResult contains the result from method ServerTrustGroupsClient.ListByInstance.

type ServerTrustGroupsClientListByLocationOptions added in v0.3.0

type ServerTrustGroupsClientListByLocationOptions struct {
}

ServerTrustGroupsClientListByLocationOptions contains the optional parameters for the ServerTrustGroupsClient.ListByLocation method.

type ServerTrustGroupsClientListByLocationPager added in v0.3.0

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

ServerTrustGroupsClientListByLocationPager provides operations for iterating over paged responses.

func (*ServerTrustGroupsClientListByLocationPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ServerTrustGroupsClientListByLocationPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServerTrustGroupsClientListByLocationPager) PageResponse added in v0.3.0

PageResponse returns the current ServerTrustGroupsClientListByLocationResponse page.

type ServerTrustGroupsClientListByLocationResponse added in v0.3.0

type ServerTrustGroupsClientListByLocationResponse struct {
	ServerTrustGroupsClientListByLocationResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerTrustGroupsClientListByLocationResponse contains the response from method ServerTrustGroupsClient.ListByLocation.

type ServerTrustGroupsClientListByLocationResult added in v0.3.0

type ServerTrustGroupsClientListByLocationResult struct {
	ServerTrustGroupListResult
}

ServerTrustGroupsClientListByLocationResult contains the result from method ServerTrustGroupsClient.ListByLocation.

type ServerUpdate

type ServerUpdate struct {
	// Server identity
	Identity *ResourceIdentity `json:"identity,omitempty"`

	// Resource properties.
	Properties *ServerProperties `json:"properties,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`
}

ServerUpdate - An update request for an Azure SQL Database server.

func (ServerUpdate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerUpdate.

type ServerUsage

type ServerUsage struct {
	// READ-ONLY; The current value of the metric.
	CurrentValue *float64 `json:"currentValue,omitempty" azure:"ro"`

	// READ-ONLY; The metric display name.
	DisplayName *string `json:"displayName,omitempty" azure:"ro"`

	// READ-ONLY; The current limit of the metric.
	Limit *float64 `json:"limit,omitempty" azure:"ro"`

	// READ-ONLY; Name of the server usage metric.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The next reset time for the metric (ISO8601 format).
	NextResetTime *time.Time `json:"nextResetTime,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource.
	ResourceName *string `json:"resourceName,omitempty" azure:"ro"`

	// READ-ONLY; The units of the metric.
	Unit *string `json:"unit,omitempty" azure:"ro"`
}

ServerUsage - Represents server metrics.

func (ServerUsage) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerUsage.

func (*ServerUsage) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServerUsage.

type ServerUsageListResult

type ServerUsageListResult struct {
	// REQUIRED; The list of server metrics for the server.
	Value []*ServerUsage `json:"value,omitempty"`
}

ServerUsageListResult - Represents the response to a list server metrics request.

func (ServerUsageListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerUsageListResult.

type ServerUsagesClient

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

ServerUsagesClient contains the methods for the ServerUsages group. Don't use this type directly, use NewServerUsagesClient() instead.

func NewServerUsagesClient

func NewServerUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerUsagesClient

NewServerUsagesClient creates a new instance of ServerUsagesClient with the specified values. subscriptionID - The 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 (*ServerUsagesClient) ListByServer

func (client *ServerUsagesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string, options *ServerUsagesClientListByServerOptions) (ServerUsagesClientListByServerResponse, error)

ListByServer - Returns server usages. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServerUsagesClientListByServerOptions contains the optional parameters for the ServerUsagesClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ServerUsageMetricsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerUsagesClient("<subscription-id>", cred, nil)
	res, err := client.ListByServer(ctx,
		"<resource-group-name>",
		"<server-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerUsagesClientListByServerResult)
}
Output:

type ServerUsagesClientListByServerOptions added in v0.3.0

type ServerUsagesClientListByServerOptions struct {
}

ServerUsagesClientListByServerOptions contains the optional parameters for the ServerUsagesClient.ListByServer method.

type ServerUsagesClientListByServerResponse added in v0.3.0

type ServerUsagesClientListByServerResponse struct {
	ServerUsagesClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerUsagesClientListByServerResponse contains the response from method ServerUsagesClient.ListByServer.

type ServerUsagesClientListByServerResult added in v0.3.0

type ServerUsagesClientListByServerResult struct {
	ServerUsageListResult
}

ServerUsagesClientListByServerResult contains the result from method ServerUsagesClient.ListByServer.

type ServerVersionCapability

type ServerVersionCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; The server version name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; The list of supported database editions.
	SupportedEditions []*EditionCapability `json:"supportedEditions,omitempty" azure:"ro"`

	// READ-ONLY; The list of supported elastic pool editions.
	SupportedElasticPoolEditions []*ElasticPoolEditionCapability `json:"supportedElasticPoolEditions,omitempty" azure:"ro"`
}

ServerVersionCapability - The server capability

func (ServerVersionCapability) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerVersionCapability.

type ServerVulnerabilityAssessment

type ServerVulnerabilityAssessment struct {
	// Resource properties.
	Properties *ServerVulnerabilityAssessmentProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServerVulnerabilityAssessment - A server vulnerability assessment.

type ServerVulnerabilityAssessmentListResult

type ServerVulnerabilityAssessmentListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*ServerVulnerabilityAssessment `json:"value,omitempty" azure:"ro"`
}

ServerVulnerabilityAssessmentListResult - A list of the server's vulnerability assessments.

func (ServerVulnerabilityAssessmentListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessmentListResult.

type ServerVulnerabilityAssessmentProperties

type ServerVulnerabilityAssessmentProperties struct {
	// REQUIRED; A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
	StorageContainerPath *string `json:"storageContainerPath,omitempty"`

	// The recurring scans settings
	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`

	// Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey'
	// isn't specified, storageAccountAccessKey is required. Applies only if the
	// storage account is not behind a Vnet or a firewall
	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`

	// A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter.
	// If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is
	// required. Applies only if the storage account is not behind a Vnet or a firewall
	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
}

ServerVulnerabilityAssessmentProperties - Properties of a server Vulnerability Assessment.

type ServerVulnerabilityAssessmentsClient

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

ServerVulnerabilityAssessmentsClient contains the methods for the ServerVulnerabilityAssessments group. Don't use this type directly, use NewServerVulnerabilityAssessmentsClient() instead.

func NewServerVulnerabilityAssessmentsClient

func NewServerVulnerabilityAssessmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerVulnerabilityAssessmentsClient

NewServerVulnerabilityAssessmentsClient creates a new instance of ServerVulnerabilityAssessmentsClient with the specified values. subscriptionID - The 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 (*ServerVulnerabilityAssessmentsClient) CreateOrUpdate

CreateOrUpdate - Creates or updates the server's vulnerability assessment. Learn more about setting SQL vulnerability assessment with managed identity - https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server for which the vulnerability assessment is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. parameters - The requested resource. options - ServerVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.VulnerabilityAssessmentName("default"),
		armsql.ServerVulnerabilityAssessment{
			Properties: &armsql.ServerVulnerabilityAssessmentProperties{
				RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{
					EmailSubscriptionAdmins: to.BoolPtr(true),
					Emails: []*string{
						to.StringPtr("email1@mail.com"),
						to.StringPtr("email2@mail.com")},
					IsEnabled: to.BoolPtr(true),
				},
				StorageAccountAccessKey: to.StringPtr("<storage-account-access-key>"),
				StorageContainerPath:    to.StringPtr("<storage-container-path>"),
				StorageContainerSasKey:  to.StringPtr("<storage-container-sas-key>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerVulnerabilityAssessmentsClientCreateOrUpdateResult)
}
Output:

func (*ServerVulnerabilityAssessmentsClient) Delete

Delete - Removes the server's vulnerability assessment. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server for which the vulnerability assessment is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. options - ServerVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.Delete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	_, err = client.Delete(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.VulnerabilityAssessmentName("default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ServerVulnerabilityAssessmentsClient) Get

Get - Gets the server's vulnerability assessment. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server for which the vulnerability assessment is defined. vulnerabilityAssessmentName - The name of the vulnerability assessment. options - ServerVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.VulnerabilityAssessmentName("default"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServerVulnerabilityAssessmentsClientGetResult)
}
Output:

func (*ServerVulnerabilityAssessmentsClient) ListByServer

ListByServer - Lists the vulnerability assessment policies associated with a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServerVulnerabilityAssessmentsClientListByServerOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServerVulnerabilityAssessmentsClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ServerVulnerabilityAssessmentsClientCreateOrUpdateOptions added in v0.3.0

type ServerVulnerabilityAssessmentsClientCreateOrUpdateOptions struct {
}

ServerVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.CreateOrUpdate method.

type ServerVulnerabilityAssessmentsClientCreateOrUpdateResponse added in v0.3.0

type ServerVulnerabilityAssessmentsClientCreateOrUpdateResponse struct {
	ServerVulnerabilityAssessmentsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerVulnerabilityAssessmentsClientCreateOrUpdateResponse contains the response from method ServerVulnerabilityAssessmentsClient.CreateOrUpdate.

type ServerVulnerabilityAssessmentsClientCreateOrUpdateResult added in v0.3.0

type ServerVulnerabilityAssessmentsClientCreateOrUpdateResult struct {
	ServerVulnerabilityAssessment
}

ServerVulnerabilityAssessmentsClientCreateOrUpdateResult contains the result from method ServerVulnerabilityAssessmentsClient.CreateOrUpdate.

type ServerVulnerabilityAssessmentsClientDeleteOptions added in v0.3.0

type ServerVulnerabilityAssessmentsClientDeleteOptions struct {
}

ServerVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.Delete method.

type ServerVulnerabilityAssessmentsClientDeleteResponse added in v0.3.0

type ServerVulnerabilityAssessmentsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerVulnerabilityAssessmentsClientDeleteResponse contains the response from method ServerVulnerabilityAssessmentsClient.Delete.

type ServerVulnerabilityAssessmentsClientGetOptions added in v0.3.0

type ServerVulnerabilityAssessmentsClientGetOptions struct {
}

ServerVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.Get method.

type ServerVulnerabilityAssessmentsClientGetResponse added in v0.3.0

type ServerVulnerabilityAssessmentsClientGetResponse struct {
	ServerVulnerabilityAssessmentsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerVulnerabilityAssessmentsClientGetResponse contains the response from method ServerVulnerabilityAssessmentsClient.Get.

type ServerVulnerabilityAssessmentsClientGetResult added in v0.3.0

type ServerVulnerabilityAssessmentsClientGetResult struct {
	ServerVulnerabilityAssessment
}

ServerVulnerabilityAssessmentsClientGetResult contains the result from method ServerVulnerabilityAssessmentsClient.Get.

type ServerVulnerabilityAssessmentsClientListByServerOptions added in v0.3.0

type ServerVulnerabilityAssessmentsClientListByServerOptions struct {
}

ServerVulnerabilityAssessmentsClientListByServerOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.ListByServer method.

type ServerVulnerabilityAssessmentsClientListByServerPager added in v0.3.0

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

ServerVulnerabilityAssessmentsClientListByServerPager provides operations for iterating over paged responses.

func (*ServerVulnerabilityAssessmentsClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ServerVulnerabilityAssessmentsClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServerVulnerabilityAssessmentsClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current ServerVulnerabilityAssessmentsClientListByServerResponse page.

type ServerVulnerabilityAssessmentsClientListByServerResponse added in v0.3.0

type ServerVulnerabilityAssessmentsClientListByServerResponse struct {
	ServerVulnerabilityAssessmentsClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServerVulnerabilityAssessmentsClientListByServerResponse contains the response from method ServerVulnerabilityAssessmentsClient.ListByServer.

type ServerVulnerabilityAssessmentsClientListByServerResult added in v0.3.0

type ServerVulnerabilityAssessmentsClientListByServerResult struct {
	ServerVulnerabilityAssessmentListResult
}

ServerVulnerabilityAssessmentsClientListByServerResult contains the result from method ServerVulnerabilityAssessmentsClient.ListByServer.

type ServerWorkspaceFeature

type ServerWorkspaceFeature string

ServerWorkspaceFeature - Whether or not existing server has a workspace created and if it allows connection from workspace

const (
	ServerWorkspaceFeatureConnected    ServerWorkspaceFeature = "Connected"
	ServerWorkspaceFeatureDisconnected ServerWorkspaceFeature = "Disconnected"
)

func PossibleServerWorkspaceFeatureValues

func PossibleServerWorkspaceFeatureValues() []ServerWorkspaceFeature

PossibleServerWorkspaceFeatureValues returns the possible values for the ServerWorkspaceFeature const type.

func (ServerWorkspaceFeature) ToPtr

ToPtr returns a *ServerWorkspaceFeature pointing to the current value.

type ServersClient

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

ServersClient contains the methods for the Servers group. Don't use this type directly, use NewServersClient() instead.

func NewServersClient

func NewServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServersClient

NewServersClient creates a new instance of ServersClient with the specified values. subscriptionID - The 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 (*ServersClient) BeginCreateOrUpdate

func (client *ServersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters Server, options *ServersClientBeginCreateOrUpdateOptions) (ServersClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. parameters - The requested server resource state. options - ServersClientBeginCreateOrUpdateOptions contains the optional parameters for the ServersClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerCreate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServersClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.Server{
			Location: to.StringPtr("<location>"),
			Properties: &armsql.ServerProperties{
				AdministratorLogin:         to.StringPtr("<administrator-login>"),
				AdministratorLoginPassword: to.StringPtr("<administrator-login-password>"),
				Administrators: &armsql.ServerExternalAdministrator{
					AzureADOnlyAuthentication: to.BoolPtr(true),
					Login:                     to.StringPtr("<login>"),
					PrincipalType:             armsql.PrincipalType("User").ToPtr(),
					Sid:                       to.StringPtr("<sid>"),
					TenantID:                  to.StringPtr("<tenant-id>"),
				},
				PublicNetworkAccess:           armsql.ServerNetworkAccessFlag("Enabled").ToPtr(),
				RestrictOutboundNetworkAccess: armsql.ServerNetworkAccessFlag("Enabled").ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServersClientCreateOrUpdateResult)
}
Output:

func (*ServersClient) BeginDelete

func (client *ServersClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (ServersClientDeletePollerResponse, error)

BeginDelete - Deletes a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServersClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*ServersClient) BeginImportDatabase

func (client *ServersClient) BeginImportDatabase(ctx context.Context, resourceGroupName string, serverName string, parameters ImportNewDatabaseDefinition, options *ServersClientBeginImportDatabaseOptions) (ServersClientImportDatabasePollerResponse, error)

BeginImportDatabase - Imports a bacpac into a new database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. parameters - The database import request parameters. options - ServersClientBeginImportDatabaseOptions contains the optional parameters for the ServersClient.BeginImportDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ImportNewDatabaseWithNetworkIsolation.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServersClient("<subscription-id>", cred, nil)
	poller, err := client.BeginImportDatabase(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.ImportNewDatabaseDefinition{
			AdministratorLogin:         to.StringPtr("<administrator-login>"),
			AdministratorLoginPassword: to.StringPtr("<administrator-login-password>"),
			AuthenticationType:         to.StringPtr("<authentication-type>"),
			DatabaseName:               to.StringPtr("<database-name>"),
			NetworkIsolation: &armsql.NetworkIsolationSettings{
				SQLServerResourceID:      to.StringPtr("<sqlserver-resource-id>"),
				StorageAccountResourceID: to.StringPtr("<storage-account-resource-id>"),
			},
			StorageKey:     to.StringPtr("<storage-key>"),
			StorageKeyType: armsql.StorageKeyType("StorageAccessKey").ToPtr(),
			StorageURI:     to.StringPtr("<storage-uri>"),
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServersClientImportDatabaseResult)
}
Output:

func (*ServersClient) BeginUpdate

func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdate, options *ServersClientBeginUpdateOptions) (ServersClientUpdatePollerResponse, error)

BeginUpdate - Updates a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. parameters - The requested server resource state. options - ServersClientBeginUpdateOptions contains the optional parameters for the ServersClient.BeginUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServersClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.ServerUpdate{
			Properties: &armsql.ServerProperties{
				AdministratorLogin:            to.StringPtr("<administrator-login>"),
				AdministratorLoginPassword:    to.StringPtr("<administrator-login-password>"),
				PublicNetworkAccess:           armsql.ServerNetworkAccessFlag("Disabled").ToPtr(),
				RestrictOutboundNetworkAccess: armsql.ServerNetworkAccessFlag("Enabled").ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServersClientUpdateResult)
}
Output:

func (*ServersClient) CheckNameAvailability

CheckNameAvailability - Determines whether a resource can be created with the specified name. If the operation fails it returns an *azcore.ResponseError type. parameters - The name availability request parameters. options - ServersClientCheckNameAvailabilityOptions contains the optional parameters for the ServersClient.CheckNameAvailability method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CheckNameAvailabilityServerAlreadyExists.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServersClient("<subscription-id>", cred, nil)
	res, err := client.CheckNameAvailability(ctx,
		armsql.CheckNameAvailabilityRequest{
			Name: to.StringPtr("<name>"),
			Type: to.StringPtr("<type>"),
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServersClientCheckNameAvailabilityResult)
}
Output:

func (*ServersClient) Get

func (client *ServersClient) Get(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientGetOptions) (ServersClientGetResponse, error)

Get - Gets a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServersClientGetOptions contains the optional parameters for the ServersClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServersClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		&armsql.ServersClientGetOptions{Expand: nil})
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServersClientGetResult)
}
Output:

func (*ServersClient) List

List - Gets a list of all servers in the subscription. If the operation fails it returns an *azcore.ResponseError type. options - ServersClientListOptions contains the optional parameters for the ServersClient.List method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServersClient("<subscription-id>", cred, nil)
	pager := client.List(&armsql.ServersClientListOptions{Expand: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*ServersClient) ListByResourceGroup

func (client *ServersClient) ListByResourceGroup(resourceGroupName string, options *ServersClientListByResourceGroupOptions) *ServersClientListByResourceGroupPager

ListByResourceGroup - Gets a list of servers in a resource groups. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. options - ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.ListByResourceGroup method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServersClient("<subscription-id>", cred, nil)
	pager := client.ListByResourceGroup("<resource-group-name>",
		&armsql.ServersClientListByResourceGroupOptions{Expand: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type ServersClientBeginCreateOrUpdateOptions added in v0.3.0

type ServersClientBeginCreateOrUpdateOptions struct {
}

ServersClientBeginCreateOrUpdateOptions contains the optional parameters for the ServersClient.BeginCreateOrUpdate method.

type ServersClientBeginDeleteOptions added in v0.3.0

type ServersClientBeginDeleteOptions struct {
}

ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method.

type ServersClientBeginImportDatabaseOptions added in v0.3.0

type ServersClientBeginImportDatabaseOptions struct {
}

ServersClientBeginImportDatabaseOptions contains the optional parameters for the ServersClient.BeginImportDatabase method.

type ServersClientBeginUpdateOptions added in v0.3.0

type ServersClientBeginUpdateOptions struct {
}

ServersClientBeginUpdateOptions contains the optional parameters for the ServersClient.BeginUpdate method.

type ServersClientCheckNameAvailabilityOptions added in v0.3.0

type ServersClientCheckNameAvailabilityOptions struct {
}

ServersClientCheckNameAvailabilityOptions contains the optional parameters for the ServersClient.CheckNameAvailability method.

type ServersClientCheckNameAvailabilityResponse added in v0.3.0

type ServersClientCheckNameAvailabilityResponse struct {
	ServersClientCheckNameAvailabilityResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServersClientCheckNameAvailabilityResponse contains the response from method ServersClient.CheckNameAvailability.

type ServersClientCheckNameAvailabilityResult added in v0.3.0

type ServersClientCheckNameAvailabilityResult struct {
	CheckNameAvailabilityResponse
}

ServersClientCheckNameAvailabilityResult contains the result from method ServersClient.CheckNameAvailability.

type ServersClientCreateOrUpdatePoller added in v0.3.0

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

ServersClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ServersClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServersClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServersClientCreateOrUpdateResponse will be returned.

func (*ServersClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServersClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

func (p *ServersClientCreateOrUpdatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServersClientCreateOrUpdatePollerResponse added in v0.3.0

type ServersClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServersClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServersClientCreateOrUpdatePollerResponse contains the response from method ServersClient.CreateOrUpdate.

func (ServersClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServersClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServersClientCreateOrUpdatePollerResponse from the provided client and resume token.

type ServersClientCreateOrUpdateResponse added in v0.3.0

type ServersClientCreateOrUpdateResponse struct {
	ServersClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServersClientCreateOrUpdateResponse contains the response from method ServersClient.CreateOrUpdate.

type ServersClientCreateOrUpdateResult added in v0.3.0

type ServersClientCreateOrUpdateResult struct {
	Server
}

ServersClientCreateOrUpdateResult contains the result from method ServersClient.CreateOrUpdate.

type ServersClientDeletePoller added in v0.3.0

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

ServersClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*ServersClientDeletePoller) Done added in v0.3.0

func (p *ServersClientDeletePoller) Done() bool

Done returns true if the LRO has reached a terminal state.

func (*ServersClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServersClientDeleteResponse will be returned.

func (*ServersClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServersClientDeletePoller) ResumeToken added in v0.3.0

func (p *ServersClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServersClientDeletePollerResponse added in v0.3.0

type ServersClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServersClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServersClientDeletePollerResponse contains the response from method ServersClient.Delete.

func (ServersClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServersClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServersClientDeletePollerResponse from the provided client and resume token.

type ServersClientDeleteResponse added in v0.3.0

type ServersClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServersClientDeleteResponse contains the response from method ServersClient.Delete.

type ServersClientGetOptions added in v0.3.0

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

ServersClientGetOptions contains the optional parameters for the ServersClient.Get method.

type ServersClientGetResponse added in v0.3.0

type ServersClientGetResponse struct {
	ServersClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServersClientGetResponse contains the response from method ServersClient.Get.

type ServersClientGetResult added in v0.3.0

type ServersClientGetResult struct {
	Server
}

ServersClientGetResult contains the result from method ServersClient.Get.

type ServersClientImportDatabasePoller added in v0.3.0

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

ServersClientImportDatabasePoller provides polling facilities until the operation reaches a terminal state.

func (*ServersClientImportDatabasePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*ServersClientImportDatabasePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServersClientImportDatabaseResponse will be returned.

func (*ServersClientImportDatabasePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServersClientImportDatabasePoller) ResumeToken added in v0.3.0

func (p *ServersClientImportDatabasePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServersClientImportDatabasePollerResponse added in v0.3.0

type ServersClientImportDatabasePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServersClientImportDatabasePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServersClientImportDatabasePollerResponse contains the response from method ServersClient.ImportDatabase.

func (ServersClientImportDatabasePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServersClientImportDatabasePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServersClientImportDatabasePollerResponse from the provided client and resume token.

type ServersClientImportDatabaseResponse added in v0.3.0

type ServersClientImportDatabaseResponse struct {
	ServersClientImportDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServersClientImportDatabaseResponse contains the response from method ServersClient.ImportDatabase.

type ServersClientImportDatabaseResult added in v0.3.0

type ServersClientImportDatabaseResult struct {
	ImportExportOperationResult
}

ServersClientImportDatabaseResult contains the result from method ServersClient.ImportDatabase.

type ServersClientListByResourceGroupOptions added in v0.3.0

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

ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.ListByResourceGroup method.

type ServersClientListByResourceGroupPager added in v0.3.0

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

ServersClientListByResourceGroupPager provides operations for iterating over paged responses.

func (*ServersClientListByResourceGroupPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*ServersClientListByResourceGroupPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServersClientListByResourceGroupPager) PageResponse added in v0.3.0

PageResponse returns the current ServersClientListByResourceGroupResponse page.

type ServersClientListByResourceGroupResponse added in v0.3.0

type ServersClientListByResourceGroupResponse struct {
	ServersClientListByResourceGroupResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServersClientListByResourceGroupResponse contains the response from method ServersClient.ListByResourceGroup.

type ServersClientListByResourceGroupResult added in v0.3.0

type ServersClientListByResourceGroupResult struct {
	ServerListResult
}

ServersClientListByResourceGroupResult contains the result from method ServersClient.ListByResourceGroup.

type ServersClientListOptions added in v0.3.0

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

ServersClientListOptions contains the optional parameters for the ServersClient.List method.

type ServersClientListPager added in v0.3.0

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

ServersClientListPager provides operations for iterating over paged responses.

func (*ServersClientListPager) Err added in v0.3.0

func (p *ServersClientListPager) Err() error

Err returns the last error encountered while paging.

func (*ServersClientListPager) NextPage added in v0.3.0

func (p *ServersClientListPager) NextPage(ctx context.Context) bool

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*ServersClientListPager) PageResponse added in v0.3.0

PageResponse returns the current ServersClientListResponse page.

type ServersClientListResponse added in v0.3.0

type ServersClientListResponse struct {
	ServersClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServersClientListResponse contains the response from method ServersClient.List.

type ServersClientListResult added in v0.3.0

type ServersClientListResult struct {
	ServerListResult
}

ServersClientListResult contains the result from method ServersClient.List.

type ServersClientUpdatePoller added in v0.3.0

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

ServersClientUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*ServersClientUpdatePoller) Done added in v0.3.0

func (p *ServersClientUpdatePoller) Done() bool

Done returns true if the LRO has reached a terminal state.

func (*ServersClientUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final ServersClientUpdateResponse will be returned.

func (*ServersClientUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*ServersClientUpdatePoller) ResumeToken added in v0.3.0

func (p *ServersClientUpdatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type ServersClientUpdatePollerResponse added in v0.3.0

type ServersClientUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *ServersClientUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServersClientUpdatePollerResponse contains the response from method ServersClient.Update.

func (ServersClientUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*ServersClientUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a ServersClientUpdatePollerResponse from the provided client and resume token.

type ServersClientUpdateResponse added in v0.3.0

type ServersClientUpdateResponse struct {
	ServersClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServersClientUpdateResponse contains the response from method ServersClient.Update.

type ServersClientUpdateResult added in v0.3.0

type ServersClientUpdateResult struct {
	Server
}

ServersClientUpdateResult contains the result from method ServersClient.Update.

type ServiceObjective

type ServiceObjective struct {
	// Represents the properties of the resource.
	Properties *ServiceObjectiveProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ServiceObjective - Represents a database service objective.

type ServiceObjectiveCapability

type ServiceObjectiveCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; The compute model
	ComputeModel *string `json:"computeModel,omitempty" azure:"ro"`

	// READ-ONLY; The unique ID of the service objective.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The included (free) max size.
	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty" azure:"ro"`

	// READ-ONLY; The service objective name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The performance level.
	PerformanceLevel *PerformanceLevelCapability `json:"performanceLevel,omitempty" azure:"ro"`

	// READ-ONLY; The sku.
	SKU *SKU `json:"sku,omitempty" azure:"ro"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; Supported time range for auto pause delay
	SupportedAutoPauseDelay *AutoPauseDelayTimeRange `json:"supportedAutoPauseDelay,omitempty" azure:"ro"`

	// READ-ONLY; List of supported license types.
	SupportedLicenseTypes []*LicenseTypeCapability `json:"supportedLicenseTypes,omitempty" azure:"ro"`

	// READ-ONLY; List of supported maintenance configurations
	SupportedMaintenanceConfigurations []*MaintenanceConfigurationCapability `json:"supportedMaintenanceConfigurations,omitempty" azure:"ro"`

	// READ-ONLY; The list of supported maximum database sizes.
	SupportedMaxSizes []*MaxSizeRangeCapability `json:"supportedMaxSizes,omitempty" azure:"ro"`

	// READ-ONLY; List of supported min capacities
	SupportedMinCapacities []*MinCapacityCapability `json:"supportedMinCapacities,omitempty" azure:"ro"`

	// READ-ONLY; Whether or not zone redundancy is supported for the service objective.
	ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"`
}

ServiceObjectiveCapability - The service objectives capability.

func (ServiceObjectiveCapability) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServiceObjectiveCapability.

type ServiceObjectiveListResult

type ServiceObjectiveListResult struct {
	// REQUIRED; The list of database service objectives.
	Value []*ServiceObjective `json:"value,omitempty"`
}

ServiceObjectiveListResult - Represents the response to a get database service objectives request.

func (ServiceObjectiveListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServiceObjectiveListResult.

type ServiceObjectiveName

type ServiceObjectiveName string

ServiceObjectiveName - The serviceLevelObjective for SLO usage metric.

const (
	ServiceObjectiveNameBasic       ServiceObjectiveName = "Basic"
	ServiceObjectiveNameDS100       ServiceObjectiveName = "DS100"
	ServiceObjectiveNameDS1000      ServiceObjectiveName = "DS1000"
	ServiceObjectiveNameDS1200      ServiceObjectiveName = "DS1200"
	ServiceObjectiveNameDS1500      ServiceObjectiveName = "DS1500"
	ServiceObjectiveNameDS200       ServiceObjectiveName = "DS200"
	ServiceObjectiveNameDS2000      ServiceObjectiveName = "DS2000"
	ServiceObjectiveNameDS300       ServiceObjectiveName = "DS300"
	ServiceObjectiveNameDS400       ServiceObjectiveName = "DS400"
	ServiceObjectiveNameDS500       ServiceObjectiveName = "DS500"
	ServiceObjectiveNameDS600       ServiceObjectiveName = "DS600"
	ServiceObjectiveNameDW100       ServiceObjectiveName = "DW100"
	ServiceObjectiveNameDW1000      ServiceObjectiveName = "DW1000"
	ServiceObjectiveNameDW10000C    ServiceObjectiveName = "DW10000c"
	ServiceObjectiveNameDW1000C     ServiceObjectiveName = "DW1000c"
	ServiceObjectiveNameDW1200      ServiceObjectiveName = "DW1200"
	ServiceObjectiveNameDW1500      ServiceObjectiveName = "DW1500"
	ServiceObjectiveNameDW15000C    ServiceObjectiveName = "DW15000c"
	ServiceObjectiveNameDW1500C     ServiceObjectiveName = "DW1500c"
	ServiceObjectiveNameDW200       ServiceObjectiveName = "DW200"
	ServiceObjectiveNameDW2000      ServiceObjectiveName = "DW2000"
	ServiceObjectiveNameDW2000C     ServiceObjectiveName = "DW2000c"
	ServiceObjectiveNameDW2500C     ServiceObjectiveName = "DW2500c"
	ServiceObjectiveNameDW300       ServiceObjectiveName = "DW300"
	ServiceObjectiveNameDW3000      ServiceObjectiveName = "DW3000"
	ServiceObjectiveNameDW30000C    ServiceObjectiveName = "DW30000c"
	ServiceObjectiveNameDW3000C     ServiceObjectiveName = "DW3000c"
	ServiceObjectiveNameDW400       ServiceObjectiveName = "DW400"
	ServiceObjectiveNameDW500       ServiceObjectiveName = "DW500"
	ServiceObjectiveNameDW5000C     ServiceObjectiveName = "DW5000c"
	ServiceObjectiveNameDW600       ServiceObjectiveName = "DW600"
	ServiceObjectiveNameDW6000      ServiceObjectiveName = "DW6000"
	ServiceObjectiveNameDW6000C     ServiceObjectiveName = "DW6000c"
	ServiceObjectiveNameDW7500C     ServiceObjectiveName = "DW7500c"
	ServiceObjectiveNameElasticPool ServiceObjectiveName = "ElasticPool"
	ServiceObjectiveNameFree        ServiceObjectiveName = "Free"
	ServiceObjectiveNameP1          ServiceObjectiveName = "P1"
	ServiceObjectiveNameP11         ServiceObjectiveName = "P11"
	ServiceObjectiveNameP15         ServiceObjectiveName = "P15"
	ServiceObjectiveNameP2          ServiceObjectiveName = "P2"
	ServiceObjectiveNameP3          ServiceObjectiveName = "P3"
	ServiceObjectiveNameP4          ServiceObjectiveName = "P4"
	ServiceObjectiveNameP6          ServiceObjectiveName = "P6"
	ServiceObjectiveNamePRS1        ServiceObjectiveName = "PRS1"
	ServiceObjectiveNamePRS2        ServiceObjectiveName = "PRS2"
	ServiceObjectiveNamePRS4        ServiceObjectiveName = "PRS4"
	ServiceObjectiveNamePRS6        ServiceObjectiveName = "PRS6"
	ServiceObjectiveNameS0          ServiceObjectiveName = "S0"
	ServiceObjectiveNameS1          ServiceObjectiveName = "S1"
	ServiceObjectiveNameS12         ServiceObjectiveName = "S12"
	ServiceObjectiveNameS2          ServiceObjectiveName = "S2"
	ServiceObjectiveNameS3          ServiceObjectiveName = "S3"
	ServiceObjectiveNameS4          ServiceObjectiveName = "S4"
	ServiceObjectiveNameS6          ServiceObjectiveName = "S6"
	ServiceObjectiveNameS7          ServiceObjectiveName = "S7"
	ServiceObjectiveNameS9          ServiceObjectiveName = "S9"
	ServiceObjectiveNameSystem      ServiceObjectiveName = "System"
	ServiceObjectiveNameSystem0     ServiceObjectiveName = "System0"
	ServiceObjectiveNameSystem1     ServiceObjectiveName = "System1"
	ServiceObjectiveNameSystem2     ServiceObjectiveName = "System2"
	ServiceObjectiveNameSystem2L    ServiceObjectiveName = "System2L"
	ServiceObjectiveNameSystem3     ServiceObjectiveName = "System3"
	ServiceObjectiveNameSystem3L    ServiceObjectiveName = "System3L"
	ServiceObjectiveNameSystem4     ServiceObjectiveName = "System4"
	ServiceObjectiveNameSystem4L    ServiceObjectiveName = "System4L"
)

func PossibleServiceObjectiveNameValues

func PossibleServiceObjectiveNameValues() []ServiceObjectiveName

PossibleServiceObjectiveNameValues returns the possible values for the ServiceObjectiveName const type.

func (ServiceObjectiveName) ToPtr

ToPtr returns a *ServiceObjectiveName pointing to the current value.

type ServiceObjectiveProperties

type ServiceObjectiveProperties struct {
	// READ-ONLY; The description for the service level objective.
	Description *string `json:"description,omitempty" azure:"ro"`

	// READ-ONLY; Gets whether the service level objective is enabled.
	Enabled *bool `json:"enabled,omitempty" azure:"ro"`

	// READ-ONLY; Gets whether the service level objective is the default service objective.
	IsDefault *bool `json:"isDefault,omitempty" azure:"ro"`

	// READ-ONLY; Gets whether the service level objective is a system service objective.
	IsSystem *bool `json:"isSystem,omitempty" azure:"ro"`

	// READ-ONLY; The name for the service objective.
	ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty" azure:"ro"`
}

ServiceObjectiveProperties - Represents the properties of a database service objective.

type ServiceObjectivesClient

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

ServiceObjectivesClient contains the methods for the ServiceObjectives group. Don't use this type directly, use NewServiceObjectivesClient() instead.

func NewServiceObjectivesClient

func NewServiceObjectivesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServiceObjectivesClient

NewServiceObjectivesClient creates a new instance of ServiceObjectivesClient with the specified values. subscriptionID - The 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 (*ServiceObjectivesClient) Get

func (client *ServiceObjectivesClient) Get(ctx context.Context, resourceGroupName string, serverName string, serviceObjectiveName string, options *ServiceObjectivesClientGetOptions) (ServiceObjectivesClientGetResponse, error)

Get - Gets a database service objective. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. serviceObjectiveName - The name of the service objective to retrieve. options - ServiceObjectivesClientGetOptions contains the optional parameters for the ServiceObjectivesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServiceObjectivesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<service-objective-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServiceObjectivesClientGetResult)
}
Output:

func (*ServiceObjectivesClient) ListByServer

ListByServer - Returns database service objectives. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - ServiceObjectivesClientListByServerOptions contains the optional parameters for the ServiceObjectivesClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewServiceObjectivesClient("<subscription-id>", cred, nil)
	res, err := client.ListByServer(ctx,
		"<resource-group-name>",
		"<server-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.ServiceObjectivesClientListByServerResult)
}
Output:

type ServiceObjectivesClientGetOptions added in v0.3.0

type ServiceObjectivesClientGetOptions struct {
}

ServiceObjectivesClientGetOptions contains the optional parameters for the ServiceObjectivesClient.Get method.

type ServiceObjectivesClientGetResponse added in v0.3.0

type ServiceObjectivesClientGetResponse struct {
	ServiceObjectivesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServiceObjectivesClientGetResponse contains the response from method ServiceObjectivesClient.Get.

type ServiceObjectivesClientGetResult added in v0.3.0

type ServiceObjectivesClientGetResult struct {
	ServiceObjective
}

ServiceObjectivesClientGetResult contains the result from method ServiceObjectivesClient.Get.

type ServiceObjectivesClientListByServerOptions added in v0.3.0

type ServiceObjectivesClientListByServerOptions struct {
}

ServiceObjectivesClientListByServerOptions contains the optional parameters for the ServiceObjectivesClient.ListByServer method.

type ServiceObjectivesClientListByServerResponse added in v0.3.0

type ServiceObjectivesClientListByServerResponse struct {
	ServiceObjectivesClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

ServiceObjectivesClientListByServerResponse contains the response from method ServiceObjectivesClient.ListByServer.

type ServiceObjectivesClientListByServerResult added in v0.3.0

type ServiceObjectivesClientListByServerResult struct {
	ServiceObjectiveListResult
}

ServiceObjectivesClientListByServerResult contains the result from method ServiceObjectivesClient.ListByServer.

type ServicePrincipal added in v0.3.0

type ServicePrincipal struct {
	// Service principal type.
	Type *ServicePrincipalType `json:"type,omitempty"`

	// READ-ONLY; The Azure Active Directory application client id.
	ClientID *string `json:"clientId,omitempty" azure:"ro"`

	// READ-ONLY; The Azure Active Directory application object id.
	PrincipalID *string `json:"principalId,omitempty" azure:"ro"`

	// READ-ONLY; The Azure Active Directory tenant id.
	TenantID *string `json:"tenantId,omitempty" azure:"ro"`
}

ServicePrincipal - The managed instance's service principal configuration for a resource.

type ServicePrincipalType added in v0.3.0

type ServicePrincipalType string

ServicePrincipalType - Service principal type.

const (
	ServicePrincipalTypeNone           ServicePrincipalType = "None"
	ServicePrincipalTypeSystemAssigned ServicePrincipalType = "SystemAssigned"
)

func PossibleServicePrincipalTypeValues added in v0.3.0

func PossibleServicePrincipalTypeValues() []ServicePrincipalType

PossibleServicePrincipalTypeValues returns the possible values for the ServicePrincipalType const type.

func (ServicePrincipalType) ToPtr added in v0.3.0

ToPtr returns a *ServicePrincipalType pointing to the current value.

type ShortTermRetentionPolicyName

type ShortTermRetentionPolicyName string
const (
	ShortTermRetentionPolicyNameDefault ShortTermRetentionPolicyName = "default"
)

func PossibleShortTermRetentionPolicyNameValues

func PossibleShortTermRetentionPolicyNameValues() []ShortTermRetentionPolicyName

PossibleShortTermRetentionPolicyNameValues returns the possible values for the ShortTermRetentionPolicyName const type.

func (ShortTermRetentionPolicyName) ToPtr

ToPtr returns a *ShortTermRetentionPolicyName pointing to the current value.

type SloUsageMetric

type SloUsageMetric struct {
	// READ-ONLY; Gets or sets inRangeTimeRatio for SLO usage metric.
	InRangeTimeRatio *float64 `json:"inRangeTimeRatio,omitempty" azure:"ro"`

	// READ-ONLY; The serviceLevelObjective for SLO usage metric.
	ServiceLevelObjective *ServiceObjectiveName `json:"serviceLevelObjective,omitempty" azure:"ro"`

	// READ-ONLY; The serviceLevelObjectiveId for SLO usage metric.
	ServiceLevelObjectiveID *string `json:"serviceLevelObjectiveId,omitempty" azure:"ro"`
}

SloUsageMetric - A Slo Usage Metric.

type StorageCapability

type StorageCapability struct {
	// The reason for the capability not being available.
	Reason *string `json:"reason,omitempty"`

	// READ-ONLY; The status of the capability.
	Status *CapabilityStatus `json:"status,omitempty" azure:"ro"`

	// READ-ONLY; The storage account type for the database's backups.
	StorageAccountType *StorageCapabilityStorageAccountType `json:"storageAccountType,omitempty" azure:"ro"`
}

StorageCapability - The storage account type capability.

type StorageCapabilityStorageAccountType

type StorageCapabilityStorageAccountType string

StorageCapabilityStorageAccountType - The storage account type for the database's backups.

const (
	StorageCapabilityStorageAccountTypeGRS StorageCapabilityStorageAccountType = "GRS"
	StorageCapabilityStorageAccountTypeLRS StorageCapabilityStorageAccountType = "LRS"
	StorageCapabilityStorageAccountTypeZRS StorageCapabilityStorageAccountType = "ZRS"
)

func PossibleStorageCapabilityStorageAccountTypeValues

func PossibleStorageCapabilityStorageAccountTypeValues() []StorageCapabilityStorageAccountType

PossibleStorageCapabilityStorageAccountTypeValues returns the possible values for the StorageCapabilityStorageAccountType const type.

func (StorageCapabilityStorageAccountType) ToPtr

ToPtr returns a *StorageCapabilityStorageAccountType pointing to the current value.

type StorageKeyType

type StorageKeyType string

StorageKeyType - Storage key type.

const (
	StorageKeyTypeSharedAccessKey  StorageKeyType = "SharedAccessKey"
	StorageKeyTypeStorageAccessKey StorageKeyType = "StorageAccessKey"
)

func PossibleStorageKeyTypeValues

func PossibleStorageKeyTypeValues() []StorageKeyType

PossibleStorageKeyTypeValues returns the possible values for the StorageKeyType const type.

func (StorageKeyType) ToPtr

func (c StorageKeyType) ToPtr() *StorageKeyType

ToPtr returns a *StorageKeyType pointing to the current value.

type SubscriptionUsage

type SubscriptionUsage struct {
	// Resource properties.
	Properties *SubscriptionUsageProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

SubscriptionUsage - Usage Metric of a Subscription in a Location.

type SubscriptionUsageListResult

type SubscriptionUsageListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*SubscriptionUsage `json:"value,omitempty" azure:"ro"`
}

SubscriptionUsageListResult - A list of subscription usage metrics in a location.

func (SubscriptionUsageListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SubscriptionUsageListResult.

type SubscriptionUsageProperties

type SubscriptionUsageProperties struct {
	// READ-ONLY; Current value of the metric.
	CurrentValue *float64 `json:"currentValue,omitempty" azure:"ro"`

	// READ-ONLY; User-readable name of the metric.
	DisplayName *string `json:"displayName,omitempty" azure:"ro"`

	// READ-ONLY; Boundary value of the metric.
	Limit *float64 `json:"limit,omitempty" azure:"ro"`

	// READ-ONLY; Unit of the metric.
	Unit *string `json:"unit,omitempty" azure:"ro"`
}

SubscriptionUsageProperties - Properties of a subscription usage.

type SubscriptionUsagesClient

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

SubscriptionUsagesClient contains the methods for the SubscriptionUsages group. Don't use this type directly, use NewSubscriptionUsagesClient() instead.

func NewSubscriptionUsagesClient

func NewSubscriptionUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SubscriptionUsagesClient

NewSubscriptionUsagesClient creates a new instance of SubscriptionUsagesClient with the specified values. subscriptionID - The 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 (*SubscriptionUsagesClient) Get

Get - Gets a subscription usage metric. If the operation fails it returns an *azcore.ResponseError type. locationName - The name of the region where the resource is located. usageName - Name of usage metric to return. options - SubscriptionUsagesClientGetOptions contains the optional parameters for the SubscriptionUsagesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSubscriptionUsagesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<location-name>",
		"<usage-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.SubscriptionUsagesClientGetResult)
}
Output:

func (*SubscriptionUsagesClient) ListByLocation

ListByLocation - Gets all subscription usage metrics in a given location. If the operation fails it returns an *azcore.ResponseError type. locationName - The name of the region where the resource is located. options - SubscriptionUsagesClientListByLocationOptions contains the optional parameters for the SubscriptionUsagesClient.ListByLocation method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageListByLocation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSubscriptionUsagesClient("<subscription-id>", cred, nil)
	pager := client.ListByLocation("<location-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type SubscriptionUsagesClientGetOptions added in v0.3.0

type SubscriptionUsagesClientGetOptions struct {
}

SubscriptionUsagesClientGetOptions contains the optional parameters for the SubscriptionUsagesClient.Get method.

type SubscriptionUsagesClientGetResponse added in v0.3.0

type SubscriptionUsagesClientGetResponse struct {
	SubscriptionUsagesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SubscriptionUsagesClientGetResponse contains the response from method SubscriptionUsagesClient.Get.

type SubscriptionUsagesClientGetResult added in v0.3.0

type SubscriptionUsagesClientGetResult struct {
	SubscriptionUsage
}

SubscriptionUsagesClientGetResult contains the result from method SubscriptionUsagesClient.Get.

type SubscriptionUsagesClientListByLocationOptions added in v0.3.0

type SubscriptionUsagesClientListByLocationOptions struct {
}

SubscriptionUsagesClientListByLocationOptions contains the optional parameters for the SubscriptionUsagesClient.ListByLocation method.

type SubscriptionUsagesClientListByLocationPager added in v0.3.0

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

SubscriptionUsagesClientListByLocationPager provides operations for iterating over paged responses.

func (*SubscriptionUsagesClientListByLocationPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*SubscriptionUsagesClientListByLocationPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*SubscriptionUsagesClientListByLocationPager) PageResponse added in v0.3.0

PageResponse returns the current SubscriptionUsagesClientListByLocationResponse page.

type SubscriptionUsagesClientListByLocationResponse added in v0.3.0

type SubscriptionUsagesClientListByLocationResponse struct {
	SubscriptionUsagesClientListByLocationResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SubscriptionUsagesClientListByLocationResponse contains the response from method SubscriptionUsagesClient.ListByLocation.

type SubscriptionUsagesClientListByLocationResult added in v0.3.0

type SubscriptionUsagesClientListByLocationResult struct {
	SubscriptionUsageListResult
}

SubscriptionUsagesClientListByLocationResult contains the result from method SubscriptionUsagesClient.ListByLocation.

type SyncAgent

type SyncAgent struct {
	// Resource properties.
	Properties *SyncAgentProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

SyncAgent - An Azure SQL Database sync agent.

type SyncAgentKeyProperties

type SyncAgentKeyProperties struct {
	// READ-ONLY; Key of sync agent.
	SyncAgentKey *string `json:"syncAgentKey,omitempty" azure:"ro"`
}

SyncAgentKeyProperties - Properties of an Azure SQL Database sync agent key.

type SyncAgentLinkedDatabase

type SyncAgentLinkedDatabase struct {
	// Resource properties.
	Properties *SyncAgentLinkedDatabaseProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

SyncAgentLinkedDatabase - An Azure SQL Database sync agent linked database.

type SyncAgentLinkedDatabaseListResult

type SyncAgentLinkedDatabaseListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*SyncAgentLinkedDatabase `json:"value,omitempty" azure:"ro"`
}

SyncAgentLinkedDatabaseListResult - A list of sync agent linked databases.

func (SyncAgentLinkedDatabaseListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncAgentLinkedDatabaseListResult.

type SyncAgentLinkedDatabaseProperties

type SyncAgentLinkedDatabaseProperties struct {
	// READ-ONLY; Id of the sync agent linked database.
	DatabaseID *string `json:"databaseId,omitempty" azure:"ro"`

	// READ-ONLY; Database name of the sync agent linked database.
	DatabaseName *string `json:"databaseName,omitempty" azure:"ro"`

	// READ-ONLY; Type of the sync agent linked database.
	DatabaseType *SyncMemberDbType `json:"databaseType,omitempty" azure:"ro"`

	// READ-ONLY; Description of the sync agent linked database.
	Description *string `json:"description,omitempty" azure:"ro"`

	// READ-ONLY; Server name of the sync agent linked database.
	ServerName *string `json:"serverName,omitempty" azure:"ro"`

	// READ-ONLY; User name of the sync agent linked database.
	UserName *string `json:"userName,omitempty" azure:"ro"`
}

SyncAgentLinkedDatabaseProperties - Properties of an Azure SQL Database sync agent linked database.

type SyncAgentListResult

type SyncAgentListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*SyncAgent `json:"value,omitempty" azure:"ro"`
}

SyncAgentListResult - A list of sync agents.

func (SyncAgentListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncAgentListResult.

type SyncAgentProperties

type SyncAgentProperties struct {
	// ARM resource id of the sync database in the sync agent.
	SyncDatabaseID *string `json:"syncDatabaseId,omitempty"`

	// READ-ONLY; Expiration time of the sync agent version.
	ExpiryTime *time.Time `json:"expiryTime,omitempty" azure:"ro"`

	// READ-ONLY; If the sync agent version is up to date.
	IsUpToDate *bool `json:"isUpToDate,omitempty" azure:"ro"`

	// READ-ONLY; Last alive time of the sync agent.
	LastAliveTime *time.Time `json:"lastAliveTime,omitempty" azure:"ro"`

	// READ-ONLY; Name of the sync agent.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; State of the sync agent.
	State *SyncAgentState `json:"state,omitempty" azure:"ro"`

	// READ-ONLY; Version of the sync agent.
	Version *string `json:"version,omitempty" azure:"ro"`
}

SyncAgentProperties - Properties of an Azure SQL Database sync agent.

func (SyncAgentProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncAgentProperties.

func (*SyncAgentProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentProperties.

type SyncAgentState

type SyncAgentState string

SyncAgentState - State of the sync agent.

const (
	SyncAgentStateNeverConnected SyncAgentState = "NeverConnected"
	SyncAgentStateOffline        SyncAgentState = "Offline"
	SyncAgentStateOnline         SyncAgentState = "Online"
)

func PossibleSyncAgentStateValues

func PossibleSyncAgentStateValues() []SyncAgentState

PossibleSyncAgentStateValues returns the possible values for the SyncAgentState const type.

func (SyncAgentState) ToPtr

func (c SyncAgentState) ToPtr() *SyncAgentState

ToPtr returns a *SyncAgentState pointing to the current value.

type SyncAgentsClient

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

SyncAgentsClient contains the methods for the SyncAgents group. Don't use this type directly, use NewSyncAgentsClient() instead.

func NewSyncAgentsClient

func NewSyncAgentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SyncAgentsClient

NewSyncAgentsClient creates a new instance of SyncAgentsClient with the specified values. subscriptionID - The 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 (*SyncAgentsClient) BeginCreateOrUpdate

func (client *SyncAgentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, parameters SyncAgent, options *SyncAgentsClientBeginCreateOrUpdateOptions) (SyncAgentsClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates a sync agent. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server on which the sync agent is hosted. syncAgentName - The name of the sync agent. parameters - The requested sync agent resource state. options - SyncAgentsClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncAgentsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentCreate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncAgentsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<sync-agent-name>",
		armsql.SyncAgent{
			Properties: &armsql.SyncAgentProperties{
				SyncDatabaseID: to.StringPtr("<sync-database-id>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.SyncAgentsClientCreateOrUpdateResult)
}
Output:

func (*SyncAgentsClient) BeginDelete

func (client *SyncAgentsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, options *SyncAgentsClientBeginDeleteOptions) (SyncAgentsClientDeletePollerResponse, error)

BeginDelete - Deletes a sync agent. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server on which the sync agent is hosted. syncAgentName - The name of the sync agent. options - SyncAgentsClientBeginDeleteOptions contains the optional parameters for the SyncAgentsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncAgentsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<sync-agent-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*SyncAgentsClient) GenerateKey

func (client *SyncAgentsClient) GenerateKey(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, options *SyncAgentsClientGenerateKeyOptions) (SyncAgentsClientGenerateKeyResponse, error)

GenerateKey - Generates a sync agent key. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server on which the sync agent is hosted. syncAgentName - The name of the sync agent. options - SyncAgentsClientGenerateKeyOptions contains the optional parameters for the SyncAgentsClient.GenerateKey method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGenerateKey.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncAgentsClient("<subscription-id>", cred, nil)
	res, err := client.GenerateKey(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<sync-agent-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.SyncAgentsClientGenerateKeyResult)
}
Output:

func (*SyncAgentsClient) Get

func (client *SyncAgentsClient) Get(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, options *SyncAgentsClientGetOptions) (SyncAgentsClientGetResponse, error)

Get - Gets a sync agent. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server on which the sync agent is hosted. syncAgentName - The name of the sync agent. options - SyncAgentsClientGetOptions contains the optional parameters for the SyncAgentsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncAgentsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<sync-agent-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.SyncAgentsClientGetResult)
}
Output:

func (*SyncAgentsClient) ListByServer

func (client *SyncAgentsClient) ListByServer(resourceGroupName string, serverName string, options *SyncAgentsClientListByServerOptions) *SyncAgentsClientListByServerPager

ListByServer - Lists sync agents in a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server on which the sync agent is hosted. options - SyncAgentsClientListByServerOptions contains the optional parameters for the SyncAgentsClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentListByServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncAgentsClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*SyncAgentsClient) ListLinkedDatabases

func (client *SyncAgentsClient) ListLinkedDatabases(resourceGroupName string, serverName string, syncAgentName string, options *SyncAgentsClientListLinkedDatabasesOptions) *SyncAgentsClientListLinkedDatabasesPager

ListLinkedDatabases - Lists databases linked to a sync agent. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server on which the sync agent is hosted. syncAgentName - The name of the sync agent. options - SyncAgentsClientListLinkedDatabasesOptions contains the optional parameters for the SyncAgentsClient.ListLinkedDatabases method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGetLinkedDatabases.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncAgentsClient("<subscription-id>", cred, nil)
	pager := client.ListLinkedDatabases("<resource-group-name>",
		"<server-name>",
		"<sync-agent-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type SyncAgentsClientBeginCreateOrUpdateOptions added in v0.3.0

type SyncAgentsClientBeginCreateOrUpdateOptions struct {
}

SyncAgentsClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncAgentsClient.BeginCreateOrUpdate method.

type SyncAgentsClientBeginDeleteOptions added in v0.3.0

type SyncAgentsClientBeginDeleteOptions struct {
}

SyncAgentsClientBeginDeleteOptions contains the optional parameters for the SyncAgentsClient.BeginDelete method.

type SyncAgentsClientCreateOrUpdatePoller added in v0.3.0

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

SyncAgentsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*SyncAgentsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*SyncAgentsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final SyncAgentsClientCreateOrUpdateResponse will be returned.

func (*SyncAgentsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*SyncAgentsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type SyncAgentsClientCreateOrUpdatePollerResponse added in v0.3.0

type SyncAgentsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *SyncAgentsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncAgentsClientCreateOrUpdatePollerResponse contains the response from method SyncAgentsClient.CreateOrUpdate.

func (SyncAgentsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*SyncAgentsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a SyncAgentsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type SyncAgentsClientCreateOrUpdateResponse added in v0.3.0

type SyncAgentsClientCreateOrUpdateResponse struct {
	SyncAgentsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncAgentsClientCreateOrUpdateResponse contains the response from method SyncAgentsClient.CreateOrUpdate.

type SyncAgentsClientCreateOrUpdateResult added in v0.3.0

type SyncAgentsClientCreateOrUpdateResult struct {
	SyncAgent
}

SyncAgentsClientCreateOrUpdateResult contains the result from method SyncAgentsClient.CreateOrUpdate.

type SyncAgentsClientDeletePoller added in v0.3.0

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

SyncAgentsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*SyncAgentsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*SyncAgentsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final SyncAgentsClientDeleteResponse will be returned.

func (*SyncAgentsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*SyncAgentsClientDeletePoller) ResumeToken added in v0.3.0

func (p *SyncAgentsClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type SyncAgentsClientDeletePollerResponse added in v0.3.0

type SyncAgentsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *SyncAgentsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncAgentsClientDeletePollerResponse contains the response from method SyncAgentsClient.Delete.

func (SyncAgentsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*SyncAgentsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a SyncAgentsClientDeletePollerResponse from the provided client and resume token.

type SyncAgentsClientDeleteResponse added in v0.3.0

type SyncAgentsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncAgentsClientDeleteResponse contains the response from method SyncAgentsClient.Delete.

type SyncAgentsClientGenerateKeyOptions added in v0.3.0

type SyncAgentsClientGenerateKeyOptions struct {
}

SyncAgentsClientGenerateKeyOptions contains the optional parameters for the SyncAgentsClient.GenerateKey method.

type SyncAgentsClientGenerateKeyResponse added in v0.3.0

type SyncAgentsClientGenerateKeyResponse struct {
	SyncAgentsClientGenerateKeyResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncAgentsClientGenerateKeyResponse contains the response from method SyncAgentsClient.GenerateKey.

type SyncAgentsClientGenerateKeyResult added in v0.3.0

type SyncAgentsClientGenerateKeyResult struct {
	SyncAgentKeyProperties
}

SyncAgentsClientGenerateKeyResult contains the result from method SyncAgentsClient.GenerateKey.

type SyncAgentsClientGetOptions added in v0.3.0

type SyncAgentsClientGetOptions struct {
}

SyncAgentsClientGetOptions contains the optional parameters for the SyncAgentsClient.Get method.

type SyncAgentsClientGetResponse added in v0.3.0

type SyncAgentsClientGetResponse struct {
	SyncAgentsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncAgentsClientGetResponse contains the response from method SyncAgentsClient.Get.

type SyncAgentsClientGetResult added in v0.3.0

type SyncAgentsClientGetResult struct {
	SyncAgent
}

SyncAgentsClientGetResult contains the result from method SyncAgentsClient.Get.

type SyncAgentsClientListByServerOptions added in v0.3.0

type SyncAgentsClientListByServerOptions struct {
}

SyncAgentsClientListByServerOptions contains the optional parameters for the SyncAgentsClient.ListByServer method.

type SyncAgentsClientListByServerPager added in v0.3.0

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

SyncAgentsClientListByServerPager provides operations for iterating over paged responses.

func (*SyncAgentsClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*SyncAgentsClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*SyncAgentsClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current SyncAgentsClientListByServerResponse page.

type SyncAgentsClientListByServerResponse added in v0.3.0

type SyncAgentsClientListByServerResponse struct {
	SyncAgentsClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncAgentsClientListByServerResponse contains the response from method SyncAgentsClient.ListByServer.

type SyncAgentsClientListByServerResult added in v0.3.0

type SyncAgentsClientListByServerResult struct {
	SyncAgentListResult
}

SyncAgentsClientListByServerResult contains the result from method SyncAgentsClient.ListByServer.

type SyncAgentsClientListLinkedDatabasesOptions added in v0.3.0

type SyncAgentsClientListLinkedDatabasesOptions struct {
}

SyncAgentsClientListLinkedDatabasesOptions contains the optional parameters for the SyncAgentsClient.ListLinkedDatabases method.

type SyncAgentsClientListLinkedDatabasesPager added in v0.3.0

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

SyncAgentsClientListLinkedDatabasesPager provides operations for iterating over paged responses.

func (*SyncAgentsClientListLinkedDatabasesPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*SyncAgentsClientListLinkedDatabasesPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*SyncAgentsClientListLinkedDatabasesPager) PageResponse added in v0.3.0

PageResponse returns the current SyncAgentsClientListLinkedDatabasesResponse page.

type SyncAgentsClientListLinkedDatabasesResponse added in v0.3.0

type SyncAgentsClientListLinkedDatabasesResponse struct {
	SyncAgentsClientListLinkedDatabasesResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncAgentsClientListLinkedDatabasesResponse contains the response from method SyncAgentsClient.ListLinkedDatabases.

type SyncAgentsClientListLinkedDatabasesResult added in v0.3.0

type SyncAgentsClientListLinkedDatabasesResult struct {
	SyncAgentLinkedDatabaseListResult
}

SyncAgentsClientListLinkedDatabasesResult contains the result from method SyncAgentsClient.ListLinkedDatabases.

type SyncConflictResolutionPolicy

type SyncConflictResolutionPolicy string

SyncConflictResolutionPolicy - Conflict resolution policy of the sync group.

const (
	SyncConflictResolutionPolicyHubWin    SyncConflictResolutionPolicy = "HubWin"
	SyncConflictResolutionPolicyMemberWin SyncConflictResolutionPolicy = "MemberWin"
)

func PossibleSyncConflictResolutionPolicyValues

func PossibleSyncConflictResolutionPolicyValues() []SyncConflictResolutionPolicy

PossibleSyncConflictResolutionPolicyValues returns the possible values for the SyncConflictResolutionPolicy const type.

func (SyncConflictResolutionPolicy) ToPtr

ToPtr returns a *SyncConflictResolutionPolicy pointing to the current value.

type SyncDatabaseIDListResult

type SyncDatabaseIDListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*SyncDatabaseIDProperties `json:"value,omitempty" azure:"ro"`
}

SyncDatabaseIDListResult - A list of sync database ID properties.

func (SyncDatabaseIDListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncDatabaseIDListResult.

type SyncDatabaseIDProperties

type SyncDatabaseIDProperties struct {
	// READ-ONLY; ARM resource id of sync database.
	ID *string `json:"id,omitempty" azure:"ro"`
}

SyncDatabaseIDProperties - Properties of the sync database id.

type SyncDirection

type SyncDirection string

SyncDirection - Sync direction of the sync member.

const (
	SyncDirectionBidirectional     SyncDirection = "Bidirectional"
	SyncDirectionOneWayHubToMember SyncDirection = "OneWayHubToMember"
	SyncDirectionOneWayMemberToHub SyncDirection = "OneWayMemberToHub"
)

func PossibleSyncDirectionValues

func PossibleSyncDirectionValues() []SyncDirection

PossibleSyncDirectionValues returns the possible values for the SyncDirection const type.

func (SyncDirection) ToPtr

func (c SyncDirection) ToPtr() *SyncDirection

ToPtr returns a *SyncDirection pointing to the current value.

type SyncFullSchemaProperties

type SyncFullSchemaProperties struct {
	// READ-ONLY; Last update time of the database schema.
	LastUpdateTime *time.Time `json:"lastUpdateTime,omitempty" azure:"ro"`

	// READ-ONLY; List of tables in the database full schema.
	Tables []*SyncFullSchemaTable `json:"tables,omitempty" azure:"ro"`
}

SyncFullSchemaProperties - Properties of the database full schema.

func (SyncFullSchemaProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaProperties.

func (*SyncFullSchemaProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SyncFullSchemaProperties.

type SyncFullSchemaPropertiesListResult

type SyncFullSchemaPropertiesListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*SyncFullSchemaProperties `json:"value,omitempty" azure:"ro"`
}

SyncFullSchemaPropertiesListResult - A list of sync schema properties.

func (SyncFullSchemaPropertiesListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaPropertiesListResult.

type SyncFullSchemaTable

type SyncFullSchemaTable struct {
	// READ-ONLY; List of columns in the table of database full schema.
	Columns []*SyncFullSchemaTableColumn `json:"columns,omitempty" azure:"ro"`

	// READ-ONLY; Error id of the table.
	ErrorID *string `json:"errorId,omitempty" azure:"ro"`

	// READ-ONLY; If there is error in the table.
	HasError *bool `json:"hasError,omitempty" azure:"ro"`

	// READ-ONLY; Name of the table.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Quoted name of the table.
	QuotedName *string `json:"quotedName,omitempty" azure:"ro"`
}

SyncFullSchemaTable - Properties of the table in the database full schema.

func (SyncFullSchemaTable) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaTable.

type SyncFullSchemaTableColumn

type SyncFullSchemaTableColumn struct {
	// READ-ONLY; Data size of the column.
	DataSize *string `json:"dataSize,omitempty" azure:"ro"`

	// READ-ONLY; Data type of the column.
	DataType *string `json:"dataType,omitempty" azure:"ro"`

	// READ-ONLY; Error id of the column.
	ErrorID *string `json:"errorId,omitempty" azure:"ro"`

	// READ-ONLY; If there is error in the table.
	HasError *bool `json:"hasError,omitempty" azure:"ro"`

	// READ-ONLY; If it is the primary key of the table.
	IsPrimaryKey *bool `json:"isPrimaryKey,omitempty" azure:"ro"`

	// READ-ONLY; Name of the column.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Quoted name of the column.
	QuotedName *string `json:"quotedName,omitempty" azure:"ro"`
}

SyncFullSchemaTableColumn - Properties of the column in the table of database full schema.

type SyncGroup

type SyncGroup struct {
	// Resource properties.
	Properties *SyncGroupProperties `json:"properties,omitempty"`

	// The name and capacity of the SKU.
	SKU *SKU `json:"sku,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

SyncGroup - An Azure SQL Database sync group.

func (SyncGroup) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncGroup.

type SyncGroupListResult

type SyncGroupListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*SyncGroup `json:"value,omitempty" azure:"ro"`
}

SyncGroupListResult - A list of sync groups.

func (SyncGroupListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncGroupListResult.

type SyncGroupLogListResult

type SyncGroupLogListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*SyncGroupLogProperties `json:"value,omitempty" azure:"ro"`
}

SyncGroupLogListResult - A list of sync group log properties.

func (SyncGroupLogListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncGroupLogListResult.

type SyncGroupLogProperties

type SyncGroupLogProperties struct {
	// READ-ONLY; Details of the sync group log.
	Details *string `json:"details,omitempty" azure:"ro"`

	// READ-ONLY; OperationStatus of the sync group log.
	OperationStatus *string `json:"operationStatus,omitempty" azure:"ro"`

	// READ-ONLY; Source of the sync group log.
	Source *string `json:"source,omitempty" azure:"ro"`

	// READ-ONLY; Timestamp of the sync group log.
	Timestamp *time.Time `json:"timestamp,omitempty" azure:"ro"`

	// READ-ONLY; TracingId of the sync group log.
	TracingID *string `json:"tracingId,omitempty" azure:"ro"`

	// READ-ONLY; Type of the sync group log.
	Type *SyncGroupLogType `json:"type,omitempty" azure:"ro"`
}

SyncGroupLogProperties - Properties of an Azure SQL Database sync group log.

func (SyncGroupLogProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncGroupLogProperties.

func (*SyncGroupLogProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupLogProperties.

type SyncGroupLogType

type SyncGroupLogType string

SyncGroupLogType - Type of the sync group log.

const (
	SyncGroupLogTypeAll     SyncGroupLogType = "All"
	SyncGroupLogTypeError   SyncGroupLogType = "Error"
	SyncGroupLogTypeSuccess SyncGroupLogType = "Success"
	SyncGroupLogTypeWarning SyncGroupLogType = "Warning"
)

func PossibleSyncGroupLogTypeValues

func PossibleSyncGroupLogTypeValues() []SyncGroupLogType

PossibleSyncGroupLogTypeValues returns the possible values for the SyncGroupLogType const type.

func (SyncGroupLogType) ToPtr

ToPtr returns a *SyncGroupLogType pointing to the current value.

type SyncGroupProperties

type SyncGroupProperties struct {
	// Conflict logging retention period.
	ConflictLoggingRetentionInDays *int32 `json:"conflictLoggingRetentionInDays,omitempty"`

	// Conflict resolution policy of the sync group.
	ConflictResolutionPolicy *SyncConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`

	// If conflict logging is enabled.
	EnableConflictLogging *bool `json:"enableConflictLogging,omitempty"`

	// Password for the sync group hub database credential.
	HubDatabasePassword *string `json:"hubDatabasePassword,omitempty"`

	// User name for the sync group hub database credential.
	HubDatabaseUserName *string `json:"hubDatabaseUserName,omitempty"`

	// Sync interval of the sync group.
	Interval *int32 `json:"interval,omitempty"`

	// Sync schema of the sync group.
	Schema *SyncGroupSchema `json:"schema,omitempty"`

	// ARM resource id of the sync database in the sync group.
	SyncDatabaseID *string `json:"syncDatabaseId,omitempty"`

	// If use private link connection is enabled.
	UsePrivateLinkConnection *bool `json:"usePrivateLinkConnection,omitempty"`

	// READ-ONLY; Last sync time of the sync group.
	LastSyncTime *time.Time `json:"lastSyncTime,omitempty" azure:"ro"`

	// READ-ONLY; Private endpoint name of the sync group if use private link connection is enabled.
	PrivateEndpointName *string `json:"privateEndpointName,omitempty" azure:"ro"`

	// READ-ONLY; Sync state of the sync group.
	SyncState *SyncGroupState `json:"syncState,omitempty" azure:"ro"`
}

SyncGroupProperties - Properties of a sync group.

func (SyncGroupProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncGroupProperties.

func (*SyncGroupProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupProperties.

type SyncGroupSchema

type SyncGroupSchema struct {
	// Name of master sync member where the schema is from.
	MasterSyncMemberName *string `json:"masterSyncMemberName,omitempty"`

	// List of tables in sync group schema.
	Tables []*SyncGroupSchemaTable `json:"tables,omitempty"`
}

SyncGroupSchema - Properties of sync group schema.

func (SyncGroupSchema) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncGroupSchema.

type SyncGroupSchemaTable

type SyncGroupSchemaTable struct {
	// List of columns in sync group schema.
	Columns []*SyncGroupSchemaTableColumn `json:"columns,omitempty"`

	// Quoted name of sync group schema table.
	QuotedName *string `json:"quotedName,omitempty"`
}

SyncGroupSchemaTable - Properties of table in sync group schema.

func (SyncGroupSchemaTable) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncGroupSchemaTable.

type SyncGroupSchemaTableColumn

type SyncGroupSchemaTableColumn struct {
	// Data size of the column.
	DataSize *string `json:"dataSize,omitempty"`

	// Data type of the column.
	DataType *string `json:"dataType,omitempty"`

	// Quoted name of sync group table column.
	QuotedName *string `json:"quotedName,omitempty"`
}

SyncGroupSchemaTableColumn - Properties of column in sync group table.

type SyncGroupState

type SyncGroupState string

SyncGroupState - Sync state of the sync group.

const (
	SyncGroupStateError       SyncGroupState = "Error"
	SyncGroupStateGood        SyncGroupState = "Good"
	SyncGroupStateNotReady    SyncGroupState = "NotReady"
	SyncGroupStateProgressing SyncGroupState = "Progressing"
	SyncGroupStateWarning     SyncGroupState = "Warning"
)

func PossibleSyncGroupStateValues

func PossibleSyncGroupStateValues() []SyncGroupState

PossibleSyncGroupStateValues returns the possible values for the SyncGroupState const type.

func (SyncGroupState) ToPtr

func (c SyncGroupState) ToPtr() *SyncGroupState

ToPtr returns a *SyncGroupState pointing to the current value.

type SyncGroupsClient

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

SyncGroupsClient contains the methods for the SyncGroups group. Don't use this type directly, use NewSyncGroupsClient() instead.

func NewSyncGroupsClient

func NewSyncGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SyncGroupsClient

NewSyncGroupsClient creates a new instance of SyncGroupsClient with the specified values. subscriptionID - The 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 (*SyncGroupsClient) BeginCreateOrUpdate

func (client *SyncGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup, options *SyncGroupsClientBeginCreateOrUpdateOptions) (SyncGroupsClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates a sync group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group. parameters - The requested sync group resource state. options - SyncGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncGroupsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCreate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		armsql.SyncGroup{
			Properties: &armsql.SyncGroupProperties{
				ConflictResolutionPolicy: armsql.SyncConflictResolutionPolicy("HubWin").ToPtr(),
				HubDatabaseUserName:      to.StringPtr("<hub-database-user-name>"),
				Interval:                 to.Int32Ptr(-1),
				SyncDatabaseID:           to.StringPtr("<sync-database-id>"),
				UsePrivateLinkConnection: to.BoolPtr(true),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.SyncGroupsClientCreateOrUpdateResult)
}
Output:

func (*SyncGroupsClient) BeginDelete

func (client *SyncGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientBeginDeleteOptions) (SyncGroupsClientDeletePollerResponse, error)

BeginDelete - Deletes a sync group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group. options - SyncGroupsClientBeginDeleteOptions contains the optional parameters for the SyncGroupsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*SyncGroupsClient) BeginRefreshHubSchema

func (client *SyncGroupsClient) BeginRefreshHubSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientBeginRefreshHubSchemaOptions) (SyncGroupsClientRefreshHubSchemaPollerResponse, error)

BeginRefreshHubSchema - Refreshes a hub database schema. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group. options - SyncGroupsClientBeginRefreshHubSchemaOptions contains the optional parameters for the SyncGroupsClient.BeginRefreshHubSchema method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupRefreshHubSchema.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginRefreshHubSchema(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*SyncGroupsClient) BeginUpdate

func (client *SyncGroupsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup, options *SyncGroupsClientBeginUpdateOptions) (SyncGroupsClientUpdatePollerResponse, error)

BeginUpdate - Updates a sync group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group. parameters - The requested sync group resource state. options - SyncGroupsClientBeginUpdateOptions contains the optional parameters for the SyncGroupsClient.BeginUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupPatch.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		armsql.SyncGroup{
			Properties: &armsql.SyncGroupProperties{
				ConflictResolutionPolicy: armsql.SyncConflictResolutionPolicy("HubWin").ToPtr(),
				HubDatabasePassword:      to.StringPtr("<hub-database-password>"),
				HubDatabaseUserName:      to.StringPtr("<hub-database-user-name>"),
				Interval:                 to.Int32Ptr(-1),
				SyncDatabaseID:           to.StringPtr("<sync-database-id>"),
				UsePrivateLinkConnection: to.BoolPtr(true),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.SyncGroupsClientUpdateResult)
}
Output:

func (*SyncGroupsClient) CancelSync

func (client *SyncGroupsClient) CancelSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientCancelSyncOptions) (SyncGroupsClientCancelSyncResponse, error)

CancelSync - Cancels a sync group synchronization. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group. options - SyncGroupsClientCancelSyncOptions contains the optional parameters for the SyncGroupsClient.CancelSync method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCancelSync.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncGroupsClient("<subscription-id>", cred, nil)
	_, err = client.CancelSync(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*SyncGroupsClient) Get

func (client *SyncGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientGetOptions) (SyncGroupsClientGetResponse, error)

Get - Gets a sync group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group. options - SyncGroupsClientGetOptions contains the optional parameters for the SyncGroupsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncGroupsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.SyncGroupsClientGetResult)
}
Output:

func (*SyncGroupsClient) ListByDatabase

func (client *SyncGroupsClient) ListByDatabase(resourceGroupName string, serverName string, databaseName string, options *SyncGroupsClientListByDatabaseOptions) *SyncGroupsClientListByDatabasePager

ListByDatabase - Lists sync groups under a hub database. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. options - SyncGroupsClientListByDatabaseOptions contains the optional parameters for the SyncGroupsClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupListByDatabase.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncGroupsClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*SyncGroupsClient) ListHubSchemas

func (client *SyncGroupsClient) ListHubSchemas(resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientListHubSchemasOptions) *SyncGroupsClientListHubSchemasPager

ListHubSchemas - Gets a collection of hub database schemas. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group. options - SyncGroupsClientListHubSchemasOptions contains the optional parameters for the SyncGroupsClient.ListHubSchemas method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetHubSchema.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncGroupsClient("<subscription-id>", cred, nil)
	pager := client.ListHubSchemas("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*SyncGroupsClient) ListLogs

func (client *SyncGroupsClient) ListLogs(resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParam SyncGroupsType, options *SyncGroupsClientListLogsOptions) *SyncGroupsClientListLogsPager

ListLogs - Gets a collection of sync group logs. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group. startTime - Get logs generated after this time. endTime - Get logs generated before this time. typeParam - The types of logs to retrieve. options - SyncGroupsClientListLogsOptions contains the optional parameters for the SyncGroupsClient.ListLogs method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetLog.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncGroupsClient("<subscription-id>", cred, nil)
	pager := client.ListLogs("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		"<start-time>",
		"<end-time>",
		armsql.SyncGroupsType("All"),
		&armsql.SyncGroupsClientListLogsOptions{ContinuationToken: nil})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*SyncGroupsClient) ListSyncDatabaseIDs

ListSyncDatabaseIDs - Gets a collection of sync database ids. If the operation fails it returns an *azcore.ResponseError type. locationName - The name of the region where the resource is located. options - SyncGroupsClientListSyncDatabaseIDsOptions contains the optional parameters for the SyncGroupsClient.ListSyncDatabaseIDs method.

func (*SyncGroupsClient) TriggerSync

func (client *SyncGroupsClient) TriggerSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientTriggerSyncOptions) (SyncGroupsClientTriggerSyncResponse, error)

TriggerSync - Triggers a sync group synchronization. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group. options - SyncGroupsClientTriggerSyncOptions contains the optional parameters for the SyncGroupsClient.TriggerSync method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupTriggerSync.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncGroupsClient("<subscription-id>", cred, nil)
	_, err = client.TriggerSync(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

type SyncGroupsClientBeginCreateOrUpdateOptions added in v0.3.0

type SyncGroupsClientBeginCreateOrUpdateOptions struct {
}

SyncGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncGroupsClient.BeginCreateOrUpdate method.

type SyncGroupsClientBeginDeleteOptions added in v0.3.0

type SyncGroupsClientBeginDeleteOptions struct {
}

SyncGroupsClientBeginDeleteOptions contains the optional parameters for the SyncGroupsClient.BeginDelete method.

type SyncGroupsClientBeginRefreshHubSchemaOptions added in v0.3.0

type SyncGroupsClientBeginRefreshHubSchemaOptions struct {
}

SyncGroupsClientBeginRefreshHubSchemaOptions contains the optional parameters for the SyncGroupsClient.BeginRefreshHubSchema method.

type SyncGroupsClientBeginUpdateOptions added in v0.3.0

type SyncGroupsClientBeginUpdateOptions struct {
}

SyncGroupsClientBeginUpdateOptions contains the optional parameters for the SyncGroupsClient.BeginUpdate method.

type SyncGroupsClientCancelSyncOptions added in v0.3.0

type SyncGroupsClientCancelSyncOptions struct {
}

SyncGroupsClientCancelSyncOptions contains the optional parameters for the SyncGroupsClient.CancelSync method.

type SyncGroupsClientCancelSyncResponse added in v0.3.0

type SyncGroupsClientCancelSyncResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncGroupsClientCancelSyncResponse contains the response from method SyncGroupsClient.CancelSync.

type SyncGroupsClientCreateOrUpdatePoller added in v0.3.0

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

SyncGroupsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*SyncGroupsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*SyncGroupsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final SyncGroupsClientCreateOrUpdateResponse will be returned.

func (*SyncGroupsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*SyncGroupsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type SyncGroupsClientCreateOrUpdatePollerResponse added in v0.3.0

type SyncGroupsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *SyncGroupsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncGroupsClientCreateOrUpdatePollerResponse contains the response from method SyncGroupsClient.CreateOrUpdate.

func (SyncGroupsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*SyncGroupsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a SyncGroupsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type SyncGroupsClientCreateOrUpdateResponse added in v0.3.0

type SyncGroupsClientCreateOrUpdateResponse struct {
	SyncGroupsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncGroupsClientCreateOrUpdateResponse contains the response from method SyncGroupsClient.CreateOrUpdate.

type SyncGroupsClientCreateOrUpdateResult added in v0.3.0

type SyncGroupsClientCreateOrUpdateResult struct {
	SyncGroup
}

SyncGroupsClientCreateOrUpdateResult contains the result from method SyncGroupsClient.CreateOrUpdate.

type SyncGroupsClientDeletePoller added in v0.3.0

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

SyncGroupsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*SyncGroupsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*SyncGroupsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final SyncGroupsClientDeleteResponse will be returned.

func (*SyncGroupsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*SyncGroupsClientDeletePoller) ResumeToken added in v0.3.0

func (p *SyncGroupsClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type SyncGroupsClientDeletePollerResponse added in v0.3.0

type SyncGroupsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *SyncGroupsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncGroupsClientDeletePollerResponse contains the response from method SyncGroupsClient.Delete.

func (SyncGroupsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*SyncGroupsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a SyncGroupsClientDeletePollerResponse from the provided client and resume token.

type SyncGroupsClientDeleteResponse added in v0.3.0

type SyncGroupsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncGroupsClientDeleteResponse contains the response from method SyncGroupsClient.Delete.

type SyncGroupsClientGetOptions added in v0.3.0

type SyncGroupsClientGetOptions struct {
}

SyncGroupsClientGetOptions contains the optional parameters for the SyncGroupsClient.Get method.

type SyncGroupsClientGetResponse added in v0.3.0

type SyncGroupsClientGetResponse struct {
	SyncGroupsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncGroupsClientGetResponse contains the response from method SyncGroupsClient.Get.

type SyncGroupsClientGetResult added in v0.3.0

type SyncGroupsClientGetResult struct {
	SyncGroup
}

SyncGroupsClientGetResult contains the result from method SyncGroupsClient.Get.

type SyncGroupsClientListByDatabaseOptions added in v0.3.0

type SyncGroupsClientListByDatabaseOptions struct {
}

SyncGroupsClientListByDatabaseOptions contains the optional parameters for the SyncGroupsClient.ListByDatabase method.

type SyncGroupsClientListByDatabasePager added in v0.3.0

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

SyncGroupsClientListByDatabasePager provides operations for iterating over paged responses.

func (*SyncGroupsClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*SyncGroupsClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*SyncGroupsClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current SyncGroupsClientListByDatabaseResponse page.

type SyncGroupsClientListByDatabaseResponse added in v0.3.0

type SyncGroupsClientListByDatabaseResponse struct {
	SyncGroupsClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncGroupsClientListByDatabaseResponse contains the response from method SyncGroupsClient.ListByDatabase.

type SyncGroupsClientListByDatabaseResult added in v0.3.0

type SyncGroupsClientListByDatabaseResult struct {
	SyncGroupListResult
}

SyncGroupsClientListByDatabaseResult contains the result from method SyncGroupsClient.ListByDatabase.

type SyncGroupsClientListHubSchemasOptions added in v0.3.0

type SyncGroupsClientListHubSchemasOptions struct {
}

SyncGroupsClientListHubSchemasOptions contains the optional parameters for the SyncGroupsClient.ListHubSchemas method.

type SyncGroupsClientListHubSchemasPager added in v0.3.0

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

SyncGroupsClientListHubSchemasPager provides operations for iterating over paged responses.

func (*SyncGroupsClientListHubSchemasPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*SyncGroupsClientListHubSchemasPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*SyncGroupsClientListHubSchemasPager) PageResponse added in v0.3.0

PageResponse returns the current SyncGroupsClientListHubSchemasResponse page.

type SyncGroupsClientListHubSchemasResponse added in v0.3.0

type SyncGroupsClientListHubSchemasResponse struct {
	SyncGroupsClientListHubSchemasResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncGroupsClientListHubSchemasResponse contains the response from method SyncGroupsClient.ListHubSchemas.

type SyncGroupsClientListHubSchemasResult added in v0.3.0

type SyncGroupsClientListHubSchemasResult struct {
	SyncFullSchemaPropertiesListResult
}

SyncGroupsClientListHubSchemasResult contains the result from method SyncGroupsClient.ListHubSchemas.

type SyncGroupsClientListLogsOptions added in v0.3.0

type SyncGroupsClientListLogsOptions struct {
	// The continuation token for this operation.
	ContinuationToken *string
}

SyncGroupsClientListLogsOptions contains the optional parameters for the SyncGroupsClient.ListLogs method.

type SyncGroupsClientListLogsPager added in v0.3.0

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

SyncGroupsClientListLogsPager provides operations for iterating over paged responses.

func (*SyncGroupsClientListLogsPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*SyncGroupsClientListLogsPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*SyncGroupsClientListLogsPager) PageResponse added in v0.3.0

PageResponse returns the current SyncGroupsClientListLogsResponse page.

type SyncGroupsClientListLogsResponse added in v0.3.0

type SyncGroupsClientListLogsResponse struct {
	SyncGroupsClientListLogsResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncGroupsClientListLogsResponse contains the response from method SyncGroupsClient.ListLogs.

type SyncGroupsClientListLogsResult added in v0.3.0

type SyncGroupsClientListLogsResult struct {
	SyncGroupLogListResult
}

SyncGroupsClientListLogsResult contains the result from method SyncGroupsClient.ListLogs.

type SyncGroupsClientListSyncDatabaseIDsOptions added in v0.3.0

type SyncGroupsClientListSyncDatabaseIDsOptions struct {
}

SyncGroupsClientListSyncDatabaseIDsOptions contains the optional parameters for the SyncGroupsClient.ListSyncDatabaseIDs method.

type SyncGroupsClientListSyncDatabaseIDsPager added in v0.3.0

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

SyncGroupsClientListSyncDatabaseIDsPager provides operations for iterating over paged responses.

func (*SyncGroupsClientListSyncDatabaseIDsPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*SyncGroupsClientListSyncDatabaseIDsPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*SyncGroupsClientListSyncDatabaseIDsPager) PageResponse added in v0.3.0

PageResponse returns the current SyncGroupsClientListSyncDatabaseIDsResponse page.

type SyncGroupsClientListSyncDatabaseIDsResponse added in v0.3.0

type SyncGroupsClientListSyncDatabaseIDsResponse struct {
	SyncGroupsClientListSyncDatabaseIDsResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncGroupsClientListSyncDatabaseIDsResponse contains the response from method SyncGroupsClient.ListSyncDatabaseIDs.

type SyncGroupsClientListSyncDatabaseIDsResult added in v0.3.0

type SyncGroupsClientListSyncDatabaseIDsResult struct {
	SyncDatabaseIDListResult
}

SyncGroupsClientListSyncDatabaseIDsResult contains the result from method SyncGroupsClient.ListSyncDatabaseIDs.

type SyncGroupsClientRefreshHubSchemaPoller added in v0.3.0

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

SyncGroupsClientRefreshHubSchemaPoller provides polling facilities until the operation reaches a terminal state.

func (*SyncGroupsClientRefreshHubSchemaPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*SyncGroupsClientRefreshHubSchemaPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final SyncGroupsClientRefreshHubSchemaResponse will be returned.

func (*SyncGroupsClientRefreshHubSchemaPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*SyncGroupsClientRefreshHubSchemaPoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type SyncGroupsClientRefreshHubSchemaPollerResponse added in v0.3.0

type SyncGroupsClientRefreshHubSchemaPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *SyncGroupsClientRefreshHubSchemaPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncGroupsClientRefreshHubSchemaPollerResponse contains the response from method SyncGroupsClient.RefreshHubSchema.

func (SyncGroupsClientRefreshHubSchemaPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*SyncGroupsClientRefreshHubSchemaPollerResponse) Resume added in v0.3.0

Resume rehydrates a SyncGroupsClientRefreshHubSchemaPollerResponse from the provided client and resume token.

type SyncGroupsClientRefreshHubSchemaResponse added in v0.3.0

type SyncGroupsClientRefreshHubSchemaResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncGroupsClientRefreshHubSchemaResponse contains the response from method SyncGroupsClient.RefreshHubSchema.

type SyncGroupsClientTriggerSyncOptions added in v0.3.0

type SyncGroupsClientTriggerSyncOptions struct {
}

SyncGroupsClientTriggerSyncOptions contains the optional parameters for the SyncGroupsClient.TriggerSync method.

type SyncGroupsClientTriggerSyncResponse added in v0.3.0

type SyncGroupsClientTriggerSyncResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncGroupsClientTriggerSyncResponse contains the response from method SyncGroupsClient.TriggerSync.

type SyncGroupsClientUpdatePoller added in v0.3.0

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

SyncGroupsClientUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*SyncGroupsClientUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*SyncGroupsClientUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final SyncGroupsClientUpdateResponse will be returned.

func (*SyncGroupsClientUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*SyncGroupsClientUpdatePoller) ResumeToken added in v0.3.0

func (p *SyncGroupsClientUpdatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type SyncGroupsClientUpdatePollerResponse added in v0.3.0

type SyncGroupsClientUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *SyncGroupsClientUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncGroupsClientUpdatePollerResponse contains the response from method SyncGroupsClient.Update.

func (SyncGroupsClientUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*SyncGroupsClientUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a SyncGroupsClientUpdatePollerResponse from the provided client and resume token.

type SyncGroupsClientUpdateResponse added in v0.3.0

type SyncGroupsClientUpdateResponse struct {
	SyncGroupsClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncGroupsClientUpdateResponse contains the response from method SyncGroupsClient.Update.

type SyncGroupsClientUpdateResult added in v0.3.0

type SyncGroupsClientUpdateResult struct {
	SyncGroup
}

SyncGroupsClientUpdateResult contains the result from method SyncGroupsClient.Update.

type SyncGroupsType added in v0.3.0

type SyncGroupsType string
const (
	SyncGroupsTypeAll     SyncGroupsType = "All"
	SyncGroupsTypeError   SyncGroupsType = "Error"
	SyncGroupsTypeSuccess SyncGroupsType = "Success"
	SyncGroupsTypeWarning SyncGroupsType = "Warning"
)

func PossibleSyncGroupsTypeValues added in v0.3.0

func PossibleSyncGroupsTypeValues() []SyncGroupsType

PossibleSyncGroupsTypeValues returns the possible values for the SyncGroupsType const type.

func (SyncGroupsType) ToPtr added in v0.3.0

func (c SyncGroupsType) ToPtr() *SyncGroupsType

ToPtr returns a *SyncGroupsType pointing to the current value.

type SyncMember

type SyncMember struct {
	// Resource properties.
	Properties *SyncMemberProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

SyncMember - An Azure SQL Database sync member.

func (SyncMember) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncMember.

type SyncMemberDbType

type SyncMemberDbType string

SyncMemberDbType - Type of the sync agent linked database.

const (
	SyncMemberDbTypeAzureSQLDatabase  SyncMemberDbType = "AzureSqlDatabase"
	SyncMemberDbTypeSQLServerDatabase SyncMemberDbType = "SqlServerDatabase"
)

func PossibleSyncMemberDbTypeValues

func PossibleSyncMemberDbTypeValues() []SyncMemberDbType

PossibleSyncMemberDbTypeValues returns the possible values for the SyncMemberDbType const type.

func (SyncMemberDbType) ToPtr

ToPtr returns a *SyncMemberDbType pointing to the current value.

type SyncMemberListResult

type SyncMemberListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*SyncMember `json:"value,omitempty" azure:"ro"`
}

SyncMemberListResult - A list of Azure SQL Database sync members.

func (SyncMemberListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SyncMemberListResult.

type SyncMemberProperties

type SyncMemberProperties struct {
	// Database name of the member database in the sync member.
	DatabaseName *string `json:"databaseName,omitempty"`

	// Database type of the sync member.
	DatabaseType *SyncMemberDbType `json:"databaseType,omitempty"`

	// Password of the member database in the sync member.
	Password *string `json:"password,omitempty"`

	// SQL Server database id of the sync member.
	SQLServerDatabaseID *string `json:"sqlServerDatabaseId,omitempty"`

	// Server name of the member database in the sync member
	ServerName *string `json:"serverName,omitempty"`

	// ARM resource id of the sync agent in the sync member.
	SyncAgentID *string `json:"syncAgentId,omitempty"`

	// Sync direction of the sync member.
	SyncDirection *SyncDirection `json:"syncDirection,omitempty"`

	// ARM resource id of the sync member logical database, for sync members in Azure.
	SyncMemberAzureDatabaseResourceID *string `json:"syncMemberAzureDatabaseResourceId,omitempty"`

	// Whether to use private link connection.
	UsePrivateLinkConnection *bool `json:"usePrivateLinkConnection,omitempty"`

	// User name of the member database in the sync member.
	UserName *string `json:"userName,omitempty"`

	// READ-ONLY; Private endpoint name of the sync member if use private link connection is enabled, for sync members in Azure.
	PrivateEndpointName *string `json:"privateEndpointName,omitempty" azure:"ro"`

	// READ-ONLY; Sync state of the sync member.
	SyncState *SyncMemberState `json:"syncState,omitempty" azure:"ro"`
}

SyncMemberProperties - Properties of a sync member.

type SyncMemberState

type SyncMemberState string

SyncMemberState - Sync state of the sync member.

const (
	SyncMemberStateDeProvisionFailed         SyncMemberState = "DeProvisionFailed"
	SyncMemberStateDeProvisioned             SyncMemberState = "DeProvisioned"
	SyncMemberStateDeProvisioning            SyncMemberState = "DeProvisioning"
	SyncMemberStateDisabledBackupRestore     SyncMemberState = "DisabledBackupRestore"
	SyncMemberStateDisabledTombstoneCleanup  SyncMemberState = "DisabledTombstoneCleanup"
	SyncMemberStateProvisionFailed           SyncMemberState = "ProvisionFailed"
	SyncMemberStateProvisioned               SyncMemberState = "Provisioned"
	SyncMemberStateProvisioning              SyncMemberState = "Provisioning"
	SyncMemberStateReprovisionFailed         SyncMemberState = "ReprovisionFailed"
	SyncMemberStateReprovisioning            SyncMemberState = "Reprovisioning"
	SyncMemberStateSyncCancelled             SyncMemberState = "SyncCancelled"
	SyncMemberStateSyncCancelling            SyncMemberState = "SyncCancelling"
	SyncMemberStateSyncFailed                SyncMemberState = "SyncFailed"
	SyncMemberStateSyncInProgress            SyncMemberState = "SyncInProgress"
	SyncMemberStateSyncSucceeded             SyncMemberState = "SyncSucceeded"
	SyncMemberStateSyncSucceededWithWarnings SyncMemberState = "SyncSucceededWithWarnings"
	SyncMemberStateUnProvisioned             SyncMemberState = "UnProvisioned"
	SyncMemberStateUnReprovisioned           SyncMemberState = "UnReprovisioned"
)

func PossibleSyncMemberStateValues

func PossibleSyncMemberStateValues() []SyncMemberState

PossibleSyncMemberStateValues returns the possible values for the SyncMemberState const type.

func (SyncMemberState) ToPtr

func (c SyncMemberState) ToPtr() *SyncMemberState

ToPtr returns a *SyncMemberState pointing to the current value.

type SyncMembersClient

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

SyncMembersClient contains the methods for the SyncMembers group. Don't use this type directly, use NewSyncMembersClient() instead.

func NewSyncMembersClient

func NewSyncMembersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SyncMembersClient

NewSyncMembersClient creates a new instance of SyncMembersClient with the specified values. subscriptionID - The 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 (*SyncMembersClient) BeginCreateOrUpdate

func (client *SyncMembersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember, options *SyncMembersClientBeginCreateOrUpdateOptions) (SyncMembersClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates a sync member. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group on which the sync member is hosted. syncMemberName - The name of the sync member. parameters - The requested sync member resource state. options - SyncMembersClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncMembersClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberCreate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncMembersClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		"<sync-member-name>",
		armsql.SyncMember{
			Properties: &armsql.SyncMemberProperties{
				DatabaseName:                      to.StringPtr("<database-name>"),
				DatabaseType:                      armsql.SyncMemberDbType("AzureSqlDatabase").ToPtr(),
				ServerName:                        to.StringPtr("<server-name>"),
				SyncDirection:                     armsql.SyncDirection("Bidirectional").ToPtr(),
				SyncMemberAzureDatabaseResourceID: to.StringPtr("<sync-member-azure-database-resource-id>"),
				UsePrivateLinkConnection:          to.BoolPtr(true),
				UserName:                          to.StringPtr("<user-name>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.SyncMembersClientCreateOrUpdateResult)
}
Output:

func (*SyncMembersClient) BeginDelete

func (client *SyncMembersClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, options *SyncMembersClientBeginDeleteOptions) (SyncMembersClientDeletePollerResponse, error)

BeginDelete - Deletes a sync member. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group on which the sync member is hosted. syncMemberName - The name of the sync member. options - SyncMembersClientBeginDeleteOptions contains the optional parameters for the SyncMembersClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncMembersClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		"<sync-member-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*SyncMembersClient) BeginRefreshMemberSchema

func (client *SyncMembersClient) BeginRefreshMemberSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, options *SyncMembersClientBeginRefreshMemberSchemaOptions) (SyncMembersClientRefreshMemberSchemaPollerResponse, error)

BeginRefreshMemberSchema - Refreshes a sync member database schema. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group on which the sync member is hosted. syncMemberName - The name of the sync member. options - SyncMembersClientBeginRefreshMemberSchemaOptions contains the optional parameters for the SyncMembersClient.BeginRefreshMemberSchema method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberRefreshSchema.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncMembersClient("<subscription-id>", cred, nil)
	poller, err := client.BeginRefreshMemberSchema(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		"<sync-member-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*SyncMembersClient) BeginUpdate

func (client *SyncMembersClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember, options *SyncMembersClientBeginUpdateOptions) (SyncMembersClientUpdatePollerResponse, error)

BeginUpdate - Updates an existing sync member. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group on which the sync member is hosted. syncMemberName - The name of the sync member. parameters - The requested sync member resource state. options - SyncMembersClientBeginUpdateOptions contains the optional parameters for the SyncMembersClient.BeginUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberPatch.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncMembersClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		"<sync-member-name>",
		armsql.SyncMember{
			Properties: &armsql.SyncMemberProperties{
				DatabaseName:                      to.StringPtr("<database-name>"),
				DatabaseType:                      armsql.SyncMemberDbType("AzureSqlDatabase").ToPtr(),
				ServerName:                        to.StringPtr("<server-name>"),
				SyncDirection:                     armsql.SyncDirection("Bidirectional").ToPtr(),
				SyncMemberAzureDatabaseResourceID: to.StringPtr("<sync-member-azure-database-resource-id>"),
				UsePrivateLinkConnection:          to.BoolPtr(true),
				UserName:                          to.StringPtr("<user-name>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.SyncMembersClientUpdateResult)
}
Output:

func (*SyncMembersClient) Get

func (client *SyncMembersClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, options *SyncMembersClientGetOptions) (SyncMembersClientGetResponse, error)

Get - Gets a sync member. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group on which the sync member is hosted. syncMemberName - The name of the sync member. options - SyncMembersClientGetOptions contains the optional parameters for the SyncMembersClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncMembersClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		"<sync-member-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.SyncMembersClientGetResult)
}
Output:

func (*SyncMembersClient) ListBySyncGroup

func (client *SyncMembersClient) ListBySyncGroup(resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncMembersClientListBySyncGroupOptions) *SyncMembersClientListBySyncGroupPager

ListBySyncGroup - Lists sync members in the given sync group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group. options - SyncMembersClientListBySyncGroupOptions contains the optional parameters for the SyncMembersClient.ListBySyncGroup method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberListBySyncGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncMembersClient("<subscription-id>", cred, nil)
	pager := client.ListBySyncGroup("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*SyncMembersClient) ListMemberSchemas

func (client *SyncMembersClient) ListMemberSchemas(resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, options *SyncMembersClientListMemberSchemasOptions) *SyncMembersClientListMemberSchemasPager

ListMemberSchemas - Gets a sync member database schema. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database on which the sync group is hosted. syncGroupName - The name of the sync group on which the sync member is hosted. syncMemberName - The name of the sync member. options - SyncMembersClientListMemberSchemasOptions contains the optional parameters for the SyncMembersClient.ListMemberSchemas method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGetSchema.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewSyncMembersClient("<subscription-id>", cred, nil)
	pager := client.ListMemberSchemas("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<sync-group-name>",
		"<sync-member-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type SyncMembersClientBeginCreateOrUpdateOptions added in v0.3.0

type SyncMembersClientBeginCreateOrUpdateOptions struct {
}

SyncMembersClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncMembersClient.BeginCreateOrUpdate method.

type SyncMembersClientBeginDeleteOptions added in v0.3.0

type SyncMembersClientBeginDeleteOptions struct {
}

SyncMembersClientBeginDeleteOptions contains the optional parameters for the SyncMembersClient.BeginDelete method.

type SyncMembersClientBeginRefreshMemberSchemaOptions added in v0.3.0

type SyncMembersClientBeginRefreshMemberSchemaOptions struct {
}

SyncMembersClientBeginRefreshMemberSchemaOptions contains the optional parameters for the SyncMembersClient.BeginRefreshMemberSchema method.

type SyncMembersClientBeginUpdateOptions added in v0.3.0

type SyncMembersClientBeginUpdateOptions struct {
}

SyncMembersClientBeginUpdateOptions contains the optional parameters for the SyncMembersClient.BeginUpdate method.

type SyncMembersClientCreateOrUpdatePoller added in v0.3.0

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

SyncMembersClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*SyncMembersClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*SyncMembersClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final SyncMembersClientCreateOrUpdateResponse will be returned.

func (*SyncMembersClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*SyncMembersClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type SyncMembersClientCreateOrUpdatePollerResponse added in v0.3.0

type SyncMembersClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *SyncMembersClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncMembersClientCreateOrUpdatePollerResponse contains the response from method SyncMembersClient.CreateOrUpdate.

func (SyncMembersClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*SyncMembersClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a SyncMembersClientCreateOrUpdatePollerResponse from the provided client and resume token.

type SyncMembersClientCreateOrUpdateResponse added in v0.3.0

type SyncMembersClientCreateOrUpdateResponse struct {
	SyncMembersClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncMembersClientCreateOrUpdateResponse contains the response from method SyncMembersClient.CreateOrUpdate.

type SyncMembersClientCreateOrUpdateResult added in v0.3.0

type SyncMembersClientCreateOrUpdateResult struct {
	SyncMember
}

SyncMembersClientCreateOrUpdateResult contains the result from method SyncMembersClient.CreateOrUpdate.

type SyncMembersClientDeletePoller added in v0.3.0

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

SyncMembersClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*SyncMembersClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*SyncMembersClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final SyncMembersClientDeleteResponse will be returned.

func (*SyncMembersClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*SyncMembersClientDeletePoller) ResumeToken added in v0.3.0

func (p *SyncMembersClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type SyncMembersClientDeletePollerResponse added in v0.3.0

type SyncMembersClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *SyncMembersClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncMembersClientDeletePollerResponse contains the response from method SyncMembersClient.Delete.

func (SyncMembersClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*SyncMembersClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a SyncMembersClientDeletePollerResponse from the provided client and resume token.

type SyncMembersClientDeleteResponse added in v0.3.0

type SyncMembersClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncMembersClientDeleteResponse contains the response from method SyncMembersClient.Delete.

type SyncMembersClientGetOptions added in v0.3.0

type SyncMembersClientGetOptions struct {
}

SyncMembersClientGetOptions contains the optional parameters for the SyncMembersClient.Get method.

type SyncMembersClientGetResponse added in v0.3.0

type SyncMembersClientGetResponse struct {
	SyncMembersClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncMembersClientGetResponse contains the response from method SyncMembersClient.Get.

type SyncMembersClientGetResult added in v0.3.0

type SyncMembersClientGetResult struct {
	SyncMember
}

SyncMembersClientGetResult contains the result from method SyncMembersClient.Get.

type SyncMembersClientListBySyncGroupOptions added in v0.3.0

type SyncMembersClientListBySyncGroupOptions struct {
}

SyncMembersClientListBySyncGroupOptions contains the optional parameters for the SyncMembersClient.ListBySyncGroup method.

type SyncMembersClientListBySyncGroupPager added in v0.3.0

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

SyncMembersClientListBySyncGroupPager provides operations for iterating over paged responses.

func (*SyncMembersClientListBySyncGroupPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*SyncMembersClientListBySyncGroupPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*SyncMembersClientListBySyncGroupPager) PageResponse added in v0.3.0

PageResponse returns the current SyncMembersClientListBySyncGroupResponse page.

type SyncMembersClientListBySyncGroupResponse added in v0.3.0

type SyncMembersClientListBySyncGroupResponse struct {
	SyncMembersClientListBySyncGroupResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncMembersClientListBySyncGroupResponse contains the response from method SyncMembersClient.ListBySyncGroup.

type SyncMembersClientListBySyncGroupResult added in v0.3.0

type SyncMembersClientListBySyncGroupResult struct {
	SyncMemberListResult
}

SyncMembersClientListBySyncGroupResult contains the result from method SyncMembersClient.ListBySyncGroup.

type SyncMembersClientListMemberSchemasOptions added in v0.3.0

type SyncMembersClientListMemberSchemasOptions struct {
}

SyncMembersClientListMemberSchemasOptions contains the optional parameters for the SyncMembersClient.ListMemberSchemas method.

type SyncMembersClientListMemberSchemasPager added in v0.3.0

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

SyncMembersClientListMemberSchemasPager provides operations for iterating over paged responses.

func (*SyncMembersClientListMemberSchemasPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*SyncMembersClientListMemberSchemasPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*SyncMembersClientListMemberSchemasPager) PageResponse added in v0.3.0

PageResponse returns the current SyncMembersClientListMemberSchemasResponse page.

type SyncMembersClientListMemberSchemasResponse added in v0.3.0

type SyncMembersClientListMemberSchemasResponse struct {
	SyncMembersClientListMemberSchemasResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncMembersClientListMemberSchemasResponse contains the response from method SyncMembersClient.ListMemberSchemas.

type SyncMembersClientListMemberSchemasResult added in v0.3.0

type SyncMembersClientListMemberSchemasResult struct {
	SyncFullSchemaPropertiesListResult
}

SyncMembersClientListMemberSchemasResult contains the result from method SyncMembersClient.ListMemberSchemas.

type SyncMembersClientRefreshMemberSchemaPoller added in v0.3.0

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

SyncMembersClientRefreshMemberSchemaPoller provides polling facilities until the operation reaches a terminal state.

func (*SyncMembersClientRefreshMemberSchemaPoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*SyncMembersClientRefreshMemberSchemaPoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final SyncMembersClientRefreshMemberSchemaResponse will be returned.

func (*SyncMembersClientRefreshMemberSchemaPoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*SyncMembersClientRefreshMemberSchemaPoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type SyncMembersClientRefreshMemberSchemaPollerResponse added in v0.3.0

type SyncMembersClientRefreshMemberSchemaPollerResponse struct {
	// Poller contains an initialized poller.
	Poller *SyncMembersClientRefreshMemberSchemaPoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncMembersClientRefreshMemberSchemaPollerResponse contains the response from method SyncMembersClient.RefreshMemberSchema.

func (SyncMembersClientRefreshMemberSchemaPollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*SyncMembersClientRefreshMemberSchemaPollerResponse) Resume added in v0.3.0

Resume rehydrates a SyncMembersClientRefreshMemberSchemaPollerResponse from the provided client and resume token.

type SyncMembersClientRefreshMemberSchemaResponse added in v0.3.0

type SyncMembersClientRefreshMemberSchemaResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncMembersClientRefreshMemberSchemaResponse contains the response from method SyncMembersClient.RefreshMemberSchema.

type SyncMembersClientUpdatePoller added in v0.3.0

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

SyncMembersClientUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*SyncMembersClientUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*SyncMembersClientUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final SyncMembersClientUpdateResponse will be returned.

func (*SyncMembersClientUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*SyncMembersClientUpdatePoller) ResumeToken added in v0.3.0

func (p *SyncMembersClientUpdatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type SyncMembersClientUpdatePollerResponse added in v0.3.0

type SyncMembersClientUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *SyncMembersClientUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncMembersClientUpdatePollerResponse contains the response from method SyncMembersClient.Update.

func (SyncMembersClientUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*SyncMembersClientUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a SyncMembersClientUpdatePollerResponse from the provided client and resume token.

type SyncMembersClientUpdateResponse added in v0.3.0

type SyncMembersClientUpdateResponse struct {
	SyncMembersClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

SyncMembersClientUpdateResponse contains the response from method SyncMembersClient.Update.

type SyncMembersClientUpdateResult added in v0.3.0

type SyncMembersClientUpdateResult struct {
	SyncMember
}

SyncMembersClientUpdateResult contains the result from method SyncMembersClient.Update.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time `json:"createdAt,omitempty"`

	// The identity that created the resource.
	CreatedBy *string `json:"createdBy,omitempty"`

	// The type of identity that created the resource.
	CreatedByType *CreatedByType `json:"createdByType,omitempty"`

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"`

	// The identity that last modified the resource.
	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"`
}

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 TableTemporalType

type TableTemporalType string

TableTemporalType - The table temporal type.

const (
	TableTemporalTypeHistoryTable                 TableTemporalType = "HistoryTable"
	TableTemporalTypeNonTemporalTable             TableTemporalType = "NonTemporalTable"
	TableTemporalTypeSystemVersionedTemporalTable TableTemporalType = "SystemVersionedTemporalTable"
)

func PossibleTableTemporalTypeValues

func PossibleTableTemporalTypeValues() []TableTemporalType

PossibleTableTemporalTypeValues returns the possible values for the TableTemporalType const type.

func (TableTemporalType) ToPtr

ToPtr returns a *TableTemporalType pointing to the current value.

type TdeCertificate

type TdeCertificate struct {
	// Resource properties.
	Properties *TdeCertificateProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

TdeCertificate - A TDE certificate that can be uploaded into a server.

type TdeCertificateProperties

type TdeCertificateProperties struct {
	// REQUIRED; The base64 encoded certificate private blob.
	PrivateBlob *string `json:"privateBlob,omitempty"`

	// The certificate password.
	CertPassword *string `json:"certPassword,omitempty"`
}

TdeCertificateProperties - Properties of a TDE certificate.

type TdeCertificatesClient

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

TdeCertificatesClient contains the methods for the TdeCertificates group. Don't use this type directly, use NewTdeCertificatesClient() instead.

func NewTdeCertificatesClient

func NewTdeCertificatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *TdeCertificatesClient

NewTdeCertificatesClient creates a new instance of TdeCertificatesClient with the specified values. subscriptionID - The 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 (*TdeCertificatesClient) BeginCreate

func (client *TdeCertificatesClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, parameters TdeCertificate, options *TdeCertificatesClientBeginCreateOptions) (TdeCertificatesClientCreatePollerResponse, error)

BeginCreate - Creates a TDE certificate for a given server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. parameters - The requested TDE certificate to be created or updated. options - TdeCertificatesClientBeginCreateOptions contains the optional parameters for the TdeCertificatesClient.BeginCreate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlTdeCertificateCreate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewTdeCertificatesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreate(ctx,
		"<resource-group-name>",
		"<server-name>",
		armsql.TdeCertificate{
			Properties: &armsql.TdeCertificateProperties{
				PrivateBlob: to.StringPtr("<private-blob>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

type TdeCertificatesClientBeginCreateOptions added in v0.3.0

type TdeCertificatesClientBeginCreateOptions struct {
}

TdeCertificatesClientBeginCreateOptions contains the optional parameters for the TdeCertificatesClient.BeginCreate method.

type TdeCertificatesClientCreatePoller added in v0.3.0

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

TdeCertificatesClientCreatePoller provides polling facilities until the operation reaches a terminal state.

func (*TdeCertificatesClientCreatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*TdeCertificatesClientCreatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final TdeCertificatesClientCreateResponse will be returned.

func (*TdeCertificatesClientCreatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*TdeCertificatesClientCreatePoller) ResumeToken added in v0.3.0

func (p *TdeCertificatesClientCreatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type TdeCertificatesClientCreatePollerResponse added in v0.3.0

type TdeCertificatesClientCreatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *TdeCertificatesClientCreatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

TdeCertificatesClientCreatePollerResponse contains the response from method TdeCertificatesClient.Create.

func (TdeCertificatesClientCreatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*TdeCertificatesClientCreatePollerResponse) Resume added in v0.3.0

Resume rehydrates a TdeCertificatesClientCreatePollerResponse from the provided client and resume token.

type TdeCertificatesClientCreateResponse added in v0.3.0

type TdeCertificatesClientCreateResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

TdeCertificatesClientCreateResponse contains the response from method TdeCertificatesClient.Create.

type TimeZone

type TimeZone struct {
	// Resource properties.
	Properties *TimeZoneProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

TimeZone - Time Zone.

type TimeZoneListResult

type TimeZoneListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*TimeZone `json:"value,omitempty" azure:"ro"`
}

TimeZoneListResult - A list of time zones.

func (TimeZoneListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TimeZoneListResult.

type TimeZoneProperties

type TimeZoneProperties struct {
	// READ-ONLY; The time zone display name
	DisplayName *string `json:"displayName,omitempty" azure:"ro"`

	// READ-ONLY; The time zone id
	TimeZoneID *string `json:"timeZoneId,omitempty" azure:"ro"`
}

TimeZoneProperties - The properties of a time zone.

type TimeZonesClient

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

TimeZonesClient contains the methods for the TimeZones group. Don't use this type directly, use NewTimeZonesClient() instead.

func NewTimeZonesClient

func NewTimeZonesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *TimeZonesClient

NewTimeZonesClient creates a new instance of TimeZonesClient with the specified values. subscriptionID - The 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 (*TimeZonesClient) Get

func (client *TimeZonesClient) Get(ctx context.Context, locationName string, timeZoneID string, options *TimeZonesClientGetOptions) (TimeZonesClientGetResponse, error)

Get - Gets a managed instance time zone. If the operation fails it returns an *azcore.ResponseError type. options - TimeZonesClientGetOptions contains the optional parameters for the TimeZonesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewTimeZonesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<location-name>",
		"<time-zone-id>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.TimeZonesClientGetResult)
}
Output:

func (*TimeZonesClient) ListByLocation

ListByLocation - Gets a list of managed instance time zones by location. If the operation fails it returns an *azcore.ResponseError type. options - TimeZonesClientListByLocationOptions contains the optional parameters for the TimeZonesClient.ListByLocation method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneListByLocation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewTimeZonesClient("<subscription-id>", cred, nil)
	pager := client.ListByLocation("<location-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type TimeZonesClientGetOptions added in v0.3.0

type TimeZonesClientGetOptions struct {
}

TimeZonesClientGetOptions contains the optional parameters for the TimeZonesClient.Get method.

type TimeZonesClientGetResponse added in v0.3.0

type TimeZonesClientGetResponse struct {
	TimeZonesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

TimeZonesClientGetResponse contains the response from method TimeZonesClient.Get.

type TimeZonesClientGetResult added in v0.3.0

type TimeZonesClientGetResult struct {
	TimeZone
}

TimeZonesClientGetResult contains the result from method TimeZonesClient.Get.

type TimeZonesClientListByLocationOptions added in v0.3.0

type TimeZonesClientListByLocationOptions struct {
}

TimeZonesClientListByLocationOptions contains the optional parameters for the TimeZonesClient.ListByLocation method.

type TimeZonesClientListByLocationPager added in v0.3.0

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

TimeZonesClientListByLocationPager provides operations for iterating over paged responses.

func (*TimeZonesClientListByLocationPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*TimeZonesClientListByLocationPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*TimeZonesClientListByLocationPager) PageResponse added in v0.3.0

PageResponse returns the current TimeZonesClientListByLocationResponse page.

type TimeZonesClientListByLocationResponse added in v0.3.0

type TimeZonesClientListByLocationResponse struct {
	TimeZonesClientListByLocationResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

TimeZonesClientListByLocationResponse contains the response from method TimeZonesClient.ListByLocation.

type TimeZonesClientListByLocationResult added in v0.3.0

type TimeZonesClientListByLocationResult struct {
	TimeZoneListResult
}

TimeZonesClientListByLocationResult contains the result from method TimeZonesClient.ListByLocation.

type TopQueries

type TopQueries struct {
	// List of top resource consuming queries with appropriate metric data
	Queries []*QueryStatisticsProperties `json:"queries,omitempty"`

	// READ-ONLY; Aggregation function used to calculate query metrics.
	AggregationFunction *string `json:"aggregationFunction,omitempty" azure:"ro"`

	// READ-ONLY; The end time for the metric (ISO-8601 format).
	EndTime *string `json:"endTime,omitempty" azure:"ro"`

	// READ-ONLY; Interval type (length).
	IntervalType *QueryTimeGrainType `json:"intervalType,omitempty" azure:"ro"`

	// READ-ONLY; Requested number of top queries.
	NumberOfQueries *int32 `json:"numberOfQueries,omitempty" azure:"ro"`

	// READ-ONLY; Metric used to rank queries.
	ObservationMetric *string `json:"observationMetric,omitempty" azure:"ro"`

	// READ-ONLY; The start time for the metric (ISO-8601 format).
	StartTime *string `json:"startTime,omitempty" azure:"ro"`
}

func (TopQueries) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TopQueries.

type TopQueriesListResult

type TopQueriesListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*TopQueries `json:"value,omitempty" azure:"ro"`
}

TopQueriesListResult - A list of top resource consuming queries on managed instance

func (TopQueriesListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TopQueriesListResult.

type TrackedResource

type TrackedResource struct {
	// REQUIRED; Resource location.
	Location *string `json:"location,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

TrackedResource - ARM tracked top level resource.

func (TrackedResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type TrackedResource.

type TransparentDataEncryptionName

type TransparentDataEncryptionName string
const (
	TransparentDataEncryptionNameCurrent TransparentDataEncryptionName = "current"
)

func PossibleTransparentDataEncryptionNameValues

func PossibleTransparentDataEncryptionNameValues() []TransparentDataEncryptionName

PossibleTransparentDataEncryptionNameValues returns the possible values for the TransparentDataEncryptionName const type.

func (TransparentDataEncryptionName) ToPtr

ToPtr returns a *TransparentDataEncryptionName pointing to the current value.

type TransparentDataEncryptionProperties

type TransparentDataEncryptionProperties struct {
	// REQUIRED; Specifies the state of the transparent data encryption.
	State *TransparentDataEncryptionState `json:"state,omitempty"`
}

TransparentDataEncryptionProperties - Properties of a transparent data encryption.

type TransparentDataEncryptionState

type TransparentDataEncryptionState string

TransparentDataEncryptionState - Specifies the state of the transparent data encryption.

const (
	TransparentDataEncryptionStateEnabled  TransparentDataEncryptionState = "Enabled"
	TransparentDataEncryptionStateDisabled TransparentDataEncryptionState = "Disabled"
)

func PossibleTransparentDataEncryptionStateValues

func PossibleTransparentDataEncryptionStateValues() []TransparentDataEncryptionState

PossibleTransparentDataEncryptionStateValues returns the possible values for the TransparentDataEncryptionState const type.

func (TransparentDataEncryptionState) ToPtr

ToPtr returns a *TransparentDataEncryptionState pointing to the current value.

type TransparentDataEncryptionsClient

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

TransparentDataEncryptionsClient contains the methods for the TransparentDataEncryptions group. Don't use this type directly, use NewTransparentDataEncryptionsClient() instead.

func NewTransparentDataEncryptionsClient

func NewTransparentDataEncryptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *TransparentDataEncryptionsClient

NewTransparentDataEncryptionsClient creates a new instance of TransparentDataEncryptionsClient with the specified values. subscriptionID - The 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 (*TransparentDataEncryptionsClient) CreateOrUpdate

CreateOrUpdate - Updates a logical database's transparent data encryption configuration. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the logical database for which the security alert policy is defined. tdeName - The name of the transparent data encryption configuration. parameters - The database transparent data encryption. options - TransparentDataEncryptionsClientCreateOrUpdateOptions contains the optional parameters for the TransparentDataEncryptionsClient.CreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewTransparentDataEncryptionsClient("<subscription-id>", cred, nil)
	res, err := client.CreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.TransparentDataEncryptionName("current"),
		armsql.LogicalDatabaseTransparentDataEncryption{
			Properties: &armsql.TransparentDataEncryptionProperties{
				State: armsql.TransparentDataEncryptionStateEnabled.ToPtr(),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.TransparentDataEncryptionsClientCreateOrUpdateResult)
}
Output:

func (*TransparentDataEncryptionsClient) Get

Get - Gets a logical database's transparent data encryption. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the logical database for which the transparent data encryption is defined. tdeName - The name of the transparent data encryption configuration. options - TransparentDataEncryptionsClientGetOptions contains the optional parameters for the TransparentDataEncryptionsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewTransparentDataEncryptionsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		armsql.TransparentDataEncryptionName("current"),
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.TransparentDataEncryptionsClientGetResult)
}
Output:

func (*TransparentDataEncryptionsClient) ListByDatabase

ListByDatabase - Gets a list of the logical database's transparent data encryption. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the logical database for which the transparent data encryption is defined. options - TransparentDataEncryptionsClientListByDatabaseOptions contains the optional parameters for the TransparentDataEncryptionsClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewTransparentDataEncryptionsClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type TransparentDataEncryptionsClientCreateOrUpdateOptions added in v0.3.0

type TransparentDataEncryptionsClientCreateOrUpdateOptions struct {
}

TransparentDataEncryptionsClientCreateOrUpdateOptions contains the optional parameters for the TransparentDataEncryptionsClient.CreateOrUpdate method.

type TransparentDataEncryptionsClientCreateOrUpdateResponse added in v0.3.0

type TransparentDataEncryptionsClientCreateOrUpdateResponse struct {
	TransparentDataEncryptionsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

TransparentDataEncryptionsClientCreateOrUpdateResponse contains the response from method TransparentDataEncryptionsClient.CreateOrUpdate.

type TransparentDataEncryptionsClientCreateOrUpdateResult added in v0.3.0

type TransparentDataEncryptionsClientCreateOrUpdateResult struct {
	LogicalDatabaseTransparentDataEncryption
}

TransparentDataEncryptionsClientCreateOrUpdateResult contains the result from method TransparentDataEncryptionsClient.CreateOrUpdate.

type TransparentDataEncryptionsClientGetOptions added in v0.3.0

type TransparentDataEncryptionsClientGetOptions struct {
}

TransparentDataEncryptionsClientGetOptions contains the optional parameters for the TransparentDataEncryptionsClient.Get method.

type TransparentDataEncryptionsClientGetResponse added in v0.3.0

type TransparentDataEncryptionsClientGetResponse struct {
	TransparentDataEncryptionsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

TransparentDataEncryptionsClientGetResponse contains the response from method TransparentDataEncryptionsClient.Get.

type TransparentDataEncryptionsClientGetResult added in v0.3.0

type TransparentDataEncryptionsClientGetResult struct {
	LogicalDatabaseTransparentDataEncryption
}

TransparentDataEncryptionsClientGetResult contains the result from method TransparentDataEncryptionsClient.Get.

type TransparentDataEncryptionsClientListByDatabaseOptions added in v0.3.0

type TransparentDataEncryptionsClientListByDatabaseOptions struct {
}

TransparentDataEncryptionsClientListByDatabaseOptions contains the optional parameters for the TransparentDataEncryptionsClient.ListByDatabase method.

type TransparentDataEncryptionsClientListByDatabasePager added in v0.3.0

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

TransparentDataEncryptionsClientListByDatabasePager provides operations for iterating over paged responses.

func (*TransparentDataEncryptionsClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*TransparentDataEncryptionsClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*TransparentDataEncryptionsClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current TransparentDataEncryptionsClientListByDatabaseResponse page.

type TransparentDataEncryptionsClientListByDatabaseResponse added in v0.3.0

type TransparentDataEncryptionsClientListByDatabaseResponse struct {
	TransparentDataEncryptionsClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

TransparentDataEncryptionsClientListByDatabaseResponse contains the response from method TransparentDataEncryptionsClient.ListByDatabase.

type TransparentDataEncryptionsClientListByDatabaseResult added in v0.3.0

type TransparentDataEncryptionsClientListByDatabaseResult struct {
	LogicalDatabaseTransparentDataEncryptionListResult
}

TransparentDataEncryptionsClientListByDatabaseResult contains the result from method TransparentDataEncryptionsClient.ListByDatabase.

type UnitDefinitionType

type UnitDefinitionType string

UnitDefinitionType - The unit of the metric.

const (
	UnitDefinitionTypeBytes          UnitDefinitionType = "Bytes"
	UnitDefinitionTypeBytesPerSecond UnitDefinitionType = "BytesPerSecond"
	UnitDefinitionTypeCount          UnitDefinitionType = "Count"
	UnitDefinitionTypeCountPerSecond UnitDefinitionType = "CountPerSecond"
	UnitDefinitionTypePercent        UnitDefinitionType = "Percent"
	UnitDefinitionTypeSeconds        UnitDefinitionType = "Seconds"
)

func PossibleUnitDefinitionTypeValues

func PossibleUnitDefinitionTypeValues() []UnitDefinitionType

PossibleUnitDefinitionTypeValues returns the possible values for the UnitDefinitionType const type.

func (UnitDefinitionType) ToPtr

ToPtr returns a *UnitDefinitionType pointing to the current value.

type UnitType

type UnitType string

UnitType - The unit of the metric.

const (
	UnitTypeBytes          UnitType = "bytes"
	UnitTypeBytesPerSecond UnitType = "bytesPerSecond"
	UnitTypeCount          UnitType = "count"
	UnitTypeCountPerSecond UnitType = "countPerSecond"
	UnitTypePercent        UnitType = "percent"
	UnitTypeSeconds        UnitType = "seconds"
)

func PossibleUnitTypeValues

func PossibleUnitTypeValues() []UnitType

PossibleUnitTypeValues returns the possible values for the UnitType const type.

func (UnitType) ToPtr

func (c UnitType) ToPtr() *UnitType

ToPtr returns a *UnitType pointing to the current value.

type UnlinkParameters

type UnlinkParameters struct {
	// Determines whether link will be terminated in a forced or a friendly way.
	ForcedTermination *bool `json:"forcedTermination,omitempty"`
}

UnlinkParameters - Represents the parameters for Unlink Replication Link request.

type UpdateLongTermRetentionBackupParameters

type UpdateLongTermRetentionBackupParameters struct {
	// Resource properties.
	Properties *UpdateLongTermRetentionBackupParametersProperties `json:"properties,omitempty"`
}

UpdateLongTermRetentionBackupParameters - Contains the information necessary to perform long term retention backup update operation.

type UpdateLongTermRetentionBackupParametersProperties

type UpdateLongTermRetentionBackupParametersProperties struct {
	// The storage redundancy type of the copied backup
	RequestedBackupStorageRedundancy *BackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"`
}

UpdateLongTermRetentionBackupParametersProperties - Contains the properties to perform long term retention backup copy operation.

type UpdateManagedInstanceDNSServersOperation

type UpdateManagedInstanceDNSServersOperation struct {
	// Resource properties.
	Properties *DNSRefreshConfigurationProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

UpdateManagedInstanceDNSServersOperation - A recoverable managed database resource.

type UpsertManagedServerOperationParameters

type UpsertManagedServerOperationParameters struct {
	Family          *string `json:"family,omitempty"`
	StorageSizeInGB *int32  `json:"storageSizeInGB,omitempty"`
	Tier            *string `json:"tier,omitempty"`
	VCores          *int32  `json:"vCores,omitempty"`
}

type UpsertManagedServerOperationStep

type UpsertManagedServerOperationStep struct {
	Name   *string                                 `json:"name,omitempty"`
	Order  *int32                                  `json:"order,omitempty"`
	Status *UpsertManagedServerOperationStepStatus `json:"status,omitempty"`
}

type UpsertManagedServerOperationStepStatus

type UpsertManagedServerOperationStepStatus string
const (
	UpsertManagedServerOperationStepStatusCanceled   UpsertManagedServerOperationStepStatus = "Canceled"
	UpsertManagedServerOperationStepStatusCompleted  UpsertManagedServerOperationStepStatus = "Completed"
	UpsertManagedServerOperationStepStatusFailed     UpsertManagedServerOperationStepStatus = "Failed"
	UpsertManagedServerOperationStepStatusInProgress UpsertManagedServerOperationStepStatus = "InProgress"
	UpsertManagedServerOperationStepStatusNotStarted UpsertManagedServerOperationStepStatus = "NotStarted"
	UpsertManagedServerOperationStepStatusSlowedDown UpsertManagedServerOperationStepStatus = "SlowedDown"
)

func PossibleUpsertManagedServerOperationStepStatusValues

func PossibleUpsertManagedServerOperationStepStatusValues() []UpsertManagedServerOperationStepStatus

PossibleUpsertManagedServerOperationStepStatusValues returns the possible values for the UpsertManagedServerOperationStepStatus const type.

func (UpsertManagedServerOperationStepStatus) ToPtr

ToPtr returns a *UpsertManagedServerOperationStepStatus pointing to the current value.

type Usage

type Usage struct {
	// READ-ONLY; Usage current value.
	CurrentValue *int32 `json:"currentValue,omitempty" azure:"ro"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Usage limit.
	Limit *int32 `json:"limit,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *Name `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Usage requested limit.
	RequestedLimit *int32 `json:"requestedLimit,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`

	// READ-ONLY; Usage unit.
	Unit *string `json:"unit,omitempty" azure:"ro"`
}

Usage - ARM usage.

type UsageListResult

type UsageListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*Usage `json:"value,omitempty" azure:"ro"`
}

UsageListResult - A list of usages.

func (UsageListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type UsageListResult.

type UsagesClient

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

UsagesClient contains the methods for the Usages group. Don't use this type directly, use NewUsagesClient() instead.

func NewUsagesClient

func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *UsagesClient

NewUsagesClient creates a new instance of UsagesClient with the specified values. subscriptionID - The 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 (*UsagesClient) ListByInstancePool

func (client *UsagesClient) ListByInstancePool(resourceGroupName string, instancePoolName string, options *UsagesClientListByInstancePoolOptions) *UsagesClientListByInstancePoolPager

ListByInstancePool - Gets all instance pool usage metrics If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. instancePoolName - The name of the instance pool to be retrieved. options - UsagesClientListByInstancePoolOptions contains the optional parameters for the UsagesClient.ListByInstancePool method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsageExpanded.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewUsagesClient("<subscription-id>", cred, nil)
	pager := client.ListByInstancePool("<resource-group-name>",
		"<instance-pool-name>",
		&armsql.UsagesClientListByInstancePoolOptions{ExpandChildren: to.BoolPtr(true)})
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type UsagesClientListByInstancePoolOptions added in v0.3.0

type UsagesClientListByInstancePoolOptions struct {
	// Optional request parameter to include managed instance usages within the instance pool.
	ExpandChildren *bool
}

UsagesClientListByInstancePoolOptions contains the optional parameters for the UsagesClient.ListByInstancePool method.

type UsagesClientListByInstancePoolPager added in v0.3.0

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

UsagesClientListByInstancePoolPager provides operations for iterating over paged responses.

func (*UsagesClientListByInstancePoolPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*UsagesClientListByInstancePoolPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*UsagesClientListByInstancePoolPager) PageResponse added in v0.3.0

PageResponse returns the current UsagesClientListByInstancePoolResponse page.

type UsagesClientListByInstancePoolResponse added in v0.3.0

type UsagesClientListByInstancePoolResponse struct {
	UsagesClientListByInstancePoolResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

UsagesClientListByInstancePoolResponse contains the response from method UsagesClient.ListByInstancePool.

type UsagesClientListByInstancePoolResult added in v0.3.0

type UsagesClientListByInstancePoolResult struct {
	UsageListResult
}

UsagesClientListByInstancePoolResult contains the result from method UsagesClient.ListByInstancePool.

type UserIdentity

type UserIdentity struct {
	// READ-ONLY; The Azure Active Directory client id.
	ClientID *string `json:"clientId,omitempty" azure:"ro"`

	// READ-ONLY; The Azure Active Directory principal id.
	PrincipalID *string `json:"principalId,omitempty" azure:"ro"`
}

UserIdentity - Azure Active Directory identity configuration for a resource.

type VirtualCluster

type VirtualCluster struct {
	// REQUIRED; Resource location.
	Location *string `json:"location,omitempty"`

	// Resource properties.
	Properties *VirtualClusterProperties `json:"properties,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

VirtualCluster - An Azure SQL virtual cluster.

func (VirtualCluster) MarshalJSON

func (v VirtualCluster) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualCluster.

type VirtualClusterListResult

type VirtualClusterListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*VirtualCluster `json:"value,omitempty" azure:"ro"`
}

VirtualClusterListResult - A list of virtual clusters.

func (VirtualClusterListResult) MarshalJSON

func (v VirtualClusterListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualClusterListResult.

type VirtualClusterProperties

type VirtualClusterProperties struct {
	// If the service has different generations of hardware, for the same SKU, then that can be captured here.
	Family *string `json:"family,omitempty"`

	// Specifies maintenance configuration id to apply to this virtual cluster.
	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`

	// READ-ONLY; List of resources in this virtual cluster.
	ChildResources []*string `json:"childResources,omitempty" azure:"ro"`

	// READ-ONLY; Subnet resource ID for the virtual cluster.
	SubnetID *string `json:"subnetId,omitempty" azure:"ro"`
}

VirtualClusterProperties - The properties of a virtual cluster.

func (VirtualClusterProperties) MarshalJSON

func (v VirtualClusterProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualClusterProperties.

type VirtualClusterUpdate

type VirtualClusterUpdate struct {
	// Resource properties.
	Properties *VirtualClusterProperties `json:"properties,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`
}

VirtualClusterUpdate - An update request for an Azure SQL Database virtual cluster.

func (VirtualClusterUpdate) MarshalJSON

func (v VirtualClusterUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualClusterUpdate.

type VirtualClustersClient

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

VirtualClustersClient contains the methods for the VirtualClusters group. Don't use this type directly, use NewVirtualClustersClient() instead.

func NewVirtualClustersClient

func NewVirtualClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *VirtualClustersClient

NewVirtualClustersClient creates a new instance of VirtualClustersClient with the specified values. subscriptionID - The 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 (*VirtualClustersClient) BeginDelete

func (client *VirtualClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientBeginDeleteOptions) (VirtualClustersClientDeletePollerResponse, error)

BeginDelete - Deletes a virtual cluster. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. virtualClusterName - The name of the virtual cluster. options - VirtualClustersClientBeginDeleteOptions contains the optional parameters for the VirtualClustersClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewVirtualClustersClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<virtual-cluster-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*VirtualClustersClient) BeginUpdate

func (client *VirtualClustersClient) BeginUpdate(ctx context.Context, resourceGroupName string, virtualClusterName string, parameters VirtualClusterUpdate, options *VirtualClustersClientBeginUpdateOptions) (VirtualClustersClientUpdatePollerResponse, error)

BeginUpdate - Updates a virtual cluster. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. virtualClusterName - The name of the virtual cluster. parameters - The requested virtual cluster resource state. options - VirtualClustersClientBeginUpdateOptions contains the optional parameters for the VirtualClustersClient.BeginUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewVirtualClustersClient("<subscription-id>", cred, nil)
	poller, err := client.BeginUpdate(ctx,
		"<resource-group-name>",
		"<virtual-cluster-name>",
		armsql.VirtualClusterUpdate{
			Properties: &armsql.VirtualClusterProperties{
				MaintenanceConfigurationID: to.StringPtr("<maintenance-configuration-id>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.VirtualClustersClientUpdateResult)
}
Output:

func (*VirtualClustersClient) Get

func (client *VirtualClustersClient) Get(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientGetOptions) (VirtualClustersClientGetResponse, error)

Get - Gets a virtual cluster. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. virtualClusterName - The name of the virtual cluster. options - VirtualClustersClientGetOptions contains the optional parameters for the VirtualClustersClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewVirtualClustersClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<virtual-cluster-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.VirtualClustersClientGetResult)
}
Output:

func (*VirtualClustersClient) List

List - Gets a list of all virtualClusters in the subscription. If the operation fails it returns an *azcore.ResponseError type. options - VirtualClustersClientListOptions contains the optional parameters for the VirtualClustersClient.List method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewVirtualClustersClient("<subscription-id>", cred, nil)
	pager := client.List(nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*VirtualClustersClient) ListByResourceGroup

ListByResourceGroup - Gets a list of virtual clusters in a resource group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. options - VirtualClustersClientListByResourceGroupOptions contains the optional parameters for the VirtualClustersClient.ListByResourceGroup method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewVirtualClustersClient("<subscription-id>", cred, nil)
	pager := client.ListByResourceGroup("<resource-group-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

func (*VirtualClustersClient) UpdateDNSServers

func (client *VirtualClustersClient) UpdateDNSServers(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientUpdateDNSServersOptions) (VirtualClustersClientUpdateDNSServersResponse, error)

UpdateDNSServers - Synchronizes the DNS server settings used by the managed instances inside the given virtual cluster. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. virtualClusterName - The name of the virtual cluster. options - VirtualClustersClientUpdateDNSServersOptions contains the optional parameters for the VirtualClustersClient.UpdateDNSServers method.

type VirtualClustersClientBeginDeleteOptions added in v0.3.0

type VirtualClustersClientBeginDeleteOptions struct {
}

VirtualClustersClientBeginDeleteOptions contains the optional parameters for the VirtualClustersClient.BeginDelete method.

type VirtualClustersClientBeginUpdateOptions added in v0.3.0

type VirtualClustersClientBeginUpdateOptions struct {
}

VirtualClustersClientBeginUpdateOptions contains the optional parameters for the VirtualClustersClient.BeginUpdate method.

type VirtualClustersClientDeletePoller added in v0.3.0

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

VirtualClustersClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*VirtualClustersClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*VirtualClustersClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final VirtualClustersClientDeleteResponse will be returned.

func (*VirtualClustersClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*VirtualClustersClientDeletePoller) ResumeToken added in v0.3.0

func (p *VirtualClustersClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type VirtualClustersClientDeletePollerResponse added in v0.3.0

type VirtualClustersClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *VirtualClustersClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

VirtualClustersClientDeletePollerResponse contains the response from method VirtualClustersClient.Delete.

func (VirtualClustersClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*VirtualClustersClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a VirtualClustersClientDeletePollerResponse from the provided client and resume token.

type VirtualClustersClientDeleteResponse added in v0.3.0

type VirtualClustersClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

VirtualClustersClientDeleteResponse contains the response from method VirtualClustersClient.Delete.

type VirtualClustersClientGetOptions added in v0.3.0

type VirtualClustersClientGetOptions struct {
}

VirtualClustersClientGetOptions contains the optional parameters for the VirtualClustersClient.Get method.

type VirtualClustersClientGetResponse added in v0.3.0

type VirtualClustersClientGetResponse struct {
	VirtualClustersClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

VirtualClustersClientGetResponse contains the response from method VirtualClustersClient.Get.

type VirtualClustersClientGetResult added in v0.3.0

type VirtualClustersClientGetResult struct {
	VirtualCluster
}

VirtualClustersClientGetResult contains the result from method VirtualClustersClient.Get.

type VirtualClustersClientListByResourceGroupOptions added in v0.3.0

type VirtualClustersClientListByResourceGroupOptions struct {
}

VirtualClustersClientListByResourceGroupOptions contains the optional parameters for the VirtualClustersClient.ListByResourceGroup method.

type VirtualClustersClientListByResourceGroupPager added in v0.3.0

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

VirtualClustersClientListByResourceGroupPager provides operations for iterating over paged responses.

func (*VirtualClustersClientListByResourceGroupPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*VirtualClustersClientListByResourceGroupPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*VirtualClustersClientListByResourceGroupPager) PageResponse added in v0.3.0

PageResponse returns the current VirtualClustersClientListByResourceGroupResponse page.

type VirtualClustersClientListByResourceGroupResponse added in v0.3.0

type VirtualClustersClientListByResourceGroupResponse struct {
	VirtualClustersClientListByResourceGroupResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

VirtualClustersClientListByResourceGroupResponse contains the response from method VirtualClustersClient.ListByResourceGroup.

type VirtualClustersClientListByResourceGroupResult added in v0.3.0

type VirtualClustersClientListByResourceGroupResult struct {
	VirtualClusterListResult
}

VirtualClustersClientListByResourceGroupResult contains the result from method VirtualClustersClient.ListByResourceGroup.

type VirtualClustersClientListOptions added in v0.3.0

type VirtualClustersClientListOptions struct {
}

VirtualClustersClientListOptions contains the optional parameters for the VirtualClustersClient.List method.

type VirtualClustersClientListPager added in v0.3.0

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

VirtualClustersClientListPager provides operations for iterating over paged responses.

func (*VirtualClustersClientListPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*VirtualClustersClientListPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*VirtualClustersClientListPager) PageResponse added in v0.3.0

PageResponse returns the current VirtualClustersClientListResponse page.

type VirtualClustersClientListResponse added in v0.3.0

type VirtualClustersClientListResponse struct {
	VirtualClustersClientListResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

VirtualClustersClientListResponse contains the response from method VirtualClustersClient.List.

type VirtualClustersClientListResult added in v0.3.0

type VirtualClustersClientListResult struct {
	VirtualClusterListResult
}

VirtualClustersClientListResult contains the result from method VirtualClustersClient.List.

type VirtualClustersClientUpdateDNSServersOptions added in v0.3.0

type VirtualClustersClientUpdateDNSServersOptions struct {
}

VirtualClustersClientUpdateDNSServersOptions contains the optional parameters for the VirtualClustersClient.UpdateDNSServers method.

type VirtualClustersClientUpdateDNSServersResponse added in v0.3.0

type VirtualClustersClientUpdateDNSServersResponse struct {
	VirtualClustersClientUpdateDNSServersResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

VirtualClustersClientUpdateDNSServersResponse contains the response from method VirtualClustersClient.UpdateDNSServers.

type VirtualClustersClientUpdateDNSServersResult added in v0.3.0

type VirtualClustersClientUpdateDNSServersResult struct {
	UpdateManagedInstanceDNSServersOperation
}

VirtualClustersClientUpdateDNSServersResult contains the result from method VirtualClustersClient.UpdateDNSServers.

type VirtualClustersClientUpdatePoller added in v0.3.0

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

VirtualClustersClientUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*VirtualClustersClientUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*VirtualClustersClientUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final VirtualClustersClientUpdateResponse will be returned.

func (*VirtualClustersClientUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*VirtualClustersClientUpdatePoller) ResumeToken added in v0.3.0

func (p *VirtualClustersClientUpdatePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type VirtualClustersClientUpdatePollerResponse added in v0.3.0

type VirtualClustersClientUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *VirtualClustersClientUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

VirtualClustersClientUpdatePollerResponse contains the response from method VirtualClustersClient.Update.

func (VirtualClustersClientUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*VirtualClustersClientUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a VirtualClustersClientUpdatePollerResponse from the provided client and resume token.

type VirtualClustersClientUpdateResponse added in v0.3.0

type VirtualClustersClientUpdateResponse struct {
	VirtualClustersClientUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

VirtualClustersClientUpdateResponse contains the response from method VirtualClustersClient.Update.

type VirtualClustersClientUpdateResult added in v0.3.0

type VirtualClustersClientUpdateResult struct {
	VirtualCluster
}

VirtualClustersClientUpdateResult contains the result from method VirtualClustersClient.Update.

type VirtualNetworkRule

type VirtualNetworkRule struct {
	// Resource properties.
	Properties *VirtualNetworkRuleProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

VirtualNetworkRule - A virtual network rule.

type VirtualNetworkRuleListResult

type VirtualNetworkRuleListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*VirtualNetworkRule `json:"value,omitempty" azure:"ro"`
}

VirtualNetworkRuleListResult - A list of virtual network rules.

func (VirtualNetworkRuleListResult) MarshalJSON

func (v VirtualNetworkRuleListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleListResult.

type VirtualNetworkRuleProperties

type VirtualNetworkRuleProperties struct {
	// REQUIRED; The ARM resource id of the virtual network subnet.
	VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"`

	// Create firewall rule before the virtual network has vnet service endpoint enabled.
	IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"`

	// READ-ONLY; Virtual Network Rule State
	State *VirtualNetworkRuleState `json:"state,omitempty" azure:"ro"`
}

VirtualNetworkRuleProperties - Properties of a virtual network rule.

type VirtualNetworkRuleState

type VirtualNetworkRuleState string

VirtualNetworkRuleState - Virtual Network Rule State

const (
	VirtualNetworkRuleStateDeleting     VirtualNetworkRuleState = "Deleting"
	VirtualNetworkRuleStateFailed       VirtualNetworkRuleState = "Failed"
	VirtualNetworkRuleStateInProgress   VirtualNetworkRuleState = "InProgress"
	VirtualNetworkRuleStateInitializing VirtualNetworkRuleState = "Initializing"
	VirtualNetworkRuleStateReady        VirtualNetworkRuleState = "Ready"
	VirtualNetworkRuleStateUnknown      VirtualNetworkRuleState = "Unknown"
)

func PossibleVirtualNetworkRuleStateValues

func PossibleVirtualNetworkRuleStateValues() []VirtualNetworkRuleState

PossibleVirtualNetworkRuleStateValues returns the possible values for the VirtualNetworkRuleState const type.

func (VirtualNetworkRuleState) ToPtr

ToPtr returns a *VirtualNetworkRuleState pointing to the current value.

type VirtualNetworkRulesClient

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

VirtualNetworkRulesClient contains the methods for the VirtualNetworkRules group. Don't use this type directly, use NewVirtualNetworkRulesClient() instead.

func NewVirtualNetworkRulesClient

func NewVirtualNetworkRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *VirtualNetworkRulesClient

NewVirtualNetworkRulesClient creates a new instance of VirtualNetworkRulesClient with the specified values. subscriptionID - The 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 (*VirtualNetworkRulesClient) BeginCreateOrUpdate

func (client *VirtualNetworkRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule, options *VirtualNetworkRulesClientBeginCreateOrUpdateOptions) (VirtualNetworkRulesClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates an existing virtual network rule. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. virtualNetworkRuleName - The name of the virtual network rule. parameters - The requested virtual Network Rule Resource state. options - VirtualNetworkRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesCreateOrUpdate.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewVirtualNetworkRulesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<virtual-network-rule-name>",
		armsql.VirtualNetworkRule{
			Properties: &armsql.VirtualNetworkRuleProperties{
				IgnoreMissingVnetServiceEndpoint: to.BoolPtr(false),
				VirtualNetworkSubnetID:           to.StringPtr("<virtual-network-subnet-id>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.VirtualNetworkRulesClientCreateOrUpdateResult)
}
Output:

func (*VirtualNetworkRulesClient) BeginDelete

func (client *VirtualNetworkRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientBeginDeleteOptions) (VirtualNetworkRulesClientDeletePollerResponse, error)

BeginDelete - Deletes the virtual network rule with the given name. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. virtualNetworkRuleName - The name of the virtual network rule. options - VirtualNetworkRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesDelete.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewVirtualNetworkRulesClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<virtual-network-rule-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*VirtualNetworkRulesClient) Get

func (client *VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientGetOptions) (VirtualNetworkRulesClientGetResponse, error)

Get - Gets a virtual network rule. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. virtualNetworkRuleName - The name of the virtual network rule. options - VirtualNetworkRulesClientGetOptions contains the optional parameters for the VirtualNetworkRulesClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewVirtualNetworkRulesClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<virtual-network-rule-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.VirtualNetworkRulesClientGetResult)
}
Output:

func (*VirtualNetworkRulesClient) ListByServer

ListByServer - Gets a list of virtual network rules in a server. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. options - VirtualNetworkRulesClientListByServerOptions contains the optional parameters for the VirtualNetworkRulesClient.ListByServer method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewVirtualNetworkRulesClient("<subscription-id>", cred, nil)
	pager := client.ListByServer("<resource-group-name>",
		"<server-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type VirtualNetworkRulesClientBeginCreateOrUpdateOptions added in v0.3.0

type VirtualNetworkRulesClientBeginCreateOrUpdateOptions struct {
}

VirtualNetworkRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginCreateOrUpdate method.

type VirtualNetworkRulesClientBeginDeleteOptions added in v0.3.0

type VirtualNetworkRulesClientBeginDeleteOptions struct {
}

VirtualNetworkRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginDelete method.

type VirtualNetworkRulesClientCreateOrUpdatePoller added in v0.3.0

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

VirtualNetworkRulesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*VirtualNetworkRulesClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*VirtualNetworkRulesClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final VirtualNetworkRulesClientCreateOrUpdateResponse will be returned.

func (*VirtualNetworkRulesClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*VirtualNetworkRulesClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type VirtualNetworkRulesClientCreateOrUpdatePollerResponse added in v0.3.0

type VirtualNetworkRulesClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *VirtualNetworkRulesClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

VirtualNetworkRulesClientCreateOrUpdatePollerResponse contains the response from method VirtualNetworkRulesClient.CreateOrUpdate.

func (VirtualNetworkRulesClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*VirtualNetworkRulesClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a VirtualNetworkRulesClientCreateOrUpdatePollerResponse from the provided client and resume token.

type VirtualNetworkRulesClientCreateOrUpdateResponse added in v0.3.0

type VirtualNetworkRulesClientCreateOrUpdateResponse struct {
	VirtualNetworkRulesClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

VirtualNetworkRulesClientCreateOrUpdateResponse contains the response from method VirtualNetworkRulesClient.CreateOrUpdate.

type VirtualNetworkRulesClientCreateOrUpdateResult added in v0.3.0

type VirtualNetworkRulesClientCreateOrUpdateResult struct {
	VirtualNetworkRule
}

VirtualNetworkRulesClientCreateOrUpdateResult contains the result from method VirtualNetworkRulesClient.CreateOrUpdate.

type VirtualNetworkRulesClientDeletePoller added in v0.3.0

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

VirtualNetworkRulesClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*VirtualNetworkRulesClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*VirtualNetworkRulesClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final VirtualNetworkRulesClientDeleteResponse will be returned.

func (*VirtualNetworkRulesClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*VirtualNetworkRulesClientDeletePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type VirtualNetworkRulesClientDeletePollerResponse added in v0.3.0

type VirtualNetworkRulesClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *VirtualNetworkRulesClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

VirtualNetworkRulesClientDeletePollerResponse contains the response from method VirtualNetworkRulesClient.Delete.

func (VirtualNetworkRulesClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*VirtualNetworkRulesClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a VirtualNetworkRulesClientDeletePollerResponse from the provided client and resume token.

type VirtualNetworkRulesClientDeleteResponse added in v0.3.0

type VirtualNetworkRulesClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

VirtualNetworkRulesClientDeleteResponse contains the response from method VirtualNetworkRulesClient.Delete.

type VirtualNetworkRulesClientGetOptions added in v0.3.0

type VirtualNetworkRulesClientGetOptions struct {
}

VirtualNetworkRulesClientGetOptions contains the optional parameters for the VirtualNetworkRulesClient.Get method.

type VirtualNetworkRulesClientGetResponse added in v0.3.0

type VirtualNetworkRulesClientGetResponse struct {
	VirtualNetworkRulesClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

VirtualNetworkRulesClientGetResponse contains the response from method VirtualNetworkRulesClient.Get.

type VirtualNetworkRulesClientGetResult added in v0.3.0

type VirtualNetworkRulesClientGetResult struct {
	VirtualNetworkRule
}

VirtualNetworkRulesClientGetResult contains the result from method VirtualNetworkRulesClient.Get.

type VirtualNetworkRulesClientListByServerOptions added in v0.3.0

type VirtualNetworkRulesClientListByServerOptions struct {
}

VirtualNetworkRulesClientListByServerOptions contains the optional parameters for the VirtualNetworkRulesClient.ListByServer method.

type VirtualNetworkRulesClientListByServerPager added in v0.3.0

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

VirtualNetworkRulesClientListByServerPager provides operations for iterating over paged responses.

func (*VirtualNetworkRulesClientListByServerPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*VirtualNetworkRulesClientListByServerPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*VirtualNetworkRulesClientListByServerPager) PageResponse added in v0.3.0

PageResponse returns the current VirtualNetworkRulesClientListByServerResponse page.

type VirtualNetworkRulesClientListByServerResponse added in v0.3.0

type VirtualNetworkRulesClientListByServerResponse struct {
	VirtualNetworkRulesClientListByServerResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

VirtualNetworkRulesClientListByServerResponse contains the response from method VirtualNetworkRulesClient.ListByServer.

type VirtualNetworkRulesClientListByServerResult added in v0.3.0

type VirtualNetworkRulesClientListByServerResult struct {
	VirtualNetworkRuleListResult
}

VirtualNetworkRulesClientListByServerResult contains the result from method VirtualNetworkRulesClient.ListByServer.

type VulnerabilityAssessmentName

type VulnerabilityAssessmentName string
const (
	VulnerabilityAssessmentNameDefault VulnerabilityAssessmentName = "default"
)

func PossibleVulnerabilityAssessmentNameValues

func PossibleVulnerabilityAssessmentNameValues() []VulnerabilityAssessmentName

PossibleVulnerabilityAssessmentNameValues returns the possible values for the VulnerabilityAssessmentName const type.

func (VulnerabilityAssessmentName) ToPtr

ToPtr returns a *VulnerabilityAssessmentName pointing to the current value.

type VulnerabilityAssessmentPolicyBaselineName

type VulnerabilityAssessmentPolicyBaselineName string
const (
	VulnerabilityAssessmentPolicyBaselineNameMaster  VulnerabilityAssessmentPolicyBaselineName = "master"
	VulnerabilityAssessmentPolicyBaselineNameDefault VulnerabilityAssessmentPolicyBaselineName = "default"
)

func PossibleVulnerabilityAssessmentPolicyBaselineNameValues

func PossibleVulnerabilityAssessmentPolicyBaselineNameValues() []VulnerabilityAssessmentPolicyBaselineName

PossibleVulnerabilityAssessmentPolicyBaselineNameValues returns the possible values for the VulnerabilityAssessmentPolicyBaselineName const type.

func (VulnerabilityAssessmentPolicyBaselineName) ToPtr

ToPtr returns a *VulnerabilityAssessmentPolicyBaselineName pointing to the current value.

type VulnerabilityAssessmentRecurringScansProperties

type VulnerabilityAssessmentRecurringScansProperties struct {
	// Specifies that the schedule scan notification will be is sent to the subscription administrators.
	EmailSubscriptionAdmins *bool `json:"emailSubscriptionAdmins,omitempty"`

	// Specifies an array of e-mail addresses to which the scan notification is sent.
	Emails []*string `json:"emails,omitempty"`

	// Recurring scans state.
	IsEnabled *bool `json:"isEnabled,omitempty"`
}

VulnerabilityAssessmentRecurringScansProperties - Properties of a Vulnerability Assessment recurring scans.

func (VulnerabilityAssessmentRecurringScansProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentRecurringScansProperties.

type VulnerabilityAssessmentScanError

type VulnerabilityAssessmentScanError struct {
	// READ-ONLY; The error code.
	Code *string `json:"code,omitempty" azure:"ro"`

	// READ-ONLY; The error message.
	Message *string `json:"message,omitempty" azure:"ro"`
}

VulnerabilityAssessmentScanError - Properties of a vulnerability assessment scan error.

type VulnerabilityAssessmentScanRecord

type VulnerabilityAssessmentScanRecord struct {
	// Resource properties.
	Properties *VulnerabilityAssessmentScanRecordProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

VulnerabilityAssessmentScanRecord - A vulnerability assessment scan record.

type VulnerabilityAssessmentScanRecordListResult

type VulnerabilityAssessmentScanRecordListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*VulnerabilityAssessmentScanRecord `json:"value,omitempty" azure:"ro"`
}

VulnerabilityAssessmentScanRecordListResult - A list of vulnerability assessment scan records.

func (VulnerabilityAssessmentScanRecordListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecordListResult.

type VulnerabilityAssessmentScanRecordProperties

type VulnerabilityAssessmentScanRecordProperties struct {
	// READ-ONLY; The scan end time (UTC).
	EndTime *time.Time `json:"endTime,omitempty" azure:"ro"`

	// READ-ONLY; The scan errors.
	Errors []*VulnerabilityAssessmentScanError `json:"errors,omitempty" azure:"ro"`

	// READ-ONLY; The number of failed security checks.
	NumberOfFailedSecurityChecks *int32 `json:"numberOfFailedSecurityChecks,omitempty" azure:"ro"`

	// READ-ONLY; The scan ID.
	ScanID *string `json:"scanId,omitempty" azure:"ro"`

	// READ-ONLY; The scan start time (UTC).
	StartTime *time.Time `json:"startTime,omitempty" azure:"ro"`

	// READ-ONLY; The scan status.
	State *VulnerabilityAssessmentScanState `json:"state,omitempty" azure:"ro"`

	// READ-ONLY; The scan results storage container path.
	StorageContainerPath *string `json:"storageContainerPath,omitempty" azure:"ro"`

	// READ-ONLY; The scan trigger type.
	TriggerType *VulnerabilityAssessmentScanTriggerType `json:"triggerType,omitempty" azure:"ro"`
}

VulnerabilityAssessmentScanRecordProperties - Properties of a vulnerability assessment scan record.

func (VulnerabilityAssessmentScanRecordProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecordProperties.

func (*VulnerabilityAssessmentScanRecordProperties) UnmarshalJSON

func (v *VulnerabilityAssessmentScanRecordProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecordProperties.

type VulnerabilityAssessmentScanState

type VulnerabilityAssessmentScanState string

VulnerabilityAssessmentScanState - The scan status.

const (
	VulnerabilityAssessmentScanStateFailed      VulnerabilityAssessmentScanState = "Failed"
	VulnerabilityAssessmentScanStateFailedToRun VulnerabilityAssessmentScanState = "FailedToRun"
	VulnerabilityAssessmentScanStateInProgress  VulnerabilityAssessmentScanState = "InProgress"
	VulnerabilityAssessmentScanStatePassed      VulnerabilityAssessmentScanState = "Passed"
)

func PossibleVulnerabilityAssessmentScanStateValues

func PossibleVulnerabilityAssessmentScanStateValues() []VulnerabilityAssessmentScanState

PossibleVulnerabilityAssessmentScanStateValues returns the possible values for the VulnerabilityAssessmentScanState const type.

func (VulnerabilityAssessmentScanState) ToPtr

ToPtr returns a *VulnerabilityAssessmentScanState pointing to the current value.

type VulnerabilityAssessmentScanTriggerType

type VulnerabilityAssessmentScanTriggerType string

VulnerabilityAssessmentScanTriggerType - The scan trigger type.

const (
	VulnerabilityAssessmentScanTriggerTypeOnDemand  VulnerabilityAssessmentScanTriggerType = "OnDemand"
	VulnerabilityAssessmentScanTriggerTypeRecurring VulnerabilityAssessmentScanTriggerType = "Recurring"
)

func PossibleVulnerabilityAssessmentScanTriggerTypeValues

func PossibleVulnerabilityAssessmentScanTriggerTypeValues() []VulnerabilityAssessmentScanTriggerType

PossibleVulnerabilityAssessmentScanTriggerTypeValues returns the possible values for the VulnerabilityAssessmentScanTriggerType const type.

func (VulnerabilityAssessmentScanTriggerType) ToPtr

ToPtr returns a *VulnerabilityAssessmentScanTriggerType pointing to the current value.

type WorkloadClassifier

type WorkloadClassifier struct {
	// Resource properties.
	Properties *WorkloadClassifierProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

WorkloadClassifier - Workload classifier operations for a data warehouse

type WorkloadClassifierListResult

type WorkloadClassifierListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*WorkloadClassifier `json:"value,omitempty" azure:"ro"`
}

WorkloadClassifierListResult - A list of workload classifiers for a workload group.

func (WorkloadClassifierListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type WorkloadClassifierListResult.

type WorkloadClassifierProperties

type WorkloadClassifierProperties struct {
	// REQUIRED; The workload classifier member name.
	MemberName *string `json:"memberName,omitempty"`

	// The workload classifier context.
	Context *string `json:"context,omitempty"`

	// The workload classifier end time for classification.
	EndTime *string `json:"endTime,omitempty"`

	// The workload classifier importance.
	Importance *string `json:"importance,omitempty"`

	// The workload classifier label.
	Label *string `json:"label,omitempty"`

	// The workload classifier start time for classification.
	StartTime *string `json:"startTime,omitempty"`
}

WorkloadClassifierProperties - Workload classifier definition. For more information look at sys.workloadmanagementworkload_classifiers (DMV).

type WorkloadClassifiersClient

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

WorkloadClassifiersClient contains the methods for the WorkloadClassifiers group. Don't use this type directly, use NewWorkloadClassifiersClient() instead.

func NewWorkloadClassifiersClient

func NewWorkloadClassifiersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *WorkloadClassifiersClient

NewWorkloadClassifiersClient creates a new instance of WorkloadClassifiersClient with the specified values. subscriptionID - The 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 (*WorkloadClassifiersClient) BeginCreateOrUpdate

func (client *WorkloadClassifiersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, workloadClassifierName string, parameters WorkloadClassifier, options *WorkloadClassifiersClientBeginCreateOrUpdateOptions) (WorkloadClassifiersClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates a workload classifier. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. workloadGroupName - The name of the workload group from which to receive the classifier from. workloadClassifierName - The name of the workload classifier to create/update. parameters - The properties of the workload classifier. options - WorkloadClassifiersClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkloadClassifiersClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadClassifierMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewWorkloadClassifiersClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<workload-group-name>",
		"<workload-classifier-name>",
		armsql.WorkloadClassifier{
			Properties: &armsql.WorkloadClassifierProperties{
				Context:    to.StringPtr("<context>"),
				EndTime:    to.StringPtr("<end-time>"),
				Importance: to.StringPtr("<importance>"),
				Label:      to.StringPtr("<label>"),
				MemberName: to.StringPtr("<member-name>"),
				StartTime:  to.StringPtr("<start-time>"),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.WorkloadClassifiersClientCreateOrUpdateResult)
}
Output:

func (*WorkloadClassifiersClient) BeginDelete

func (client *WorkloadClassifiersClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, workloadClassifierName string, options *WorkloadClassifiersClientBeginDeleteOptions) (WorkloadClassifiersClientDeletePollerResponse, error)

BeginDelete - Deletes a workload classifier. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. workloadGroupName - The name of the workload group from which to receive the classifier from. workloadClassifierName - The name of the workload classifier to delete. options - WorkloadClassifiersClientBeginDeleteOptions contains the optional parameters for the WorkloadClassifiersClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadClassifier.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewWorkloadClassifiersClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<workload-group-name>",
		"<workload-classifier-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*WorkloadClassifiersClient) Get

func (client *WorkloadClassifiersClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, workloadClassifierName string, options *WorkloadClassifiersClientGetOptions) (WorkloadClassifiersClientGetResponse, error)

Get - Gets a workload classifier If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. workloadGroupName - The name of the workload group from which to receive the classifier from. workloadClassifierName - The name of the workload classifier. options - WorkloadClassifiersClientGetOptions contains the optional parameters for the WorkloadClassifiersClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifier.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewWorkloadClassifiersClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<workload-group-name>",
		"<workload-classifier-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.WorkloadClassifiersClientGetResult)
}
Output:

func (*WorkloadClassifiersClient) ListByWorkloadGroup

func (client *WorkloadClassifiersClient) ListByWorkloadGroup(resourceGroupName string, serverName string, databaseName string, workloadGroupName string, options *WorkloadClassifiersClientListByWorkloadGroupOptions) *WorkloadClassifiersClientListByWorkloadGroupPager

ListByWorkloadGroup - Gets the list of workload classifiers for a workload group If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. workloadGroupName - The name of the workload group from which to receive the classifiers from. options - WorkloadClassifiersClientListByWorkloadGroupOptions contains the optional parameters for the WorkloadClassifiersClient.ListByWorkloadGroup method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifierList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewWorkloadClassifiersClient("<subscription-id>", cred, nil)
	pager := client.ListByWorkloadGroup("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<workload-group-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type WorkloadClassifiersClientBeginCreateOrUpdateOptions added in v0.3.0

type WorkloadClassifiersClientBeginCreateOrUpdateOptions struct {
}

WorkloadClassifiersClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkloadClassifiersClient.BeginCreateOrUpdate method.

type WorkloadClassifiersClientBeginDeleteOptions added in v0.3.0

type WorkloadClassifiersClientBeginDeleteOptions struct {
}

WorkloadClassifiersClientBeginDeleteOptions contains the optional parameters for the WorkloadClassifiersClient.BeginDelete method.

type WorkloadClassifiersClientCreateOrUpdatePoller added in v0.3.0

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

WorkloadClassifiersClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*WorkloadClassifiersClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*WorkloadClassifiersClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final WorkloadClassifiersClientCreateOrUpdateResponse will be returned.

func (*WorkloadClassifiersClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*WorkloadClassifiersClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type WorkloadClassifiersClientCreateOrUpdatePollerResponse added in v0.3.0

type WorkloadClassifiersClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *WorkloadClassifiersClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

WorkloadClassifiersClientCreateOrUpdatePollerResponse contains the response from method WorkloadClassifiersClient.CreateOrUpdate.

func (WorkloadClassifiersClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*WorkloadClassifiersClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a WorkloadClassifiersClientCreateOrUpdatePollerResponse from the provided client and resume token.

type WorkloadClassifiersClientCreateOrUpdateResponse added in v0.3.0

type WorkloadClassifiersClientCreateOrUpdateResponse struct {
	WorkloadClassifiersClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

WorkloadClassifiersClientCreateOrUpdateResponse contains the response from method WorkloadClassifiersClient.CreateOrUpdate.

type WorkloadClassifiersClientCreateOrUpdateResult added in v0.3.0

type WorkloadClassifiersClientCreateOrUpdateResult struct {
	WorkloadClassifier
}

WorkloadClassifiersClientCreateOrUpdateResult contains the result from method WorkloadClassifiersClient.CreateOrUpdate.

type WorkloadClassifiersClientDeletePoller added in v0.3.0

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

WorkloadClassifiersClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*WorkloadClassifiersClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*WorkloadClassifiersClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final WorkloadClassifiersClientDeleteResponse will be returned.

func (*WorkloadClassifiersClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*WorkloadClassifiersClientDeletePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type WorkloadClassifiersClientDeletePollerResponse added in v0.3.0

type WorkloadClassifiersClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *WorkloadClassifiersClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

WorkloadClassifiersClientDeletePollerResponse contains the response from method WorkloadClassifiersClient.Delete.

func (WorkloadClassifiersClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*WorkloadClassifiersClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a WorkloadClassifiersClientDeletePollerResponse from the provided client and resume token.

type WorkloadClassifiersClientDeleteResponse added in v0.3.0

type WorkloadClassifiersClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

WorkloadClassifiersClientDeleteResponse contains the response from method WorkloadClassifiersClient.Delete.

type WorkloadClassifiersClientGetOptions added in v0.3.0

type WorkloadClassifiersClientGetOptions struct {
}

WorkloadClassifiersClientGetOptions contains the optional parameters for the WorkloadClassifiersClient.Get method.

type WorkloadClassifiersClientGetResponse added in v0.3.0

type WorkloadClassifiersClientGetResponse struct {
	WorkloadClassifiersClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

WorkloadClassifiersClientGetResponse contains the response from method WorkloadClassifiersClient.Get.

type WorkloadClassifiersClientGetResult added in v0.3.0

type WorkloadClassifiersClientGetResult struct {
	WorkloadClassifier
}

WorkloadClassifiersClientGetResult contains the result from method WorkloadClassifiersClient.Get.

type WorkloadClassifiersClientListByWorkloadGroupOptions added in v0.3.0

type WorkloadClassifiersClientListByWorkloadGroupOptions struct {
}

WorkloadClassifiersClientListByWorkloadGroupOptions contains the optional parameters for the WorkloadClassifiersClient.ListByWorkloadGroup method.

type WorkloadClassifiersClientListByWorkloadGroupPager added in v0.3.0

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

WorkloadClassifiersClientListByWorkloadGroupPager provides operations for iterating over paged responses.

func (*WorkloadClassifiersClientListByWorkloadGroupPager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*WorkloadClassifiersClientListByWorkloadGroupPager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*WorkloadClassifiersClientListByWorkloadGroupPager) PageResponse added in v0.3.0

PageResponse returns the current WorkloadClassifiersClientListByWorkloadGroupResponse page.

type WorkloadClassifiersClientListByWorkloadGroupResponse added in v0.3.0

type WorkloadClassifiersClientListByWorkloadGroupResponse struct {
	WorkloadClassifiersClientListByWorkloadGroupResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

WorkloadClassifiersClientListByWorkloadGroupResponse contains the response from method WorkloadClassifiersClient.ListByWorkloadGroup.

type WorkloadClassifiersClientListByWorkloadGroupResult added in v0.3.0

type WorkloadClassifiersClientListByWorkloadGroupResult struct {
	WorkloadClassifierListResult
}

WorkloadClassifiersClientListByWorkloadGroupResult contains the result from method WorkloadClassifiersClient.ListByWorkloadGroup.

type WorkloadGroup

type WorkloadGroup struct {
	// Resource properties.
	Properties *WorkloadGroupProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource ID.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

WorkloadGroup - Workload group operations for a data warehouse

type WorkloadGroupListResult

type WorkloadGroupListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; Array of results.
	Value []*WorkloadGroup `json:"value,omitempty" azure:"ro"`
}

WorkloadGroupListResult - A list of workload groups.

func (WorkloadGroupListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type WorkloadGroupListResult.

type WorkloadGroupProperties

type WorkloadGroupProperties struct {
	// REQUIRED; The workload group cap percentage resource.
	MaxResourcePercent *int32 `json:"maxResourcePercent,omitempty"`

	// REQUIRED; The workload group minimum percentage resource.
	MinResourcePercent *int32 `json:"minResourcePercent,omitempty"`

	// REQUIRED; The workload group request minimum grant percentage.
	MinResourcePercentPerRequest *float64 `json:"minResourcePercentPerRequest,omitempty"`

	// The workload group importance level.
	Importance *string `json:"importance,omitempty"`

	// The workload group request maximum grant percentage.
	MaxResourcePercentPerRequest *float64 `json:"maxResourcePercentPerRequest,omitempty"`

	// The workload group query execution timeout.
	QueryExecutionTimeout *int32 `json:"queryExecutionTimeout,omitempty"`
}

WorkloadGroupProperties - Workload group definition. For more information look at sys.workloadmanagementworkload_groups (DMV).

type WorkloadGroupsClient

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

WorkloadGroupsClient contains the methods for the WorkloadGroups group. Don't use this type directly, use NewWorkloadGroupsClient() instead.

func NewWorkloadGroupsClient

func NewWorkloadGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *WorkloadGroupsClient

NewWorkloadGroupsClient creates a new instance of WorkloadGroupsClient with the specified values. subscriptionID - The 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 (*WorkloadGroupsClient) BeginCreateOrUpdate

func (client *WorkloadGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, parameters WorkloadGroup, options *WorkloadGroupsClientBeginCreateOrUpdateOptions) (WorkloadGroupsClientCreateOrUpdatePollerResponse, error)

BeginCreateOrUpdate - Creates or updates a workload group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. workloadGroupName - The name of the workload group. parameters - The requested workload group state. options - WorkloadGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkloadGroupsClient.BeginCreateOrUpdate method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadGroupMax.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/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewWorkloadGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginCreateOrUpdate(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<workload-group-name>",
		armsql.WorkloadGroup{
			Properties: &armsql.WorkloadGroupProperties{
				Importance:                   to.StringPtr("<importance>"),
				MaxResourcePercent:           to.Int32Ptr(100),
				MaxResourcePercentPerRequest: to.Float64Ptr(3),
				MinResourcePercent:           to.Int32Ptr(0),
				MinResourcePercentPerRequest: to.Float64Ptr(3),
				QueryExecutionTimeout:        to.Int32Ptr(0),
			},
		},
		nil)
	if err != nil {
		log.Fatal(err)
	}
	res, err := poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.WorkloadGroupsClientCreateOrUpdateResult)
}
Output:

func (*WorkloadGroupsClient) BeginDelete

func (client *WorkloadGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, options *WorkloadGroupsClientBeginDeleteOptions) (WorkloadGroupsClientDeletePollerResponse, error)

BeginDelete - Deletes a workload group. If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. workloadGroupName - The name of the workload group to delete. options - WorkloadGroupsClientBeginDeleteOptions contains the optional parameters for the WorkloadGroupsClient.BeginDelete method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadGroup.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewWorkloadGroupsClient("<subscription-id>", cred, nil)
	poller, err := client.BeginDelete(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<workload-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	_, err = poller.PollUntilDone(ctx, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

func (*WorkloadGroupsClient) Get

func (client *WorkloadGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, options *WorkloadGroupsClientGetOptions) (WorkloadGroupsClientGetResponse, error)

Get - Gets a workload group If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. workloadGroupName - The name of the workload group. options - WorkloadGroupsClientGetOptions contains the optional parameters for the WorkloadGroupsClient.Get method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewWorkloadGroupsClient("<subscription-id>", cred, nil)
	res, err := client.Get(ctx,
		"<resource-group-name>",
		"<server-name>",
		"<database-name>",
		"<workload-group-name>",
		nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Response result: %#v\n", res.WorkloadGroupsClientGetResult)
}
Output:

func (*WorkloadGroupsClient) ListByDatabase

func (client *WorkloadGroupsClient) ListByDatabase(resourceGroupName string, serverName string, databaseName string, options *WorkloadGroupsClientListByDatabaseOptions) *WorkloadGroupsClientListByDatabasePager

ListByDatabase - Gets the list of workload groups If the operation fails it returns an *azcore.ResponseError type. resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. serverName - The name of the server. databaseName - The name of the database. options - WorkloadGroupsClientListByDatabaseOptions contains the optional parameters for the WorkloadGroupsClient.ListByDatabase method.

Example

x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroupList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client := armsql.NewWorkloadGroupsClient("<subscription-id>", cred, nil)
	pager := client.ListByDatabase("<resource-group-name>",
		"<server-name>",
		"<database-name>",
		nil)
	for {
		nextResult := pager.NextPage(ctx)
		if err := pager.Err(); err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		if !nextResult {
			break
		}
		for _, v := range pager.PageResponse().Value {
			log.Printf("Pager result: %#v\n", v)
		}
	}
}
Output:

type WorkloadGroupsClientBeginCreateOrUpdateOptions added in v0.3.0

type WorkloadGroupsClientBeginCreateOrUpdateOptions struct {
}

WorkloadGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkloadGroupsClient.BeginCreateOrUpdate method.

type WorkloadGroupsClientBeginDeleteOptions added in v0.3.0

type WorkloadGroupsClientBeginDeleteOptions struct {
}

WorkloadGroupsClientBeginDeleteOptions contains the optional parameters for the WorkloadGroupsClient.BeginDelete method.

type WorkloadGroupsClientCreateOrUpdatePoller added in v0.3.0

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

WorkloadGroupsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state.

func (*WorkloadGroupsClientCreateOrUpdatePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*WorkloadGroupsClientCreateOrUpdatePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final WorkloadGroupsClientCreateOrUpdateResponse will be returned.

func (*WorkloadGroupsClientCreateOrUpdatePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*WorkloadGroupsClientCreateOrUpdatePoller) ResumeToken added in v0.3.0

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type WorkloadGroupsClientCreateOrUpdatePollerResponse added in v0.3.0

type WorkloadGroupsClientCreateOrUpdatePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *WorkloadGroupsClientCreateOrUpdatePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

WorkloadGroupsClientCreateOrUpdatePollerResponse contains the response from method WorkloadGroupsClient.CreateOrUpdate.

func (WorkloadGroupsClientCreateOrUpdatePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*WorkloadGroupsClientCreateOrUpdatePollerResponse) Resume added in v0.3.0

Resume rehydrates a WorkloadGroupsClientCreateOrUpdatePollerResponse from the provided client and resume token.

type WorkloadGroupsClientCreateOrUpdateResponse added in v0.3.0

type WorkloadGroupsClientCreateOrUpdateResponse struct {
	WorkloadGroupsClientCreateOrUpdateResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

WorkloadGroupsClientCreateOrUpdateResponse contains the response from method WorkloadGroupsClient.CreateOrUpdate.

type WorkloadGroupsClientCreateOrUpdateResult added in v0.3.0

type WorkloadGroupsClientCreateOrUpdateResult struct {
	WorkloadGroup
}

WorkloadGroupsClientCreateOrUpdateResult contains the result from method WorkloadGroupsClient.CreateOrUpdate.

type WorkloadGroupsClientDeletePoller added in v0.3.0

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

WorkloadGroupsClientDeletePoller provides polling facilities until the operation reaches a terminal state.

func (*WorkloadGroupsClientDeletePoller) Done added in v0.3.0

Done returns true if the LRO has reached a terminal state.

func (*WorkloadGroupsClientDeletePoller) FinalResponse added in v0.3.0

FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final WorkloadGroupsClientDeleteResponse will be returned.

func (*WorkloadGroupsClientDeletePoller) Poll added in v0.3.0

Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.

func (*WorkloadGroupsClientDeletePoller) ResumeToken added in v0.3.0

func (p *WorkloadGroupsClientDeletePoller) ResumeToken() (string, error)

ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.

type WorkloadGroupsClientDeletePollerResponse added in v0.3.0

type WorkloadGroupsClientDeletePollerResponse struct {
	// Poller contains an initialized poller.
	Poller *WorkloadGroupsClientDeletePoller

	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

WorkloadGroupsClientDeletePollerResponse contains the response from method WorkloadGroupsClient.Delete.

func (WorkloadGroupsClientDeletePollerResponse) PollUntilDone added in v0.3.0

PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.

func (*WorkloadGroupsClientDeletePollerResponse) Resume added in v0.3.0

Resume rehydrates a WorkloadGroupsClientDeletePollerResponse from the provided client and resume token.

type WorkloadGroupsClientDeleteResponse added in v0.3.0

type WorkloadGroupsClientDeleteResponse struct {
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

WorkloadGroupsClientDeleteResponse contains the response from method WorkloadGroupsClient.Delete.

type WorkloadGroupsClientGetOptions added in v0.3.0

type WorkloadGroupsClientGetOptions struct {
}

WorkloadGroupsClientGetOptions contains the optional parameters for the WorkloadGroupsClient.Get method.

type WorkloadGroupsClientGetResponse added in v0.3.0

type WorkloadGroupsClientGetResponse struct {
	WorkloadGroupsClientGetResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

WorkloadGroupsClientGetResponse contains the response from method WorkloadGroupsClient.Get.

type WorkloadGroupsClientGetResult added in v0.3.0

type WorkloadGroupsClientGetResult struct {
	WorkloadGroup
}

WorkloadGroupsClientGetResult contains the result from method WorkloadGroupsClient.Get.

type WorkloadGroupsClientListByDatabaseOptions added in v0.3.0

type WorkloadGroupsClientListByDatabaseOptions struct {
}

WorkloadGroupsClientListByDatabaseOptions contains the optional parameters for the WorkloadGroupsClient.ListByDatabase method.

type WorkloadGroupsClientListByDatabasePager added in v0.3.0

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

WorkloadGroupsClientListByDatabasePager provides operations for iterating over paged responses.

func (*WorkloadGroupsClientListByDatabasePager) Err added in v0.3.0

Err returns the last error encountered while paging.

func (*WorkloadGroupsClientListByDatabasePager) NextPage added in v0.3.0

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*WorkloadGroupsClientListByDatabasePager) PageResponse added in v0.3.0

PageResponse returns the current WorkloadGroupsClientListByDatabaseResponse page.

type WorkloadGroupsClientListByDatabaseResponse added in v0.3.0

type WorkloadGroupsClientListByDatabaseResponse struct {
	WorkloadGroupsClientListByDatabaseResult
	// RawResponse contains the underlying HTTP response.
	RawResponse *http.Response
}

WorkloadGroupsClientListByDatabaseResponse contains the response from method WorkloadGroupsClient.ListByDatabase.

type WorkloadGroupsClientListByDatabaseResult added in v0.3.0

type WorkloadGroupsClientListByDatabaseResult struct {
	WorkloadGroupListResult
}

WorkloadGroupsClientListByDatabaseResult contains the result from method WorkloadGroupsClient.ListByDatabase.

Source Files

Jump to

Keyboard shortcuts

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