servers

package
v0.0.0-...-a81a29a Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2021-06-01/servers Documentation

The servers SDK allows for interaction with the Azure Resource Manager Service postgresql (API Version 2021-06-01).

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/2021-06-01/servers"

Client Initialization

client := servers.NewServersClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ServersClient.Create

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

payload := servers.Server{
	// ...
}


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

Example Usage: ServersClient.Delete

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

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

Example Usage: ServersClient.Get

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

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: ServersClient.List

ctx := context.TODO()
id := servers.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

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

Example Usage: ServersClient.ListByResourceGroup

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

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

Example Usage: ServersClient.Update

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

payload := servers.ServerForUpdate{
	// ...
}


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 PossibleValuesForCreateMode

func PossibleValuesForCreateMode() []string

func PossibleValuesForCreateModeForUpdate

func PossibleValuesForCreateModeForUpdate() []string

func PossibleValuesForGeoRedundantBackupEnum

func PossibleValuesForGeoRedundantBackupEnum() []string

func PossibleValuesForHighAvailabilityMode

func PossibleValuesForHighAvailabilityMode() []string

func PossibleValuesForServerHAState

func PossibleValuesForServerHAState() []string

func PossibleValuesForServerPublicNetworkAccessState

func PossibleValuesForServerPublicNetworkAccessState() []string

func PossibleValuesForServerState

func PossibleValuesForServerState() []string

func PossibleValuesForServerVersion

func PossibleValuesForServerVersion() []string

func PossibleValuesForSkuTier

func PossibleValuesForSkuTier() []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

Types

type Backup

type Backup struct {
	BackupRetentionDays *int64                  `json:"backupRetentionDays,omitempty"`
	EarliestRestoreDate *string                 `json:"earliestRestoreDate,omitempty"`
	GeoRedundantBackup  *GeoRedundantBackupEnum `json:"geoRedundantBackup,omitempty"`
}

func (*Backup) GetEarliestRestoreDateAsTime

func (o *Backup) GetEarliestRestoreDateAsTime() (*time.Time, error)

func (*Backup) SetEarliestRestoreDateAsTime

func (o *Backup) SetEarliestRestoreDateAsTime(input time.Time)

type CreateMode

type CreateMode string
const (
	CreateModeCreate             CreateMode = "Create"
	CreateModeDefault            CreateMode = "Default"
	CreateModePointInTimeRestore CreateMode = "PointInTimeRestore"
	CreateModeUpdate             CreateMode = "Update"
)

type CreateModeForUpdate

type CreateModeForUpdate string
const (
	CreateModeForUpdateDefault CreateModeForUpdate = "Default"
	CreateModeForUpdateUpdate  CreateModeForUpdate = "Update"
)

type CreateOperationResponse

type CreateOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

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

type GeoRedundantBackupEnum string
const (
	GeoRedundantBackupEnumDisabled GeoRedundantBackupEnum = "Disabled"
	GeoRedundantBackupEnumEnabled  GeoRedundantBackupEnum = "Enabled"
)

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	Model        *Server
}

type HighAvailability

type HighAvailability struct {
	Mode                    *HighAvailabilityMode `json:"mode,omitempty"`
	StandbyAvailabilityZone *string               `json:"standbyAvailabilityZone,omitempty"`
	State                   *ServerHAState        `json:"state,omitempty"`
}

type HighAvailabilityMode

type HighAvailabilityMode string
const (
	HighAvailabilityModeDisabled      HighAvailabilityMode = "Disabled"
	HighAvailabilityModeZoneRedundant HighAvailabilityMode = "ZoneRedundant"
)

type ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	Items []Server
}

type ListByResourceGroupOperationResponse

type ListByResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]Server
	// contains filtered or unexported fields
}

func (ListByResourceGroupOperationResponse) HasMore

func (ListByResourceGroupOperationResponse) LoadMore

type ListCompleteResult

type ListCompleteResult struct {
	Items []Server
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]Server
	// contains filtered or unexported fields
}

func (ListOperationResponse) HasMore

func (r ListOperationResponse) HasMore() bool

func (ListOperationResponse) LoadMore

func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error)

type MaintenanceWindow

type MaintenanceWindow struct {
	CustomWindow *string `json:"customWindow,omitempty"`
	DayOfWeek    *int64  `json:"dayOfWeek,omitempty"`
	StartHour    *int64  `json:"startHour,omitempty"`
	StartMinute  *int64  `json:"startMinute,omitempty"`
}

type Network

type Network struct {
	DelegatedSubnetResourceId   *string                         `json:"delegatedSubnetResourceId,omitempty"`
	PrivateDnsZoneArmResourceId *string                         `json:"privateDnsZoneArmResourceId,omitempty"`
	PublicNetworkAccess         *ServerPublicNetworkAccessState `json:"publicNetworkAccess,omitempty"`
}

type Server

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

type ServerForUpdate

type ServerForUpdate struct {
	Location   *string                    `json:"location,omitempty"`
	Properties *ServerPropertiesForUpdate `json:"properties,omitempty"`
	Sku        *Sku                       `json:"sku,omitempty"`
	Tags       *map[string]string         `json:"tags,omitempty"`
}

type ServerHAState

