manageddatabases

package
v0.20241111.1164443 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

README

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

The manageddatabases SDK allows for interaction with Azure Resource Manager 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/manageddatabases"

Client Initialization

client := manageddatabases.NewManagedDatabasesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ManagedDatabasesClient.CancelMove

ctx := context.TODO()
id := commonids.NewSqlManagedInstanceDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "databaseName")

payload := manageddatabases.ManagedDatabaseMoveDefinition{
	// ...
}


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

Example Usage: ManagedDatabasesClient.CompleteMove

ctx := context.TODO()
id := commonids.NewSqlManagedInstanceDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "databaseName")

payload := manageddatabases.ManagedDatabaseMoveDefinition{
	// ...
}


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

Example Usage: ManagedDatabasesClient.CompleteRestore

ctx := context.TODO()
id := commonids.NewSqlManagedInstanceDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "databaseName")

payload := manageddatabases.CompleteDatabaseRestoreDefinition{
	// ...
}


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

Example Usage: ManagedDatabasesClient.CreateOrUpdate

ctx := context.TODO()
id := commonids.NewSqlManagedInstanceDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "databaseName")

payload := manageddatabases.ManagedDatabase{
	// ...
}


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

Example Usage: ManagedDatabasesClient.Delete

ctx := context.TODO()
id := commonids.NewSqlManagedInstanceDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "databaseName")

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

Example Usage: ManagedDatabasesClient.Get

ctx := context.TODO()
id := commonids.NewSqlManagedInstanceDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "databaseName")

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: ManagedDatabasesClient.ListByInstance

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

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

Example Usage: ManagedDatabasesClient.ListInaccessibleByInstance

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

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

Example Usage: ManagedDatabasesClient.StartMove

ctx := context.TODO()
id := commonids.NewSqlManagedInstanceDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "databaseName")

payload := manageddatabases.ManagedDatabaseStartMoveDefinition{
	// ...
}


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

Example Usage: ManagedDatabasesClient.Update

ctx := context.TODO()
id := commonids.NewSqlManagedInstanceDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "databaseName")

payload := manageddatabases.ManagedDatabaseUpdate{
	// ...
}


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 PossibleValuesForCatalogCollationType

func PossibleValuesForCatalogCollationType() []string

func PossibleValuesForManagedDatabaseCreateMode

func PossibleValuesForManagedDatabaseCreateMode() []string

func PossibleValuesForManagedDatabaseStatus

func PossibleValuesForManagedDatabaseStatus() []string

func PossibleValuesForMoveOperationMode

func PossibleValuesForMoveOperationMode() []string

Types

type CancelMoveOperationResponse

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

type CatalogCollationType

type CatalogCollationType string
const (
	CatalogCollationTypeDATABASEDEFAULT             CatalogCollationType = "DATABASE_DEFAULT"
	CatalogCollationTypeSQLLatinOneGeneralCPOneCIAS CatalogCollationType = "SQL_Latin1_General_CP1_CI_AS"
)

func (*CatalogCollationType) UnmarshalJSON

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

type CompleteDatabaseRestoreDefinition

type CompleteDatabaseRestoreDefinition struct {
	LastBackupName string `json:"lastBackupName"`
}

type CompleteMoveOperationResponse

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

type CompleteRestoreOperationResponse

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

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type GetOperationResponse

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

type ListByInstanceCompleteResult

type ListByInstanceCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []ManagedDatabase
}

type ListByInstanceCustomPager

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

type ListByInstanceOperationResponse

type ListByInstanceOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]ManagedDatabase
}

type ListInaccessibleByInstanceCompleteResult

type ListInaccessibleByInstanceCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []ManagedDatabase
}

type ListInaccessibleByInstanceCustomPager

type ListInaccessibleByInstanceCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}

type ListInaccessibleByInstanceOperationResponse

type ListInaccessibleByInstanceOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]ManagedDatabase
}

type ManagedDatabase

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

type ManagedDatabaseCreateMode

type ManagedDatabaseCreateMode string
const (
	ManagedDatabaseCreateModeDefault                        ManagedDatabaseCreateMode = "Default"
	ManagedDatabaseCreateModePointInTimeRestore             ManagedDatabaseCreateMode = "PointInTimeRestore"
	ManagedDatabaseCreateModeRecovery                       ManagedDatabaseCreateMode = "Recovery"
	ManagedDatabaseCreateModeRestoreExternalBackup          ManagedDatabaseCreateMode = "RestoreExternalBackup"
	ManagedDatabaseCreateModeRestoreLongTermRetentionBackup ManagedDatabaseCreateMode = "RestoreLongTermRetentionBackup"
)

