databases

package
v0.20240524.1090207 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/redisenterprise/2023-07-01/databases Documentation

The databases SDK allows for interaction with the Azure Resource Manager Service redisenterprise (API Version 2023-07-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/redisenterprise/2023-07-01/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", "redisEnterpriseValue", "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", "redisEnterpriseValue", "databaseValue")

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

Example Usage: DatabasesClient.Export

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

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


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

Example Usage: DatabasesClient.Flush

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

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


if err := client.FlushThenPoll(ctx, id, payload); err != nil {
	// handle the error
}
ctx := context.TODO()
id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseValue", "databaseValue")

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


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

Example Usage: DatabasesClient.Get

ctx := context.TODO()
id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseValue", "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.Import

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

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


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

Example Usage: DatabasesClient.ListByCluster

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

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

Example Usage: DatabasesClient.ListKeys

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

read, err := client.ListKeys(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: DatabasesClient.RegenerateKey

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

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


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

Example Usage: DatabasesClient.Update

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

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


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 PossibleValuesForAccessKeyType

func PossibleValuesForAccessKeyType() []string

func PossibleValuesForAofFrequency

func PossibleValuesForAofFrequency() []string

func PossibleValuesForClusteringPolicy

func PossibleValuesForClusteringPolicy() []string

func PossibleValuesForEvictionPolicy

func PossibleValuesForEvictionPolicy() []string

func PossibleValuesForLinkState

func PossibleValuesForLinkState() []string

func PossibleValuesForProtocol

func PossibleValuesForProtocol() []string

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func PossibleValuesForRdbFrequency

func PossibleValuesForRdbFrequency() []string

func PossibleValuesForResourceState

func PossibleValuesForResourceState() []string

func ValidateDatabaseID

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

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

func ValidateRedisEnterpriseID

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

ValidateRedisEnterpriseID checks that 'input' can be parsed as a Redis Enterprise ID

Types

type AccessKeyType

type AccessKeyType string
const (
	AccessKeyTypePrimary   AccessKeyType = "Primary"
	AccessKeyTypeSecondary AccessKeyType = "Secondary"
)

func (*AccessKeyType) UnmarshalJSON

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

type AccessKeys

type AccessKeys struct {
	PrimaryKey   *string `json:"primaryKey,omitempty"`
	SecondaryKey *string `json:"secondaryKey,omitempty"`
}

type AofFrequency

type AofFrequency string
const (
	AofFrequencyAlways AofFrequency = "always"
	AofFrequencyOnes   AofFrequency = "1s"
)

func (*AofFrequency) UnmarshalJSON

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

type ClusteringPolicy

type ClusteringPolicy string
const (
	ClusteringPolicyEnterpriseCluster ClusteringPolicy = "EnterpriseCluster"
	ClusteringPolicyOSSCluster        ClusteringPolicy = "OSSCluster"
)

func (*ClusteringPolicy) UnmarshalJSON

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

type CreateOperationResponse

type CreateOperationResponse 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
	RedisEnterpriseName string
	DatabaseName        string
}

DatabaseId is a struct representing the Resource ID for a Database

func NewDatabaseID

func NewDatabaseID(subscriptionId string, resourceGroupName string, redisEnterpriseName 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 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 {
	ClientProtocol    *Protocol                         `json:"clientProtocol,omitempty"`
	ClusteringPolicy  *ClusteringPolicy                 `json:"clusteringPolicy,omitempty"`
	EvictionPolicy    *EvictionPolicy                   `json:"evictionPolicy,omitempty"`
	GeoReplication    *DatabasePropertiesGeoReplication `json:"geoReplication,omitempty"`
	Modules           *[]Module                         `json:"modules,omitempty"`
	Persistence       *Persistence                      `json:"persistence,omitempty"`
	Port              *int64                            `json:"port,omitempty"`
	ProvisioningState *ProvisioningState                `json:"provisioningState,omitempty"`
	ResourceState     *ResourceState                    `json:"resourceState,omitempty"`
}

type DatabasePropertiesGeoReplication

type DatabasePropertiesGeoReplication struct {
	GroupNickname   *string           `json:"groupNickname,omitempty"`
	LinkedDatabases *[]LinkedDatabase `json:"linkedDatabases,omitempty"`
}

type DatabaseUpdate

type DatabaseUpdate struct {
	Properties *DatabaseProperties `json:"properties,omitempty"`
}

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

Export ...

func (DatabasesClient) ExportThenPoll

func (c DatabasesClient) ExportThenPoll(ctx context.Context, id DatabaseId, input ExportClusterParameters) error

ExportThenPoll performs Export then polls until it's completed

func (DatabasesClient) Flush

Flush ...

func (DatabasesClient) FlushThenPoll

func (c DatabasesClient) FlushThenPoll(ctx context.Context, id DatabaseId, input FlushParameters) error

FlushThenPoll performs Flush then polls until it's completed

ForceUnlink ...

func (DatabasesClient) ForceUnlinkThenPoll

func (c DatabasesClient) ForceUnlinkThenPoll(ctx context.Context, id DatabaseId, input ForceUnlinkParameters) error

ForceUnlinkThenPoll performs ForceUnlink 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) Import

Import ...

func (DatabasesClient) ImportThenPoll

func (c DatabasesClient) ImportThenPoll(ctx context.Context, id DatabaseId, input ImportClusterParameters) error

ImportThenPoll performs Import then polls until it's completed

func (DatabasesClient) ListByCluster

ListByCluster ...

func (DatabasesClient) ListByClusterComplete

ListByClusterComplete retrieves all the results into a single object

func (DatabasesClient) ListByClusterCompleteMatchingPredicate

func (c DatabasesClient) ListByClusterCompleteMatchingPredicate(ctx context.Context, id RedisEnterpriseId, predicate DatabaseOperationPredicate) (result ListByClusterCompleteResult, err error)

ListByClusterCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (DatabasesClient) ListKeys

func (c DatabasesClient) ListKeys(ctx context.Context, id DatabaseId) (result ListKeysOperationResponse, err error)

ListKeys ...

func (DatabasesClient) RegenerateKey

RegenerateKey ...

func (DatabasesClient) RegenerateKeyThenPoll

func (c DatabasesClient) RegenerateKeyThenPoll(ctx context.Context, id DatabaseId, input RegenerateKeyParameters) error

RegenerateKeyThenPoll performs RegenerateKey then polls until it's completed

func (DatabasesClient) Update

func (c DatabasesClient) Update(ctx context.Context, id DatabaseId, input DatabaseUpdate) (result UpdateOperationResponse, err error)

Update ...

func (DatabasesClient) UpdateThenPoll

func (c DatabasesClient) UpdateThenPoll(ctx context.Context, id DatabaseId, input DatabaseUpdate) error

UpdateThenPoll performs Update then polls until it's completed

type DeleteOperationResponse

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

type EvictionPolicy

type EvictionPolicy string
const (
	EvictionPolicyAllKeysLFU     EvictionPolicy = "AllKeysLFU"
	EvictionPolicyAllKeysLRU     EvictionPolicy = "AllKeysLRU"
	EvictionPolicyAllKeysRandom  EvictionPolicy = "AllKeysRandom"
	EvictionPolicyNoEviction     EvictionPolicy = "NoEviction"
	EvictionPolicyVolatileLFU    EvictionPolicy = "VolatileLFU"
	EvictionPolicyVolatileLRU    EvictionPolicy = "VolatileLRU"
	EvictionPolicyVolatileRandom EvictionPolicy = "VolatileRandom"
	EvictionPolicyVolatileTTL    EvictionPolicy = "VolatileTTL"
)

func (*EvictionPolicy) UnmarshalJSON

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

type ExportClusterParameters

type ExportClusterParameters struct {
	SasUri string `json:"sasUri"`
}

type ExportOperationResponse

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

type FlushOperationResponse

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

type FlushParameters

type FlushParameters struct {
	Ids *[]string `json:"ids,omitempty"`
}

type ForceUnlinkOperationResponse

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

type ForceUnlinkParameters

type ForceUnlinkParameters struct {
	Ids []string `json:"ids"`
}

type GetOperationResponse

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

type ImportClusterParameters

type ImportClusterParameters struct {
	SasUris []string `json:"sasUris"`
}

type ImportOperationResponse

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

type LinkState

type LinkState string
const (
	LinkStateLinkFailed   LinkState = "LinkFailed"
	LinkStateLinked       LinkState = "Linked"
	LinkStateLinking      LinkState = "Linking"
	LinkStateUnlinkFailed LinkState = "UnlinkFailed"
	LinkStateUnlinking    LinkState = "Unlinking"
)

func (*LinkState) UnmarshalJSON

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

type LinkedDatabase

type LinkedDatabase struct {
	Id    *string    `json:"id,omitempty"`
	State *LinkState `json:"state,omitempty"`
}

type ListByClusterCompleteResult

type ListByClusterCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Database
}

