syncagents

package
v0.20240125.1115017 Latest Latest
Warning

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

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

README

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

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

Client Initialization

client := syncagents.NewSyncAgentsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: SyncAgentsClient.CreateOrUpdate

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

payload := syncagents.SyncAgent{
	// ...
}


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

Example Usage: SyncAgentsClient.Delete

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

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

Example Usage: SyncAgentsClient.GenerateKey

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

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

Example Usage: SyncAgentsClient.Get

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

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: SyncAgentsClient.ListByServer

ctx := context.TODO()
id := syncagents.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: SyncAgentsClient.ListLinkedDatabases

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForSyncAgentState

func PossibleValuesForSyncAgentState() []string

func PossibleValuesForSyncMemberDbType

func PossibleValuesForSyncMemberDbType() []string

func ValidateSyncAgentID

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

ValidateSyncAgentID checks that 'input' can be parsed as a Sync Agent ID

Types

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type GenerateKeyOperationResponse

type GenerateKeyOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SyncAgentKeyProperties
}

type GetOperationResponse

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

type ListByServerCompleteResult

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

type ListByServerOperationResponse

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

type ListLinkedDatabasesCompleteResult

type ListLinkedDatabasesCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []SyncAgentLinkedDatabase
}

type ListLinkedDatabasesOperationResponse

type ListLinkedDatabasesOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]SyncAgentLinkedDatabase
}

type SyncAgent

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

type SyncAgentId

type SyncAgentId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServerName        string
	SyncAgentName     string
}

SyncAgentId is a struct representing the Resource ID for a Sync Agent

func NewSyncAgentID

func NewSyncAgentID(subscriptionId string, resourceGroupName string, serverName string, syncAgentName string) SyncAgentId

NewSyncAgentID returns a new SyncAgentId struct

func ParseSyncAgentID

func ParseSyncAgentID(input string) (*SyncAgentId, error)

ParseSyncAgentID parses 'input' into a SyncAgentId

func ParseSyncAgentIDInsensitively

func ParseSyncAgentIDInsensitively(input string) (*SyncAgentId, error)

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

func (*SyncAgentId) FromParseResult

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

func (SyncAgentId) ID

func (id SyncAgentId) ID() string

ID returns the formatted Sync Agent ID