func (*ManagedDatabaseCreateMode) UnmarshalJSON

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

type ManagedDatabaseMoveDefinition

type ManagedDatabaseMoveDefinition struct {
	DestinationManagedDatabaseId string `json:"destinationManagedDatabaseId"`
}

type ManagedDatabaseOperationPredicate

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

func (ManagedDatabaseOperationPredicate) Matches

type ManagedDatabaseProperties

type ManagedDatabaseProperties struct {
	AutoCompleteRestore                          *bool                      `json:"autoCompleteRestore,omitempty"`
	CatalogCollation                             *CatalogCollationType      `json:"catalogCollation,omitempty"`
	Collation                                    *string                    `json:"collation,omitempty"`
	CreateMode                                   *ManagedDatabaseCreateMode `json:"createMode,omitempty"`
	CreationDate                                 *string                    `json:"creationDate,omitempty"`
	CrossSubscriptionRestorableDroppedDatabaseId *string                    `json:"crossSubscriptionRestorableDroppedDatabaseId,omitempty"`
	CrossSubscriptionSourceDatabaseId            *string                    `json:"crossSubscriptionSourceDatabaseId,omitempty"`
	CrossSubscriptionTargetManagedInstanceId     *string                    `json:"crossSubscriptionTargetManagedInstanceId,omitempty"`
	DefaultSecondaryLocation                     *string                    `json:"defaultSecondaryLocation,omitempty"`
	EarliestRestorePoint                         *string                    `json:"earliestRestorePoint,omitempty"`
	FailoverGroupId                              *string                    `json:"failoverGroupId,omitempty"`
	IsLedgerOn                                   *bool                      `json:"isLedgerOn,omitempty"`
	LastBackupName                               *string                    `json:"lastBackupName,omitempty"`
	LongTermRetentionBackupResourceId            *string                    `json:"longTermRetentionBackupResourceId,omitempty"`
	RecoverableDatabaseId                        *string                    `json:"recoverableDatabaseId,omitempty"`
	RestorableDroppedDatabaseId                  *string                    `json:"restorableDroppedDatabaseId,omitempty"`
	RestorePointInTime                           *string                    `json:"restorePointInTime,omitempty"`
	SourceDatabaseId                             *string                    `json:"sourceDatabaseId,omitempty"`
	Status                                       *ManagedDatabaseStatus     `json:"status,omitempty"`
	StorageContainerIdentity                     *string                    `json:"storageContainerIdentity,omitempty"`
	StorageContainerSasToken                     *string                    `json:"storageContainerSasToken,omitempty"`
	StorageContainerUri                          *string                    `json:"storageContainerUri,omitempty"`
}

func (*ManagedDatabaseProperties) GetCreationDateAsTime

func (o *ManagedDatabaseProperties) GetCreationDateAsTime() (*time.Time, error)

func (*ManagedDatabaseProperties) GetEarliestRestorePointAsTime

func (o *ManagedDatabaseProperties) GetEarliestRestorePointAsTime() (*time.Time, error)

func (*ManagedDatabaseProperties) GetRestorePointInTimeAsTime

func (o *ManagedDatabaseProperties) GetRestorePointInTimeAsTime() (*time.Time, error)

func (*ManagedDatabaseProperties) SetCreationDateAsTime

func (o *ManagedDatabaseProperties) SetCreationDateAsTime(input time.Time)

func (*ManagedDatabaseProperties) SetEarliestRestorePointAsTime

func (o *ManagedDatabaseProperties) SetEarliestRestorePointAsTime(input time.Time)

func (*ManagedDatabaseProperties) SetRestorePointInTimeAsTime

func (o *ManagedDatabaseProperties) SetRestorePointInTimeAsTime(input time.Time)

type ManagedDatabaseStartMoveDefinition

type ManagedDatabaseStartMoveDefinition struct {
	DestinationManagedDatabaseId string             `json:"destinationManagedDatabaseId"`
	OperationMode                *MoveOperationMode `json:"operationMode,omitempty"`
}

type ManagedDatabaseStatus

