migrations

package
v0.20231222.1192659 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MPL-2.0 Imports: 13 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2023-03-01-preview/migrations Documentation

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

Client Initialization

client := migrations.NewMigrationsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: MigrationsClient.Create

ctx := context.TODO()
id := migrations.NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerValue", "migrationValue")

payload := migrations.MigrationResource{
	// ...
}


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

Example Usage: MigrationsClient.Delete

ctx := context.TODO()
id := migrations.NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerValue", "migrationValue")

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

Example Usage: MigrationsClient.Get

ctx := context.TODO()
id := migrations.NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerValue", "migrationValue")

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: MigrationsClient.ListByTargetServer

ctx := context.TODO()
id := migrations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerValue")

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

Example Usage: MigrationsClient.Update

ctx := context.TODO()
id := migrations.NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerValue", "migrationValue")

payload := migrations.MigrationResourceForPatch{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForCancelEnum

func PossibleValuesForCancelEnum() []string

func PossibleValuesForLogicalReplicationOnSourceDbEnum

func PossibleValuesForLogicalReplicationOnSourceDbEnum() []string

func PossibleValuesForMigrationListFilter

func PossibleValuesForMigrationListFilter() []string

func PossibleValuesForMigrationMode

func PossibleValuesForMigrationMode() []string

func PossibleValuesForMigrationState

func PossibleValuesForMigrationState() []string

func PossibleValuesForMigrationSubState

func PossibleValuesForMigrationSubState() []string

func PossibleValuesForOverwriteDbsInTargetEnum

func PossibleValuesForOverwriteDbsInTargetEnum() []string

func PossibleValuesForSkuTier

func PossibleValuesForSkuTier() []string

func PossibleValuesForStartDataMigrationEnum

func PossibleValuesForStartDataMigrationEnum() []string

func PossibleValuesForTriggerCutoverEnum

func PossibleValuesForTriggerCutoverEnum() []string

func ValidateFlexibleServerID

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

ValidateFlexibleServerID checks that 'input' can be parsed as a Flexible Server ID

func ValidateMigrationID

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

ValidateMigrationID checks that 'input' can be parsed as a Migration ID

Types

type AdminCredentials

type AdminCredentials struct {
	SourceServerPassword string `json:"sourceServerPassword"`
	TargetServerPassword string `json:"targetServerPassword"`
}

type CancelEnum

type CancelEnum string
const (
	CancelEnumFalse CancelEnum = "False"
	CancelEnumTrue  CancelEnum = "True"
)

func (*CancelEnum) UnmarshalJSON added in v0.20230809.1081239

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

type CreateOperationResponse

type CreateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *MigrationResource
}

type DbServerMetadata

type DbServerMetadata struct {
	Location  *string    `json:"location,omitempty"`
	Sku       *ServerSku `json:"sku,omitempty"`
	StorageMb *int64     `json:"storageMb,omitempty"`
	Version   *string    `json:"version,omitempty"`
}

type DeleteOperationResponse

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

type FlexibleServerId

type FlexibleServerId struct {
	SubscriptionId     string
	ResourceGroupName  string
	FlexibleServerName string
}

FlexibleServerId is a struct representing the Resource ID for a Flexible Server

func NewFlexibleServerID

func NewFlexibleServerID(subscriptionId string, resourceGroupName string, flexibleServerName string) FlexibleServerId

NewFlexibleServerID returns a new FlexibleServerId struct

func ParseFlexibleServerID

func ParseFlexibleServerID(input string) (*FlexibleServerId, error)

ParseFlexibleServerID parses 'input' into a FlexibleServerId

func ParseFlexibleServerIDInsensitively

func ParseFlexibleServerIDInsensitively(input string) (*FlexibleServerId, error)

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

func (*FlexibleServerId) FromParseResult added in v0.20231127.1171502

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

func (FlexibleServerId) ID

func (id FlexibleServerId) ID() string

ID returns the formatted Flexible Server ID

func (FlexibleServerId) Segments

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

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

func (FlexibleServerId) String

func (id FlexibleServerId) String() string

String returns a human-readable description of this Flexible Server ID

type GetOperationResponse

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

type ListByTargetServerCompleteResult

type ListByTargetServerCompleteResult struct {
	Items []MigrationResource
}

type ListByTargetServerOperationOptions

type ListByTargetServerOperationOptions struct {
	MigrationListFilter *MigrationListFilter
}

func DefaultListByTargetServerOperationOptions

func DefaultListByTargetServerOperationOptions() ListByTargetServerOperationOptions

