failovergroups

package
v0.20240903.1111904 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MPL-2.0 Imports: 13 Imported by: 1

README

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

The failovergroups SDK allows for interaction with the Azure Resource Manager Service sql (API Version 2023-08-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/sql/2023-08-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 := commonids.NewSqlServerID("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 PossibleValuesForFailoverGroupDatabasesSecondaryType

func PossibleValuesForFailoverGroupDatabasesSecondaryType() []string

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

Types

type CreateOrUpdateOperationResponse

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

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 FailoverGroupDatabasesSecondaryType

type FailoverGroupDatabasesSecondaryType string
const (
	FailoverGroupDatabasesSecondaryTypeGeo     FailoverGroupDatabasesSecondaryType = "Geo"
	FailoverGroupDatabasesSecondaryTypeStandby FailoverGroupDatabasesSecondaryType = "Standby"
)

func (*FailoverGroupDatabasesSecondaryType) UnmarshalJSON

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

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

func (id *FailoverGroupId) FromParseResult(input resourceids.ParseResult) error

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"`
	SecondaryType     *FailoverGroupDatabasesSecondaryType `json:"secondaryType,omitempty"`
}

type FailoverGroupReadOnlyEndpoint

type FailoverGroupReadOnlyEndpoint struct {
	FailoverPolicy *ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
	TargetServer   *string                         `json:"targetServer,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"`
	PartnerServers    *[]PartnerInfo                       `json:"partnerServers,omitempty"`
	ReadOnlyEndpoint  *FailoverGroupReadOnlyEndpoint       `json:"readOnlyEndpoint,omitempty"`
	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint      `json:"readWriteEndpoint,omitempty"`
	SecondaryType     *FailoverGroupDatabasesSecondaryType `json:"secondaryType,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

ListByServer ...

func (FailoverGroupsClient) ListByServerComplete

ListByServerComplete retrieves all the results into a single object

func (FailoverGroupsClient) ListByServerCompleteMatchingPredicate

func (c FailoverGroupsClient) ListByServerCompleteMatchingPredicate(ctx context.Context, id commonids.SqlServerId, 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
	Model        *FailoverGroup
}

type ForceFailoverAllowDataLossOperationResponse

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

type GetOperationResponse

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

type ListByServerCompleteResult

type ListByServerCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []FailoverGroup
}

type ListByServerCustomPager

type ListByServerCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListByServerCustomPager) NextPageLink() *odata.Link

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 TryPlannedBeforeForcedFailoverOperationResponse

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

type UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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