type ManagedDatabaseStatus string
const (
	ManagedDatabaseStatusCreating     ManagedDatabaseStatus = "Creating"
	ManagedDatabaseStatusDbCopying    ManagedDatabaseStatus = "DbCopying"
	ManagedDatabaseStatusDbMoving     ManagedDatabaseStatus = "DbMoving"
	ManagedDatabaseStatusInaccessible ManagedDatabaseStatus = "Inaccessible"
	ManagedDatabaseStatusOffline      ManagedDatabaseStatus = "Offline"
	ManagedDatabaseStatusOnline       ManagedDatabaseStatus = "Online"
	ManagedDatabaseStatusRestoring    ManagedDatabaseStatus = "Restoring"
	ManagedDatabaseStatusShutdown     ManagedDatabaseStatus = "Shutdown"
	ManagedDatabaseStatusStarting     ManagedDatabaseStatus = "Starting"
	ManagedDatabaseStatusStopped      ManagedDatabaseStatus = "Stopped"
	ManagedDatabaseStatusStopping     ManagedDatabaseStatus = "Stopping"
	ManagedDatabaseStatusUpdating     ManagedDatabaseStatus = "Updating"
)

func (*ManagedDatabaseStatus) UnmarshalJSON

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

type ManagedDatabaseUpdate

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

type ManagedDatabasesClient

type ManagedDatabasesClient struct {
	Client *resourcemanager.Client
}

func NewManagedDatabasesClientWithBaseURI

func NewManagedDatabasesClientWithBaseURI(sdkApi sdkEnv.Api) (*ManagedDatabasesClient, error)

func (ManagedDatabasesClient) CancelMove

CancelMove ...

func (ManagedDatabasesClient) CancelMoveThenPoll

CancelMoveThenPoll performs CancelMove then polls until it's completed

func (ManagedDatabasesClient) CompleteMove

CompleteMove ...

func (ManagedDatabasesClient) CompleteMoveThenPoll

CompleteMoveThenPoll performs CompleteMove then polls until it's completed

func (ManagedDatabasesClient) CompleteRestore

CompleteRestore ...

func (ManagedDatabasesClient) CompleteRestoreThenPoll

CompleteRestoreThenPoll performs CompleteRestore then polls until it's completed

func (ManagedDatabasesClient) CreateOrUpdate

CreateOrUpdate ...

func (ManagedDatabasesClient) CreateOrUpdateThenPoll

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (ManagedDatabasesClient) Delete

Delete ...

func (ManagedDatabasesClient) DeleteThenPoll

DeleteThenPoll performs Delete then polls until it's completed

func (ManagedDatabasesClient) Get

Get ...

func (ManagedDatabasesClient) ListByInstance

ListByInstance ...

func (ManagedDatabasesClient) ListByInstanceComplete

ListByInstanceComplete retrieves all the results into a single object

func (ManagedDatabasesClient) ListByInstanceCompleteMatchingPredicate

func (c ManagedDatabasesClient) ListByInstanceCompleteMatchingPredicate(ctx context.Context, id commonids.SqlManagedInstanceId, predicate ManagedDatabaseOperationPredicate) (result ListByInstanceCompleteResult, err error)

ListByInstanceCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ManagedDatabasesClient) ListInaccessibleByInstance

ListInaccessibleByInstance ...

func (ManagedDatabasesClient) ListInaccessibleByInstanceComplete

ListInaccessibleByInstanceComplete retrieves all the results into a single object

func (ManagedDatabasesClient) ListInaccessibleByInstanceCompleteMatchingPredicate

func (c ManagedDatabasesClient) ListInaccessibleByInstanceCompleteMatchingPredicate(ctx context.Context, id commonids.SqlManagedInstanceId, predicate ManagedDatabaseOperationPredicate) (result ListInaccessibleByInstanceCompleteResult, err error)

ListInaccessibleByInstanceCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ManagedDatabasesClient) StartMove

StartMove ...

func (ManagedDatabasesClient) StartMoveThenPoll

StartMoveThenPoll performs StartMove then polls until it's completed

func (ManagedDatabasesClient) Update

Update ...

func (ManagedDatabasesClient) UpdateThenPoll

UpdateThenPoll performs Update then polls until it's completed

type MoveOperationMode

type MoveOperationMode string
const (
	MoveOperationModeCopy MoveOperationMode = "Copy"
	MoveOperationModeMove MoveOperationMode = "Move"
)

func (*MoveOperationMode) UnmarshalJSON

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

type StartMoveOperationResponse

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

type UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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