failovergroups

package
v0.20231016.1155426 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/sql/2022-11-01-preview/failovergroups Documentation

The failovergroups SDK allows for interaction with the Azure Resource Manager Service sql (API Version 2022-11-01-preview).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/sql/2022-11-01-preview/failovergroups"

Client Initialization

client := failovergroups.NewFailoverGroupsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: FailoverGroupsClient.CreateOrUpdate

ctx := context.TODO()
id := failovergroups.NewFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "failoverGroupValue")

payload := failovergroups.FailoverGroup{
	// ...
}


if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: FailoverGroupsClient.Delete

ctx := context.TODO()
id := failovergroups.NewFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "failoverGroupValue")

if err := client.DeleteThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: FailoverGroupsClient.Failover

ctx := context.TODO()
id := failovergroups.NewFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "failoverGroupValue")

if err := client.FailoverThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: FailoverGroupsClient.ForceFailoverAllowDataLoss

ctx := context.TODO()
id := failovergroups.NewFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "failoverGroupValue")

if err := client.ForceFailoverAllowDataLossThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: FailoverGroupsClient.Get

ctx := context.TODO()
id := failovergroups.NewFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "failoverGroupValue")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: FailoverGroupsClient.ListByServer

ctx := context.TODO()
id := failovergroups.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue")

// alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination
items, err := client.ListByServerComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: FailoverGroupsClient.TryPlannedBeforeForcedFailover

ctx := context.TODO()
id := failovergroups.NewFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "failoverGroupValue")

if err := client.TryPlannedBeforeForcedFailoverThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: FailoverGroupsClient.Update

ctx := context.TODO()
id := failovergroups.NewFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "failoverGroupValue")

payload := failovergroups.FailoverGroupUpdate{
	// ...
}


if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForFailoverGroupReplicationRole

func PossibleValuesForFailoverGroupReplicationRole() []string

func PossibleValuesForReadOnlyEndpointFailoverPolicy

func PossibleValuesForReadOnlyEndpointFailoverPolicy() []string

func PossibleValuesForReadWriteEndpointFailoverPolicy

func PossibleValuesForReadWriteEndpointFailoverPolicy() []string

func ValidateFailoverGroupID

func ValidateFailoverGroupID(input interface{}, key string) (warnings []string, errors []error)

ValidateFailoverGroupID checks that 'input' can be parsed as a Failover Group ID

func ValidateServerID

func ValidateServerID(input interface{}, key string) (warnings []string, errors []error)

ValidateServerID checks that 'input' can be parsed as a Server ID

Types

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type FailoverGroup

type FailoverGroup struct {
	Id         *string                  `json:"id,omitempty"`
	Location   *string                  `json:"location,omitempty"`
	Name       *string                  `json:"name,omitempty"`
	Properties *FailoverGroupProperties `json:"properties,omitempty"`
	Tags       *map[string]string       `json:"tags,omitempty"`
	Type       *string                  `json:"type,omitempty"`
}

type FailoverGroupId

type FailoverGroupId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServerName        string
	FailoverGroupName string
}

FailoverGroupId is a struct representing the Resource ID for a Failover Group

func NewFailoverGroupID

func NewFailoverGroupID(subscriptionId string, resourceGroupName string, serverName string, failoverGroupName string) FailoverGroupId

NewFailoverGroupID returns a new FailoverGroupId struct

func ParseFailoverGroupID

func ParseFailoverGroupID(input string) (*FailoverGroupId, error)

ParseFailoverGroupID parses 'input' into a FailoverGroupId

func ParseFailoverGroupIDInsensitively

func ParseFailoverGroupIDInsensitively(input string) (*FailoverGroupId, error)

ParseFailoverGroupIDInsensitively parses 'input' case-insensitively into a FailoverGroupId note: this method should only be used for API response data and not user input

func (FailoverGroupId) ID

func (id FailoverGroupId) ID() string

ID returns the formatted Failover Group ID

func (FailoverGroupId) Segments

