databases

package
v0.20231109.1094450 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MPL-2.0 Imports: 11 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2022-01-01/databases Documentation

The databases SDK allows for interaction with the Azure Resource Manager Service mysql (API Version 2022-01-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/mysql/2022-01-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", "flexibleServerValue", "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", "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

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 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 CreateOrUpdateOperationResponse

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

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

type DatabaseOperationPredicate struct {
	Id   *string
	Name *string
	Type *string
}

func (DatabaseOperationPredicate) Matches

func (p DatabaseOperationPredicate) Matches(input Database) bool

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

ListByServer ...

func (DatabasesClient) ListByServerComplete

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 DeleteOperationResponse struct {
	Poller       pollers.Poller
	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) 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        *Database
}

type ListByServerCompleteResult

type ListByServerCompleteResult struct {
	Items []Database
}

type ListByServerOperationResponse

type ListByServerOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Database
}

Jump to

Keyboard shortcuts

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