type ListByClusterOperationResponse

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

type ListKeysOperationResponse

type ListKeysOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *AccessKeys
}

type Module

type Module struct {
	Args    *string `json:"args,omitempty"`
	Name    string  `json:"name"`
	Version *string `json:"version,omitempty"`
}

type Persistence

type Persistence struct {
	AofEnabled   *bool         `json:"aofEnabled,omitempty"`
	AofFrequency *AofFrequency `json:"aofFrequency,omitempty"`
	RdbEnabled   *bool         `json:"rdbEnabled,omitempty"`
	RdbFrequency *RdbFrequency `json:"rdbFrequency,omitempty"`
}

type Protocol

type Protocol string
const (
	ProtocolEncrypted Protocol = "Encrypted"
	ProtocolPlaintext Protocol = "Plaintext"
)

func (*Protocol) UnmarshalJSON

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

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateCanceled  ProvisioningState = "Canceled"
	ProvisioningStateCreating  ProvisioningState = "Creating"
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
)

func (*ProvisioningState) UnmarshalJSON

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

type RdbFrequency

type RdbFrequency string
const (
	RdbFrequencyOneTwoh RdbFrequency = "12h"
	RdbFrequencyOneh    RdbFrequency = "1h"
	RdbFrequencySixh    RdbFrequency = "6h"
)