func (ListByTargetServerOperationOptions) ToHeaders added in v0.20230809.1081239

func (ListByTargetServerOperationOptions) ToOData added in v0.20230809.1081239

func (ListByTargetServerOperationOptions) ToQuery added in v0.20230809.1081239

type ListByTargetServerOperationResponse

type ListByTargetServerOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]MigrationResource
}

type LogicalReplicationOnSourceDbEnum

type LogicalReplicationOnSourceDbEnum string
const (
	LogicalReplicationOnSourceDbEnumFalse LogicalReplicationOnSourceDbEnum = "False"
	LogicalReplicationOnSourceDbEnumTrue  LogicalReplicationOnSourceDbEnum = "True"
)

func (*LogicalReplicationOnSourceDbEnum) UnmarshalJSON added in v0.20230809.1081239

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

type MigrationId

type MigrationId struct {
	SubscriptionId     string
	ResourceGroupName  string
	FlexibleServerName string
	MigrationName      string
}

MigrationId is a struct representing the Resource ID for a Migration

func NewMigrationID

func NewMigrationID(subscriptionId string, resourceGroupName string, flexibleServerName string, migrationName string) MigrationId

NewMigrationID returns a new MigrationId struct

func ParseMigrationID

func ParseMigrationID(input string) (*MigrationId, error)

ParseMigrationID parses 'input' into a MigrationId

func ParseMigrationIDInsensitively

func ParseMigrationIDInsensitively(input string) (*MigrationId, error)

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

func (*MigrationId) FromParseResult added in v0.20231127.1171502

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

func (MigrationId) ID

func (id MigrationId) ID() string

ID returns the formatted Migration ID

func (MigrationId) Segments

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

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

func (MigrationId) String

func (id MigrationId) String() string

String returns a human-readable description of this Migration ID

type MigrationListFilter

type MigrationListFilter string
const (
	MigrationListFilterActive MigrationListFilter = "Active"
	MigrationListFilterAll    MigrationListFilter = "All"
)

func (*MigrationListFilter) UnmarshalJSON added in v0.20230809.1081239

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

type MigrationMode

type MigrationMode string
const (
	MigrationModeOffline MigrationMode = "Offline"
	MigrationModeOnline  MigrationMode = "Online"
)

func (*MigrationMode) UnmarshalJSON added in v0.20230809.1081239

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

type MigrationResource

type MigrationResource struct {
	Id         *string                      `json:"id,omitempty"`
	Location   string                       `json:"location"`
	Name       *string                      `json:"name,omitempty"`
	Properties *MigrationResourceProperties `json:"properties,omitempty"`
	SystemData *systemdata.SystemData       `json:"systemData,omitempty"`
	Tags       *map[string]string           `json:"tags,omitempty"`
	Type       *string                      `json:"type,omitempty"`
}

type MigrationResourceForPatch

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

type MigrationResourceOperationPredicate

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

func (MigrationResourceOperationPredicate) Matches

type MigrationResourceProperties

type MigrationResourceProperties struct {
	Cancel                                    *CancelEnum                       `json:"cancel,omitempty"`
	CurrentStatus                             *MigrationStatus                  `json:"currentStatus,omitempty"`
	DbsToCancelMigrationOn                    *[]string                         `json:"dbsToCancelMigrationOn,omitempty"`
	DbsToMigrate                              *[]string                         `json:"dbsToMigrate,omitempty"`
	DbsToTriggerCutoverOn                     *[]string                         `json:"dbsToTriggerCutoverOn,omitempty"`
	MigrationId                               *string                           `json:"migrationId,omitempty"`
	MigrationMode                             *MigrationMode                    `json:"migrationMode,omitempty"`
	MigrationWindowEndTimeInUtc               *string                           `json:"migrationWindowEndTimeInUtc,omitempty"`
	MigrationWindowStartTimeInUtc             *string                           `json:"migrationWindowStartTimeInUtc,omitempty"`
	OverwriteDbsInTarget                      *OverwriteDbsInTargetEnum         `json:"overwriteDbsInTarget,omitempty"`
	SecretParameters                          *MigrationSecretParameters        `json:"secretParameters,omitempty"`
	SetupLogicalReplicationOnSourceDbIfNeeded *LogicalReplicationOnSourceDbEnum `json:"setupLogicalReplicationOnSourceDbIfNeeded,omitempty"`
	SourceDbServerFullyQualifiedDomainName    *string                           `json:"sourceDbServerFullyQualifiedDomainName,omitempty"`
	SourceDbServerMetadata                    *DbServerMetadata                 `json:"sourceDbServerMetadata,omitempty"`
	SourceDbServerResourceId                  *string                           `json:"sourceDbServerResourceId,omitempty"`
	StartDataMigration                        *StartDataMigrationEnum           `json:"startDataMigration,omitempty"`
	TargetDbServerFullyQualifiedDomainName    *string                           `json:"targetDbServerFullyQualifiedDomainName,omitempty"`
	TargetDbServerMetadata                    *DbServerMetadata                 `json:"targetDbServerMetadata,omitempty"`
	TargetDbServerResourceId                  *string                           `json:"targetDbServerResourceId,omitempty"`
	TriggerCutover                            *TriggerCutoverEnum               `json:"triggerCutover,omitempty"`
}