func (id FailoverGroupId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Failover Group ID

func (FailoverGroupId) String

func (id FailoverGroupId) String() string

String returns a human-readable description of this Failover Group ID

type FailoverGroupOperationPredicate

type FailoverGroupOperationPredicate struct {
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (FailoverGroupOperationPredicate) Matches

type FailoverGroupProperties

type FailoverGroupProperties struct {
	Databases         *[]string                      `json:"databases,omitempty"`
	PartnerServers    []PartnerInfo                  `json:"partnerServers"`
	ReadOnlyEndpoint  *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`
	ReadWriteEndpoint FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint"`
	ReplicationRole   *FailoverGroupReplicationRole  `json:"replicationRole,omitempty"`
	ReplicationState  *string                        `json:"replicationState,omitempty"`
}

type FailoverGroupReadOnlyEndpoint

type FailoverGroupReadOnlyEndpoint struct {
	FailoverPolicy *ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
}

type FailoverGroupReadWriteEndpoint

type FailoverGroupReadWriteEndpoint struct {
	FailoverPolicy                         ReadWriteEndpointFailoverPolicy `json:"failoverPolicy"`
	FailoverWithDataLossGracePeriodMinutes *int64                          `json:"failoverWithDataLossGracePeriodMinutes,omitempty"`
}

type FailoverGroupReplicationRole

type FailoverGroupReplicationRole string
const (
	FailoverGroupReplicationRolePrimary   FailoverGroupReplicationRole = "Primary"
	FailoverGroupReplicationRoleSecondary FailoverGroupReplicationRole = "Secondary"
)

func (*FailoverGroupReplicationRole) UnmarshalJSON

func (s *FailoverGroupReplicationRole) UnmarshalJSON(bytes []byte) error

type FailoverGroupUpdate

type FailoverGroupUpdate struct {
	Properties *FailoverGroupUpdateProperties `json:"properties,omitempty"`
	Tags       *map[string]string             `json:"tags,omitempty"`
}

type FailoverGroupUpdateProperties

type FailoverGroupUpdateProperties struct {
	Databases         *[]string                       `json:"databases,omitempty"`
	ReadOnlyEndpoint  *FailoverGroupReadOnlyEndpoint  `json:"readOnlyEndpoint,omitempty"`
	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
}

type FailoverGroupsClient

type FailoverGroupsClient struct {
	Client *resourcemanager.Client
}

func NewFailoverGroupsClientWithBaseURI

func NewFailoverGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*FailoverGroupsClient, error)

func (FailoverGroupsClient) CreateOrUpdate

CreateOrUpdate ...

func (FailoverGroupsClient) CreateOrUpdateThenPoll

func (c FailoverGroupsClient) CreateOrUpdateThenPoll(ctx context.Context, id FailoverGroupId, input FailoverGroup) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (FailoverGroupsClient) Delete

Delete ...

func (FailoverGroupsClient) DeleteThenPoll

func (c FailoverGroupsClient) DeleteThenPoll(ctx context.Context, id FailoverGroupId) error

DeleteThenPoll performs Delete then polls until it's completed

func (FailoverGroupsClient) Failover

Failover ...

func (FailoverGroupsClient) FailoverThenPoll

func (c FailoverGroupsClient) FailoverThenPoll(ctx context.Context, id FailoverGroupId) error

FailoverThenPoll performs Failover then polls until it's completed

func (FailoverGroupsClient) ForceFailoverAllowDataLoss

func (c FailoverGroupsClient) ForceFailoverAllowDataLoss(ctx context.Context, id FailoverGroupId) (result ForceFailoverAllowDataLossOperationResponse, err error)

ForceFailoverAllowDataLoss ...

func (FailoverGroupsClient) ForceFailoverAllowDataLossThenPoll

func (c FailoverGroupsClient) ForceFailoverAllowDataLossThenPoll(ctx context.Context, id FailoverGroupId) error

ForceFailoverAllowDataLossThenPoll performs ForceFailoverAllowDataLoss then polls until it's completed

func (FailoverGroupsClient) Get

Get ...

func (FailoverGroupsClient) ListByServer

func (c FailoverGroupsClient) ListByServer(ctx context.Context, id ServerId) (result ListByServerOperationResponse, err error)

ListByServer ...

func (FailoverGroupsClient) ListByServerComplete

func (c FailoverGroupsClient) ListByServerComplete(ctx context.Context, id ServerId) (ListByServerCompleteResult, error)

ListByServerComplete retrieves all the results into a single object

func (FailoverGroupsClient) ListByServerCompleteMatchingPredicate

func (c FailoverGroupsClient) ListByServerCompleteMatchingPredicate(ctx context.Context, id ServerId, predicate FailoverGroupOperationPredicate) (result ListByServerCompleteResult, err error)

ListByServerCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (FailoverGroupsClient) TryPlannedBeforeForcedFailover

func (c FailoverGroupsClient) TryPlannedBeforeForcedFailover(ctx context.Context, id FailoverGroupId) (result TryPlannedBeforeForcedFailoverOperationResponse, err error)

TryPlannedBeforeForcedFailover ...

func (FailoverGroupsClient) TryPlannedBeforeForcedFailoverThenPoll

func (c FailoverGroupsClient) TryPlannedBeforeForcedFailoverThenPoll(ctx context.Context, id FailoverGroupId) error

TryPlannedBeforeForcedFailoverThenPoll performs TryPlannedBeforeForcedFailover then polls until it's completed

func (FailoverGroupsClient) Update

Update ...

func (FailoverGroupsClient) UpdateThenPoll

UpdateThenPoll performs Update then polls until it's completed

type FailoverOperationResponse

type FailoverOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type ForceFailoverAllowDataLossOperationResponse

type ForceFailoverAllowDataLossOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *FailoverGroup
}