func (SyncAgentId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Sync Agent ID

func (SyncAgentId) String

func (id SyncAgentId) String() string

String returns a human-readable description of this Sync Agent ID

type SyncAgentKeyProperties

type SyncAgentKeyProperties struct {
	SyncAgentKey *string `json:"syncAgentKey,omitempty"`
}

type SyncAgentLinkedDatabase

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

type SyncAgentLinkedDatabaseOperationPredicate

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

func (SyncAgentLinkedDatabaseOperationPredicate) Matches

type SyncAgentLinkedDatabaseProperties

type SyncAgentLinkedDatabaseProperties struct {
	DatabaseId   *string           `json:"databaseId,omitempty"`
	DatabaseName *string           `json:"databaseName,omitempty"`
	DatabaseType *SyncMemberDbType `json:"databaseType,omitempty"`
	Description  *string           `json:"description,omitempty"`
	ServerName   *string           `json:"serverName,omitempty"`
	UserName     *string           `json:"userName,omitempty"`
}

type SyncAgentOperationPredicate

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

func (SyncAgentOperationPredicate) Matches

func (p SyncAgentOperationPredicate) Matches(input SyncAgent) bool

type SyncAgentProperties

type SyncAgentProperties struct {
	ExpiryTime     *string         `json:"expiryTime,omitempty"`
	IsUpToDate     *bool           `json:"isUpToDate,omitempty"`
	LastAliveTime  *string         `json:"lastAliveTime,omitempty"`
	Name           *string         `json:"name,omitempty"`
	State          *SyncAgentState `json:"state,omitempty"`
	SyncDatabaseId *string         `json:"syncDatabaseId,omitempty"`
	Version        *string         `json:"version,omitempty"`
}

func (*SyncAgentProperties) GetExpiryTimeAsTime

func (o *SyncAgentProperties) GetExpiryTimeAsTime() (*time.Time, error)

func (*SyncAgentProperties) GetLastAliveTimeAsTime

func (o *SyncAgentProperties) GetLastAliveTimeAsTime() (*time.Time, error)

func (*SyncAgentProperties) SetExpiryTimeAsTime

func (o *SyncAgentProperties) SetExpiryTimeAsTime(input time.Time)

func (*SyncAgentProperties) SetLastAliveTimeAsTime

func (o *SyncAgentProperties) SetLastAliveTimeAsTime(input time.Time)

type SyncAgentState

type SyncAgentState string
const (
	SyncAgentStateNeverConnected SyncAgentState = "NeverConnected"
	SyncAgentStateOffline        SyncAgentState = "Offline"
	SyncAgentStateOnline         SyncAgentState = "Online"
)

func (*SyncAgentState) UnmarshalJSON

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

type SyncAgentsClient

type SyncAgentsClient struct {
	Client *resourcemanager.Client
}

func NewSyncAgentsClientWithBaseURI

func NewSyncAgentsClientWithBaseURI(sdkApi sdkEnv.Api) (*SyncAgentsClient, error)

func (SyncAgentsClient) CreateOrUpdate

func (c SyncAgentsClient) CreateOrUpdate(ctx context.Context, id SyncAgentId, input SyncAgent) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (SyncAgentsClient) CreateOrUpdateThenPoll

func (c SyncAgentsClient) CreateOrUpdateThenPoll(ctx context.Context, id SyncAgentId, input SyncAgent) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (SyncAgentsClient) Delete

func (c SyncAgentsClient) Delete(ctx context.Context, id SyncAgentId) (result DeleteOperationResponse, err error)

Delete ...

func (SyncAgentsClient) DeleteThenPoll

func (c SyncAgentsClient) DeleteThenPoll(ctx context.Context, id SyncAgentId) error

DeleteThenPoll performs Delete then polls until it's completed

func (SyncAgentsClient) GenerateKey

func (c SyncAgentsClient) GenerateKey(ctx context.Context, id SyncAgentId) (result GenerateKeyOperationResponse, err error)

GenerateKey ...

func (SyncAgentsClient) Get

Get ...

func (SyncAgentsClient) ListByServer

ListByServer ...

func (SyncAgentsClient) ListByServerComplete

ListByServerComplete retrieves all the results into a single object

func (SyncAgentsClient) ListByServerCompleteMatchingPredicate

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

ListByServerCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (SyncAgentsClient) ListLinkedDatabases

func (c SyncAgentsClient) ListLinkedDatabases(ctx context.Context, id SyncAgentId) (result ListLinkedDatabasesOperationResponse, err error)

ListLinkedDatabases ...

func (SyncAgentsClient) ListLinkedDatabasesComplete

func (c SyncAgentsClient) ListLinkedDatabasesComplete(ctx context.Context, id SyncAgentId) (ListLinkedDatabasesCompleteResult, error)

ListLinkedDatabasesComplete retrieves all the results into a single object

func (SyncAgentsClient) ListLinkedDatabasesCompleteMatchingPredicate

func (c SyncAgentsClient) ListLinkedDatabasesCompleteMatchingPredicate(ctx context.Context, id SyncAgentId, predicate SyncAgentLinkedDatabaseOperationPredicate) (result ListLinkedDatabasesCompleteResult, err error)

ListLinkedDatabasesCompleteMatchingPredicate retrieves all the results and then applies the predicate

type SyncMemberDbType

type SyncMemberDbType string
const (
	SyncMemberDbTypeAzureSqlDatabase  SyncMemberDbType = "AzureSqlDatabase"
	SyncMemberDbTypeSqlServerDatabase SyncMemberDbType = "SqlServerDatabase"
)

func (*SyncMemberDbType) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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