type ServerHAState string
const (
	ServerHAStateCreatingStandby ServerHAState = "CreatingStandby"
	ServerHAStateFailingOver     ServerHAState = "FailingOver"
	ServerHAStateHealthy         ServerHAState = "Healthy"
	ServerHAStateNotEnabled      ServerHAState = "NotEnabled"
	ServerHAStateRemovingStandby ServerHAState = "RemovingStandby"
	ServerHAStateReplicatingData ServerHAState = "ReplicatingData"
)

type ServerOperationPredicate

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

func (ServerOperationPredicate) Matches

func (p ServerOperationPredicate) Matches(input Server) bool

type ServerProperties

type ServerProperties struct {
	AdministratorLogin         *string            `json:"administratorLogin,omitempty"`
	AdministratorLoginPassword *string            `json:"administratorLoginPassword,omitempty"`
	AvailabilityZone           *string            `json:"availabilityZone,omitempty"`
	Backup                     *Backup            `json:"backup,omitempty"`
	CreateMode                 *CreateMode        `json:"createMode,omitempty"`
	FullyQualifiedDomainName   *string            `json:"fullyQualifiedDomainName,omitempty"`
	HighAvailability           *HighAvailability  `json:"highAvailability,omitempty"`
	MaintenanceWindow          *MaintenanceWindow `json:"maintenanceWindow,omitempty"`
	MinorVersion               *string            `json:"minorVersion,omitempty"`
	Network                    *Network           `json:"network,omitempty"`
	PointInTimeUTC             *string            `json:"pointInTimeUTC,omitempty"`
	SourceServerResourceId     *string            `json:"sourceServerResourceId,omitempty"`
	State                      *ServerState       `json:"state,omitempty"`
	Storage                    *Storage           `json:"storage,omitempty"`
	Version                    *ServerVersion     `json:"version,omitempty"`
}

func (*ServerProperties) GetPointInTimeUTCAsTime

func (o *ServerProperties) GetPointInTimeUTCAsTime() (*time.Time, error)

func (*ServerProperties) SetPointInTimeUTCAsTime

func (o *ServerProperties) SetPointInTimeUTCAsTime(input time.Time)

type ServerPropertiesForUpdate

type ServerPropertiesForUpdate struct {
	AdministratorLoginPassword *string              `json:"administratorLoginPassword,omitempty"`
	Backup                     *Backup              `json:"backup,omitempty"`
	CreateMode                 *CreateModeForUpdate `json:"createMode,omitempty"`
	HighAvailability           *HighAvailability    `json:"highAvailability,omitempty"`
	MaintenanceWindow          *MaintenanceWindow   `json:"maintenanceWindow,omitempty"`
	Storage                    *Storage             `json:"storage,omitempty"`
}

type ServerPublicNetworkAccessState

type ServerPublicNetworkAccessState string
const (
	ServerPublicNetworkAccessStateDisabled ServerPublicNetworkAccessState = "Disabled"
	ServerPublicNetworkAccessStateEnabled  ServerPublicNetworkAccessState = "Enabled"
)

type ServerState

type ServerState string
const (
	ServerStateDisabled ServerState = "Disabled"
	ServerStateDropping ServerState = "Dropping"
	ServerStateReady    ServerState = "Ready"
	ServerStateStarting ServerState = "Starting"
	ServerStateStopped  ServerState = "Stopped"
	ServerStateStopping ServerState = "Stopping"
	ServerStateUpdating ServerState = "Updating"
)

type ServerVersion

type ServerVersion string
const (
	ServerVersionOneFour  ServerVersion = "14"
	ServerVersionOneOne   ServerVersion = "11"
	ServerVersionOneThree ServerVersion = "13"
	ServerVersionOneTwo   ServerVersion = "12"
)

type ServersClient

type ServersClient struct {
	Client autorest.Client
	// contains filtered or unexported fields
}

func NewServersClientWithBaseURI

func NewServersClientWithBaseURI(endpoint string) ServersClient

func (ServersClient) Create

func (c ServersClient) Create(ctx context.Context, id FlexibleServerId, input Server) (result CreateOperationResponse, err error)

Create ...

func (ServersClient) CreateThenPoll

func (c ServersClient) CreateThenPoll(ctx context.Context, id FlexibleServerId, input Server) error

CreateThenPoll performs Create then polls until it's completed

func (ServersClient) Delete

Delete ...

func (ServersClient) DeleteThenPoll

func (c ServersClient) DeleteThenPoll(ctx context.Context, id FlexibleServerId) error

DeleteThenPoll performs Delete then polls until it's completed

func (ServersClient) Get

Get ...

func (ServersClient) List

List ...

func (ServersClient) ListByResourceGroup

ListByResourceGroup ...

func (ServersClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all of the results into a single object

func (ServersClient) ListByResourceGroupCompleteMatchingPredicate

func (c ServersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ServerOperationPredicate) (resp ListByResourceGroupCompleteResult, err error)

ListByResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (ServersClient) ListComplete

ListComplete retrieves all of the results into a single object

func (ServersClient) ListCompleteMatchingPredicate

func (c ServersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ServerOperationPredicate) (resp ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (ServersClient) Update

Update ...

func (ServersClient) UpdateThenPoll

func (c ServersClient) UpdateThenPoll(ctx context.Context, id FlexibleServerId, input ServerForUpdate) error

UpdateThenPoll performs Update then polls until it's completed

type Sku

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

type SkuTier

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

type Storage

type Storage struct {
	StorageSizeGB *int64 `json:"storageSizeGB,omitempty"`
}

type UpdateOperationResponse

type UpdateOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

Jump to

Keyboard shortcuts

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