README ¶
github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2022-03-08-preview/databases
Documentation
The databases
SDK allows for interaction with the Azure Resource Manager Service postgresql
(API Version 2022-03-08-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/2022-03-08-preview/databases"
Client Initialization
client := databases.NewDatabasesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
Example Usage: DatabasesClient.Create
ctx := context.TODO()
id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerValue", "databaseValue")
payload := databases.Database{
// ...
}
if err := client.CreateThenPoll(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", "flexibleServerValue", "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", "flexibleServerValue", "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.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerValue")
// 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
}
Documentation ¶
Index ¶
- func ValidateDatabaseID(input interface{}, key string) (warnings []string, errors []error)
- func ValidateFlexibleServerID(input interface{}, key string) (warnings []string, errors []error)
- type CreateOperationResponse
- type Database
- type DatabaseId
- type DatabaseOperationPredicate
- type DatabaseProperties
- type DatabasesClient
- func (c DatabasesClient) Create(ctx context.Context, id DatabaseId, input Database) (result CreateOperationResponse, err error)
- func (c DatabasesClient) CreateThenPoll(ctx context.Context, id DatabaseId, input Database) error
- func (c DatabasesClient) Delete(ctx context.Context, id DatabaseId) (result DeleteOperationResponse, err error)
- func (c DatabasesClient) DeleteThenPoll(ctx context.Context, id DatabaseId) error
- func (c DatabasesClient) Get(ctx context.Context, id DatabaseId) (result GetOperationResponse, err error)
- func (c DatabasesClient) ListByServer(ctx context.Context, id FlexibleServerId) (result ListByServerOperationResponse, err error)
- func (c DatabasesClient) ListByServerComplete(ctx context.Context, id FlexibleServerId) (ListByServerCompleteResult, error)
- func (c DatabasesClient) ListByServerCompleteMatchingPredicate(ctx context.Context, id FlexibleServerId, predicate DatabaseOperationPredicate) (result ListByServerCompleteResult, err error)
- type DeleteOperationResponse
- type FlexibleServerId
- type GetOperationResponse
- type ListByServerCompleteResult
- type ListByServerOperationResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateDatabaseID ¶
ValidateDatabaseID checks that 'input' can be parsed as a Database ID
func ValidateFlexibleServerID ¶
ValidateFlexibleServerID checks that 'input' can be parsed as a Flexible Server ID
Types ¶
type CreateOperationResponse ¶
type Database ¶
type Database struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` Properties *DatabaseProperties `json:"properties,omitempty"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` Type *string `json:"type,omitempty"` }
type DatabaseId ¶
type DatabaseId struct { SubscriptionId string ResourceGroupName string FlexibleServerName string DatabaseName string }
DatabaseId is a struct representing the Resource ID for a Database
func NewDatabaseID ¶
func NewDatabaseID(subscriptionId string, resourceGroupName string, flexibleServerName 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 ¶ added in v0.20231127.1171502
func (id *DatabaseId) FromParseResult(input resourceids.ParseResult) error
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 DatabaseOperationPredicate ¶
func (DatabaseOperationPredicate) Matches ¶
func (p DatabaseOperationPredicate) Matches(input Database) bool
type DatabaseProperties ¶
type DatabasesClient ¶
type DatabasesClient struct {
Client *resourcemanager.Client
}
func NewDatabasesClientWithBaseURI ¶
func NewDatabasesClientWithBaseURI(sdkApi sdkEnv.Api) (*DatabasesClient, error)
func (DatabasesClient) Create ¶
func (c DatabasesClient) Create(ctx context.Context, id DatabaseId, input Database) (result CreateOperationResponse, err error)
Create ...
func (DatabasesClient) CreateThenPoll ¶
func (c DatabasesClient) CreateThenPoll(ctx context.Context, id DatabaseId, input Database) error
CreateThenPoll performs Create 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 FlexibleServerId) (result ListByServerOperationResponse, err error)
ListByServer ...
func (DatabasesClient) ListByServerComplete ¶
func (c DatabasesClient) ListByServerComplete(ctx context.Context, id FlexibleServerId) (ListByServerCompleteResult, error)
ListByServerComplete retrieves all the results into a single object
func (DatabasesClient) ListByServerCompleteMatchingPredicate ¶
func (c DatabasesClient) ListByServerCompleteMatchingPredicate(ctx context.Context, id FlexibleServerId, predicate DatabaseOperationPredicate) (result ListByServerCompleteResult, err error)
ListByServerCompleteMatchingPredicate retrieves all the results and then applies the predicate
type DeleteOperationResponse ¶
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 ListByServerCompleteResult ¶
type ListByServerCompleteResult struct {
Items []Database
}