replicationlinks

package
v0.20240208.1165011 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

README

The replicationlinks SDK allows for interaction with the Azure Resource Manager Service sql (API Version 2023-05-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-05-01-preview/replicationlinks"

Client Initialization

client := replicationlinks.NewReplicationLinksClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ReplicationLinksClient.CreateOrUpdate

ctx := context.TODO()
id := replicationlinks.NewReplicationLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "databaseValue", "linkIdValue")

payload := replicationlinks.ReplicationLink{
	// ...
}


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

Example Usage: ReplicationLinksClient.Delete

ctx := context.TODO()
id := replicationlinks.NewReplicationLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "databaseValue", "linkIdValue")

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

Example Usage: ReplicationLinksClient.Failover

ctx := context.TODO()
id := replicationlinks.NewReplicationLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "databaseValue", "linkIdValue")

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

Example Usage: ReplicationLinksClient.FailoverAllowDataLoss

ctx := context.TODO()
id := replicationlinks.NewReplicationLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "databaseValue", "linkIdValue")

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

Example Usage: ReplicationLinksClient.Get

ctx := context.TODO()
id := replicationlinks.NewReplicationLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "databaseValue", "linkIdValue")

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: ReplicationLinksClient.ListByDatabase

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

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

Example Usage: ReplicationLinksClient.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: ReplicationLinksClient.Update

ctx := context.TODO()
id := replicationlinks.NewReplicationLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "databaseValue", "linkIdValue")

payload := replicationlinks.ReplicationLinkUpdate{
	// ...
}


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 PossibleValuesForReplicationLinkType

func PossibleValuesForReplicationLinkType() []string

func PossibleValuesForReplicationRole

func PossibleValuesForReplicationRole() []string

func PossibleValuesForReplicationState

func PossibleValuesForReplicationState() []string

func ValidateReplicationLinkID

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

ValidateReplicationLinkID checks that 'input' can be parsed as a Replication Link ID

Types

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type FailoverAllowDataLossOperationResponse

type FailoverAllowDataLossOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *ReplicationLink
}

type FailoverOperationResponse

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

type GetOperationResponse

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

type ListByDatabaseCompleteResult

type ListByDatabaseCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []ReplicationLink
}

type ListByDatabaseOperationResponse

type ListByDatabaseOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]ReplicationLink
}

type ListByServerCompleteResult

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

type ListByServerOperationResponse

type ListByServerOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]ReplicationLink
}
type ReplicationLink struct {
	Id         *string                    `json:"id,omitempty"`
	Name       *string                    `json:"name,omitempty"`
	Properties *ReplicationLinkProperties `json:"properties,omitempty"`
	Type       *string                    `json:"type,omitempty"`
}

type ReplicationLinkId

type ReplicationLinkId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServerName        string
	DatabaseName      string
	LinkId            string
}

ReplicationLinkId is a struct representing the Resource ID for a Replication Link

func NewReplicationLinkID

func NewReplicationLinkID(subscriptionId string, resourceGroupName string, serverName string, databaseName string, linkId string) ReplicationLinkId

NewReplicationLinkID returns a new ReplicationLinkId struct

func ParseReplicationLinkID

func ParseReplicationLinkID(input string) (*ReplicationLinkId, error)

ParseReplicationLinkID parses 'input' into a ReplicationLinkId

func ParseReplicationLinkIDInsensitively

func ParseReplicationLinkIDInsensitively(input string) (*ReplicationLinkId, error)

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

func (*ReplicationLinkId) FromParseResult

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

func (ReplicationLinkId) ID

func (id ReplicationLinkId) ID() string

ID returns the formatted Replication Link ID

