databases

package
v0.20240903.1131440 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MPL-2.0 Imports: 11 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2017-12-01/databases Documentation

The databases SDK allows for interaction with the Azure Resource Manager Service postgresql (API Version 2017-12-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/2017-12-01/databases"

Client Initialization

client := databases.NewDatabasesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: DatabasesClient.CreateOrUpdate

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

payload := databases.Database{
	// ...
}


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

Example Usage: DatabasesClient.Delete

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

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

Example Usage: DatabasesClient.Get

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

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

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

read, err := client.ListByServer(ctx, id)
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 ValidateDatabaseID

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

ValidateDatabaseID checks that 'input' can be parsed as a Database ID

func ValidateServerID

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

ValidateServerID checks that 'input' can be parsed as a Server ID

Types

type CreateOrUpdateOperationResponse

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

type Database

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

type DatabaseId

type DatabaseId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServerName        string
	DatabaseName      string
}

DatabaseId is a struct representing the Resource ID for a Database

func NewDatabaseID

func NewDatabaseID(subscriptionId string, resourceGroupName string, serverName string, databaseName string) DatabaseId

NewDatabaseID returns a new DatabaseId struct

func ParseDatabaseID

func ParseDatabaseID(input string) (*DatabaseId, error)

ParseDatabaseID parses 'input' into a DatabaseId

func ParseDatabaseIDInsensitively

func ParseDatabaseIDInsensitively(input string) (*DatabaseId, error)

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

func (*DatabaseId) FromParseResult

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

func (DatabaseId) ID

func (id DatabaseId) ID() string

ID returns the formatted Database ID

func (DatabaseId) Segments

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

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

func (DatabaseId) String

func (id DatabaseId) String() string

String returns a human-readable description of this Database ID

type DatabaseListResult

type DatabaseListResult struct {
	Value *[]Database `json:"value,omitempty"`
}

type DatabaseProperties

type DatabaseProperties struct {
	Charset   *string `json:"charset,omitempty"`
	Collation *string `json:"collation,omitempty"`
}

type DatabasesClient

type DatabasesClient struct {
	Client *resourcemanager.Client
}

func NewDatabasesClientWithBaseURI

func NewDatabasesClientWithBaseURI(sdkApi sdkEnv.Api) (*DatabasesClient, error)

func (DatabasesClient) CreateOrUpdate

func (c DatabasesClient) CreateOrUpdate(ctx context.Context, id DatabaseId, input Database) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (DatabasesClient) CreateOrUpdateThenPoll

func (c DatabasesClient) CreateOrUpdateThenPoll(ctx context.Context, id DatabaseId, input Database) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (DatabasesClient) Delete

func (c DatabasesClient) Delete(ctx context.Context, id DatabaseId) (result DeleteOperationResponse, err error)

Delete ...

func (DatabasesClient) DeleteThenPoll

func (c DatabasesClient) DeleteThenPoll(ctx context.Context, id DatabaseId) error

DeleteThenPoll performs Delete then polls until it's completed

func (DatabasesClient) Get

func (c DatabasesClient) Get(ctx context.Context, id DatabaseId) (result GetOperationResponse, err error)

Get ...

func (DatabasesClient) ListByServer

func (c DatabasesClient) ListByServer(ctx context.Context, id ServerId) (result ListByServerOperationResponse, err error)

ListByServer ...

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        *Database
}

type ListByServerOperationResponse

type ListByServerOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *DatabaseListResult
}

type ServerId

type ServerId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServerName        string
}

ServerId is a struct representing the Resource ID for a Server

func NewServerID

func NewServerID(subscriptionId string, resourceGroupName string, serverName string) ServerId

NewServerID returns a new ServerId struct

func ParseServerID

func ParseServerID(input string) (*ServerId, error)

ParseServerID parses 'input' into a ServerId

func ParseServerIDInsensitively

func ParseServerIDInsensitively(input string) (*ServerId, error)

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

func (*ServerId) FromParseResult

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

func (ServerId) ID

func (id ServerId) ID() string

ID returns the formatted Server ID

func (ServerId) Segments

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

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

func (ServerId) String

func (id ServerId) String() string

String returns a human-readable description of this Server ID

Jump to

Keyboard shortcuts

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