type ListByServerCompleteResult

type ListByServerCompleteResult struct {
	Items []FailoverGroup
}

type ListByServerOperationResponse

type ListByServerOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]FailoverGroup
}

type PartnerInfo

type PartnerInfo struct {
	Id              string                        `json:"id"`
	Location        *string                       `json:"location,omitempty"`
	ReplicationRole *FailoverGroupReplicationRole `json:"replicationRole,omitempty"`
}

type ReadOnlyEndpointFailoverPolicy

type ReadOnlyEndpointFailoverPolicy string
const (
	ReadOnlyEndpointFailoverPolicyDisabled ReadOnlyEndpointFailoverPolicy = "Disabled"
	ReadOnlyEndpointFailoverPolicyEnabled  ReadOnlyEndpointFailoverPolicy = "Enabled"
)

func (*ReadOnlyEndpointFailoverPolicy) UnmarshalJSON

func (s *ReadOnlyEndpointFailoverPolicy) UnmarshalJSON(bytes []byte) error

type ReadWriteEndpointFailoverPolicy

type ReadWriteEndpointFailoverPolicy string
const (
	ReadWriteEndpointFailoverPolicyAutomatic ReadWriteEndpointFailoverPolicy = "Automatic"
	ReadWriteEndpointFailoverPolicyManual    ReadWriteEndpointFailoverPolicy = "Manual"
)

func (*ReadWriteEndpointFailoverPolicy) UnmarshalJSON

func (s *ReadWriteEndpointFailoverPolicy) UnmarshalJSON(bytes []byte) error

type ServerId

type ServerId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServerName        string
}

ServerId is a struct representing the Resource ID for a Server

func NewServerID

func NewServerID(subscriptionId string, resourceGroupName string, serverName string) ServerId

NewServerID returns a new ServerId struct

func ParseServerID

func ParseServerID(input string) (*ServerId, error)

ParseServerID parses 'input' into a ServerId

func ParseServerIDInsensitively

func ParseServerIDInsensitively(input string) (*ServerId, error)

ParseServerIDInsensitively parses 'input' case-insensitively into a ServerId note: this method should only be used for API response data and not user input

func (ServerId) ID

func (id ServerId) ID() string

ID returns the formatted Server ID

func (ServerId) Segments

func (id ServerId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Server ID

func (ServerId) String

func (id ServerId) String() string

String returns a human-readable description of this Server ID

type TryPlannedBeforeForcedFailoverOperationResponse

type TryPlannedBeforeForcedFailoverOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type UpdateOperationResponse

type UpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

Jump to

Keyboard shortcuts

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