func (*RdbFrequency) UnmarshalJSON

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

type RedisEnterpriseId

type RedisEnterpriseId struct {
	SubscriptionId      string
	ResourceGroupName   string
	RedisEnterpriseName string
}

RedisEnterpriseId is a struct representing the Resource ID for a Redis Enterprise

func NewRedisEnterpriseID

func NewRedisEnterpriseID(subscriptionId string, resourceGroupName string, redisEnterpriseName string) RedisEnterpriseId

NewRedisEnterpriseID returns a new RedisEnterpriseId struct

func ParseRedisEnterpriseID

func ParseRedisEnterpriseID(input string) (*RedisEnterpriseId, error)

ParseRedisEnterpriseID parses 'input' into a RedisEnterpriseId

func ParseRedisEnterpriseIDInsensitively

func ParseRedisEnterpriseIDInsensitively(input string) (*RedisEnterpriseId, error)

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

func (*RedisEnterpriseId) FromParseResult

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

func (RedisEnterpriseId) ID

func (id RedisEnterpriseId) ID() string

ID returns the formatted Redis Enterprise ID

func (RedisEnterpriseId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Redis Enterprise ID

func (RedisEnterpriseId) String

func (id RedisEnterpriseId) String() string

String returns a human-readable description of this Redis Enterprise ID

type RegenerateKeyOperationResponse

type RegenerateKeyOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *AccessKeys
}

type RegenerateKeyParameters

type RegenerateKeyParameters struct {
	KeyType AccessKeyType `json:"keyType"`
}

type ResourceState

type ResourceState string
const (
	ResourceStateCreateFailed  ResourceState = "CreateFailed"
	ResourceStateCreating      ResourceState = "Creating"
	ResourceStateDeleteFailed  ResourceState = "DeleteFailed"
	ResourceStateDeleting      ResourceState = "Deleting"
	ResourceStateDisableFailed ResourceState = "DisableFailed"
	ResourceStateDisabled      ResourceState = "Disabled"
	ResourceStateDisabling     ResourceState = "Disabling"
	ResourceStateEnableFailed  ResourceState = "EnableFailed"
	ResourceStateEnabling      ResourceState = "Enabling"
	ResourceStateRunning       ResourceState = "Running"
	ResourceStateUpdateFailed  ResourceState = "UpdateFailed"
	ResourceStateUpdating      ResourceState = "Updating"
)

func (*ResourceState) UnmarshalJSON

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

type UpdateOperationResponse

type UpdateOperationResponse struct {
	Poller       pollers.Poller
	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