func (*MigrationResourceProperties) GetMigrationWindowEndTimeInUtcAsTime

func (o *MigrationResourceProperties) GetMigrationWindowEndTimeInUtcAsTime() (*time.Time, error)

func (*MigrationResourceProperties) GetMigrationWindowStartTimeInUtcAsTime

func (o *MigrationResourceProperties) GetMigrationWindowStartTimeInUtcAsTime() (*time.Time, error)

func (*MigrationResourceProperties) SetMigrationWindowEndTimeInUtcAsTime

func (o *MigrationResourceProperties) SetMigrationWindowEndTimeInUtcAsTime(input time.Time)

func (*MigrationResourceProperties) SetMigrationWindowStartTimeInUtcAsTime

func (o *MigrationResourceProperties) SetMigrationWindowStartTimeInUtcAsTime(input time.Time)

type MigrationResourcePropertiesForPatch

type MigrationResourcePropertiesForPatch struct {
	Cancel                                    *CancelEnum                       `json:"cancel,omitempty"`
	DbsToCancelMigrationOn                    *[]string                         `json:"dbsToCancelMigrationOn,omitempty"`
	DbsToMigrate                              *[]string                         `json:"dbsToMigrate,omitempty"`
	DbsToTriggerCutoverOn                     *[]string                         `json:"dbsToTriggerCutoverOn,omitempty"`
	MigrationMode                             *MigrationMode                    `json:"migrationMode,omitempty"`
	MigrationWindowStartTimeInUtc             *string                           `json:"migrationWindowStartTimeInUtc,omitempty"`
	OverwriteDbsInTarget                      *OverwriteDbsInTargetEnum         `json:"overwriteDbsInTarget,omitempty"`
	SecretParameters                          *MigrationSecretParameters        `json:"secretParameters,omitempty"`
	SetupLogicalReplicationOnSourceDbIfNeeded *LogicalReplicationOnSourceDbEnum `json:"setupLogicalReplicationOnSourceDbIfNeeded,omitempty"`
	SourceDbServerFullyQualifiedDomainName    *string                           `json:"sourceDbServerFullyQualifiedDomainName,omitempty"`
	SourceDbServerResourceId                  *string                           `json:"sourceDbServerResourceId,omitempty"`
	StartDataMigration                        *StartDataMigrationEnum           `json:"startDataMigration,omitempty"`
	TargetDbServerFullyQualifiedDomainName    *string                           `json:"targetDbServerFullyQualifiedDomainName,omitempty"`
	TriggerCutover                            *TriggerCutoverEnum               `json:"triggerCutover,omitempty"`
}

func (*MigrationResourcePropertiesForPatch) GetMigrationWindowStartTimeInUtcAsTime

func (o *MigrationResourcePropertiesForPatch) GetMigrationWindowStartTimeInUtcAsTime() (*time.Time, error)

func (*MigrationResourcePropertiesForPatch) SetMigrationWindowStartTimeInUtcAsTime

func (o *MigrationResourcePropertiesForPatch) SetMigrationWindowStartTimeInUtcAsTime(input time.Time)

type MigrationSecretParameters

type MigrationSecretParameters struct {
	AdminCredentials     AdminCredentials `json:"adminCredentials"`
	SourceServerUsername *string          `json:"sourceServerUsername,omitempty"`
	TargetServerUsername *string          `json:"targetServerUsername,omitempty"`
}

type MigrationState

type MigrationState string
const (
	MigrationStateCanceled             MigrationState = "Canceled"
	MigrationStateFailed               MigrationState = "Failed"
	MigrationStateInProgress           MigrationState = "InProgress"
	MigrationStateSucceeded            MigrationState = "Succeeded"
	MigrationStateWaitingForUserAction MigrationState = "WaitingForUserAction"
)

func (*MigrationState) UnmarshalJSON added in v0.20230809.1081239

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