func (ReplicationLinkId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Replication Link ID

func (ReplicationLinkId) String

func (id ReplicationLinkId) String() string

String returns a human-readable description of this Replication Link ID

type ReplicationLinkOperationPredicate

type ReplicationLinkOperationPredicate struct {
	Id   *string
	Name *string
	Type *string
}

func (ReplicationLinkOperationPredicate) Matches

type ReplicationLinkProperties

type ReplicationLinkProperties struct {
	IsTerminationAllowed *bool                `json:"isTerminationAllowed,omitempty"`
	LinkType             *ReplicationLinkType `json:"linkType,omitempty"`
	PartnerDatabase      *string              `json:"partnerDatabase,omitempty"`
	PartnerDatabaseId    *string              `json:"partnerDatabaseId,omitempty"`
	PartnerLocation      *string              `json:"partnerLocation,omitempty"`
	PartnerRole          *ReplicationRole     `json:"partnerRole,omitempty"`
	PartnerServer        *string              `json:"partnerServer,omitempty"`
	PercentComplete      *int64               `json:"percentComplete,omitempty"`
	ReplicationMode      *string              `json:"replicationMode,omitempty"`
	ReplicationState     *ReplicationState    `json:"replicationState,omitempty"`
	Role                 *ReplicationRole     `json:"role,omitempty"`
	StartTime            *string              `json:"startTime,omitempty"`
}

func (*ReplicationLinkProperties) GetStartTimeAsTime

func (o *ReplicationLinkProperties) GetStartTimeAsTime() (*time.Time, error)

func (*ReplicationLinkProperties) SetStartTimeAsTime

func (o *ReplicationLinkProperties) SetStartTimeAsTime(input time.Time)

type ReplicationLinkType

type ReplicationLinkType string
const (
	ReplicationLinkTypeGEO     ReplicationLinkType = "GEO"
	ReplicationLinkTypeNAMED   ReplicationLinkType = "NAMED"
	ReplicationLinkTypeSTANDBY ReplicationLinkType = "STANDBY"
)

func (*ReplicationLinkType) UnmarshalJSON

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

type ReplicationLinkUpdate

type ReplicationLinkUpdate struct {
	Id         *string                          `json:"id,omitempty"`
	Name       *string                          `json:"name,omitempty"`
	Properties *ReplicationLinkUpdateProperties `json:"properties,omitempty"`
	Type       *string                          `json:"type,omitempty"`
}

type ReplicationLinkUpdateProperties

type ReplicationLinkUpdateProperties struct {
	LinkType *ReplicationLinkType `json:"linkType,omitempty"`
}

type ReplicationLinksClient

type ReplicationLinksClient struct {
	Client *resourcemanager.Client
}

func NewReplicationLinksClientWithBaseURI

func NewReplicationLinksClientWithBaseURI(sdkApi sdkEnv.Api) (*ReplicationLinksClient, error)

func (ReplicationLinksClient) CreateOrUpdate

CreateOrUpdate ...

func (ReplicationLinksClient) CreateOrUpdateThenPoll

func (c ReplicationLinksClient) CreateOrUpdateThenPoll(ctx context.Context, id ReplicationLinkId, input ReplicationLink) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (ReplicationLinksClient) Delete

Delete ...

func (ReplicationLinksClient) DeleteThenPoll

func (c ReplicationLinksClient) DeleteThenPoll(ctx context.Context, id ReplicationLinkId) error

DeleteThenPoll performs Delete then polls until it's completed

func (ReplicationLinksClient) Failover

Failover ...

func (ReplicationLinksClient) FailoverAllowDataLoss

FailoverAllowDataLoss ...

func (ReplicationLinksClient) FailoverAllowDataLossThenPoll

func (c ReplicationLinksClient) FailoverAllowDataLossThenPoll(ctx context.Context, id ReplicationLinkId) error

FailoverAllowDataLossThenPoll performs FailoverAllowDataLoss then polls until it's completed

func (ReplicationLinksClient) FailoverThenPoll

func (c ReplicationLinksClient) FailoverThenPoll(ctx context.Context, id ReplicationLinkId) error

FailoverThenPoll performs Failover then polls until it's completed

func (ReplicationLinksClient) Get

Get ...

func (ReplicationLinksClient) ListByDatabase

ListByDatabase ...

func (ReplicationLinksClient) ListByDatabaseComplete

ListByDatabaseComplete retrieves all the results into a single object

func (ReplicationLinksClient) ListByDatabaseCompleteMatchingPredicate

func (c ReplicationLinksClient) ListByDatabaseCompleteMatchingPredicate(ctx context.Context, id commonids.SqlDatabaseId, predicate ReplicationLinkOperationPredicate) (result ListByDatabaseCompleteResult, err error)

ListByDatabaseCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ReplicationLinksClient) ListByServer

ListByServer ...

func (ReplicationLinksClient) ListByServerComplete

ListByServerComplete retrieves all the results into a single object

func (ReplicationLinksClient) ListByServerCompleteMatchingPredicate

func (c ReplicationLinksClient) ListByServerCompleteMatchingPredicate(ctx context.Context, id commonids.SqlServerId, predicate ReplicationLinkOperationPredicate) (result ListByServerCompleteResult, err error)

ListByServerCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ReplicationLinksClient) Update

Update ...

func (ReplicationLinksClient) UpdateThenPoll

UpdateThenPoll performs Update then polls until it's completed

type ReplicationRole

type ReplicationRole string
const (
	ReplicationRoleCopy                 ReplicationRole = "Copy"
	ReplicationRoleNonReadableSecondary ReplicationRole = "NonReadableSecondary"
	ReplicationRolePrimary              ReplicationRole = "Primary"
	ReplicationRoleSecondary            ReplicationRole = "Secondary"
	ReplicationRoleSource               ReplicationRole = "Source"
)

func (*ReplicationRole) UnmarshalJSON

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

type ReplicationState

type ReplicationState string
const (
	ReplicationStateCATCHUP   ReplicationState = "CATCH_UP"
	ReplicationStatePENDING   ReplicationState = "PENDING"
	ReplicationStateSEEDING   ReplicationState = "SEEDING"
	ReplicationStateSUSPENDED ReplicationState = "SUSPENDED"
)

func (*ReplicationState) UnmarshalJSON

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

type UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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