type MigrationStatus

type MigrationStatus struct {
	CurrentSubStateDetails *MigrationSubStateDetails `json:"currentSubStateDetails,omitempty"`
	Error                  *string                   `json:"error,omitempty"`
	State                  *MigrationState           `json:"state,omitempty"`
}

type MigrationSubState

type MigrationSubState string
const (
	MigrationSubStateCompleted                                          MigrationSubState = "Completed"
	MigrationSubStateCompletingMigration                                MigrationSubState = "CompletingMigration"
	MigrationSubStateMigratingData                                      MigrationSubState = "MigratingData"
	MigrationSubStatePerformingPreRequisiteSteps                        MigrationSubState = "PerformingPreRequisiteSteps"
	MigrationSubStateWaitingForCutoverTrigger                           MigrationSubState = "WaitingForCutoverTrigger"
	MigrationSubStateWaitingForDBsToMigrateSpecification                MigrationSubState = "WaitingForDBsToMigrateSpecification"
	MigrationSubStateWaitingForDataMigrationScheduling                  MigrationSubState = "WaitingForDataMigrationScheduling"
	MigrationSubStateWaitingForDataMigrationWindow                      MigrationSubState = "WaitingForDataMigrationWindow"
	MigrationSubStateWaitingForLogicalReplicationSetupRequestOnSourceDB MigrationSubState = "WaitingForLogicalReplicationSetupRequestOnSourceDB"
	MigrationSubStateWaitingForTargetDBOverwriteConfirmation            MigrationSubState = "WaitingForTargetDBOverwriteConfirmation"
)

func (*MigrationSubState) UnmarshalJSON added in v0.20230809.1081239

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

type MigrationSubStateDetails

type MigrationSubStateDetails struct {
	CurrentSubState *MigrationSubState `json:"currentSubState,omitempty"`
}

type MigrationsClient

type MigrationsClient struct {
	Client *resourcemanager.Client
}

func NewMigrationsClientWithBaseURI

func NewMigrationsClientWithBaseURI(sdkApi sdkEnv.Api) (*MigrationsClient, error)

func (MigrationsClient) Create

Create ...

func (MigrationsClient) Delete

func (c MigrationsClient) Delete(ctx context.Context, id MigrationId) (result DeleteOperationResponse, err error)

Delete ...

func (MigrationsClient) Get

Get ...

func (MigrationsClient) ListByTargetServer

ListByTargetServer ...

func (MigrationsClient) ListByTargetServerComplete

ListByTargetServerComplete retrieves all the results into a single object

func (MigrationsClient) ListByTargetServerCompleteMatchingPredicate

func (c MigrationsClient) ListByTargetServerCompleteMatchingPredicate(ctx context.Context, id FlexibleServerId, options ListByTargetServerOperationOptions, predicate MigrationResourceOperationPredicate) (result ListByTargetServerCompleteResult, err error)

ListByTargetServerCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (MigrationsClient) Update

Update ...

type OverwriteDbsInTargetEnum

type OverwriteDbsInTargetEnum string
const (
	OverwriteDbsInTargetEnumFalse OverwriteDbsInTargetEnum = "False"
	OverwriteDbsInTargetEnumTrue  OverwriteDbsInTargetEnum = "True"
)

func (*OverwriteDbsInTargetEnum) UnmarshalJSON added in v0.20230809.1081239

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

type ServerSku

type ServerSku struct {
	Name string  `json:"name"`
	Tier SkuTier `json:"tier"`
}

type SkuTier

type SkuTier string
const (
	SkuTierBurstable       SkuTier = "Burstable"
	SkuTierGeneralPurpose  SkuTier = "GeneralPurpose"
	SkuTierMemoryOptimized SkuTier = "MemoryOptimized"
)

func (*SkuTier) UnmarshalJSON added in v0.20230809.1081239

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

type StartDataMigrationEnum

type StartDataMigrationEnum string
const (
	StartDataMigrationEnumFalse StartDataMigrationEnum = "False"
	StartDataMigrationEnumTrue  StartDataMigrationEnum = "True"
)

func (*StartDataMigrationEnum) UnmarshalJSON added in v0.20230809.1081239

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

type TriggerCutoverEnum

type TriggerCutoverEnum string
const (
	TriggerCutoverEnumFalse TriggerCutoverEnum = "False"
	TriggerCutoverEnumTrue  TriggerCutoverEnum = "True"
)

func (*TriggerCutoverEnum) UnmarshalJSON added in v0.20230809.1081239

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

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *MigrationResource
}

Jump to

Keyboard shortcuts

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