subscriptions

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package subscriptions allows CRUD operations on the Subscriptions resource.

Index

Constants

View Source
const (
	// SubscriptionStatusActive is the active value of the `Status` field in `Subscription`
	SubscriptionStatusActive = "active"
	// SubscriptionStatusPending is the pending value of the `Status` field in `Subscription`
	SubscriptionStatusPending = "pending"
	// SubscriptionStatusError is the error value of the `Status` field in `Subscription`
	SubscriptionStatusError = "error"
	// SubscriptionStatusDeleting is the deleting value of the `Status` field in `Subscription`
	SubscriptionStatusDeleting = "deleting"

	// VPCPeeringStatusInitiatingRequest is the initiating request value of the `Status` field in `VPCPeering`
	VPCPeeringStatusInitiatingRequest = "initiating-request"
	// VPCPeeringStatusActive is the active value of the `Status` field in `VPCPeering`
	VPCPeeringStatusActive = "active"
	// VPCPeeringStatusInactive is the inactive value of the `Status` field in `VPCPeering`
	VPCPeeringStatusInactive = "inactive"
	// VPCPeeringStatusPendingAcceptance is the pending acceptance value of the `Status` field in `VPCPeering`
	VPCPeeringStatusPendingAcceptance = "pending-acceptance"
	// VPCPeeringStatusFailed is the failed value of the `Status` field in `VPCPeering`
	VPCPeeringStatusFailed = "failed"

	SubscriptionDeploymentTypeSingleRegion = "single-region"
	SubscriptionDeploymentTypeActiveActive = "active-active"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(client HttpClient, taskWaiter TaskWaiter, logger Log) *API

func (*API) Create

func (a *API) Create(ctx context.Context, subscription CreateSubscription) (int, error)

Create will create a new subscription.

func (*API) CreateActiveActiveVPCPeering added in v0.1.10

func (a *API) CreateActiveActiveVPCPeering(ctx context.Context, id int, create CreateActiveActiveVPCPeering) (int, error)

func (*API) CreateVPCPeering

func (a *API) CreateVPCPeering(ctx context.Context, id int, create CreateVPCPeering) (int, error)

CreateVPCPeering creates a new VPC peering from the subscription VPC and returns the identifier of the VPC peering.

func (*API) Delete

func (a *API) Delete(ctx context.Context, id int) error

Delete will destroy an existing subscription. All existing databases within the subscription should already be deleted, otherwise this function will fail.

func (*API) DeleteActiveActiveVPCPeering added in v0.1.13

func (a *API) DeleteActiveActiveVPCPeering(ctx context.Context, subscription int, peering int) error

func (*API) DeleteVPCPeering

func (a *API) DeleteVPCPeering(ctx context.Context, subscription int, peering int) error

DeleteVPCPeering destroys an existing VPC peering connection.

func (*API) Get

func (a *API) Get(ctx context.Context, id int) (*Subscription, error)

Get will retrieve an existing subscription.

func (*API) GetCIDRAllowlist

func (a *API) GetCIDRAllowlist(ctx context.Context, id int) (*CIDRAllowlist, error)

GetCIDRAllowlist retrieves the CIDR addresses that are allowed to access an endpoint for a database associated with a the subscription.

func (API) List

func (a API) List(ctx context.Context) ([]*Subscription, error)

List will list all of the current account's subscriptions.

func (*API) ListActiveActiveVPCPeering added in v0.1.13

func (a *API) ListActiveActiveVPCPeering(ctx context.Context, id int) ([]*ActiveActiveVpcRegion, error)

func (*API) ListVPCPeering

func (a *API) ListVPCPeering(ctx context.Context, id int) ([]*VPCPeering, error)

ListVPCPeering retrieves the VPCs that have been peered to the subscription VPC.

func (*API) Update

func (a *API) Update(ctx context.Context, id int, subscription UpdateSubscription) error

Update will make changes to an existing subscription.

func (*API) UpdateCIDRAllowlist

func (a *API) UpdateCIDRAllowlist(ctx context.Context, id int, cidr UpdateCIDRAllowlist) error

UpdateCIDRAllowlist modifies the CIDR addresses that are allowed to access an endpoint for a database associated with a the subscription.

type ActiveActiveVPCPeering added in v0.1.13

type ActiveActiveVPCPeering struct {
	ID                *int    `json:"id,omitempty"`
	Status            *string `json:"status,omitempty"`
	RegionId          *int    `json:"regionId,omitempty"`
	RegionName        *string `json:"regionName,omitempty"`
	AWSAccountID      *string `json:"awsAccountId,omitempty"`
	AWSPeeringID      *string `json:"awsPeeringUid,omitempty"`
	VPCId             *string `json:"vpcUid,omitempty"`
	VPCCidr           *string `json:"vpcCidr,omitempty"`
	VPCCidrs          []*CIDR `json:"vpcCidrs,omitempty"`
	GCPProjectUID     *string `json:"vpcProjectUid,omitempty"`
	NetworkName       *string `json:"vpcNetworkName,omitempty"`
	RedisProjectUID   *string `json:"redisProjectUid,omitempty"`
	RedisNetworkName  *string `json:"redisNetworkName,omitempty"`
	CloudPeeringID    *string `json:"cloudPeeringId,omitempty"`
	SourceRegion      *string `json:"sourceRegion,omitempty"`
	DestinationRegion *string `json:"destinationRegion,omitempty"`
}

func (ActiveActiveVPCPeering) String added in v0.1.13

func (o ActiveActiveVPCPeering) String() string

type ActiveActiveVpcRegion added in v0.1.13

type ActiveActiveVpcRegion struct {
	ID           *int                      `json:"id,omitempty"`
	SourceRegion *string                   `json:"region,omitempty"`
	VPCPeerings  []*ActiveActiveVPCPeering `json:"vpcPeerings,omitempty"`
}

type CIDR added in v0.3.0

type CIDR struct {
	VPCCidr *string `json:"vpcCidr,omitempty"`
	Status  *string `json:"active,omitempty"`
}

func (CIDR) String added in v0.3.0

func (o CIDR) String() string

type CIDRAllowlist

type CIDRAllowlist struct {
	CIDRIPs          []*string   `json:"cidr_ips,omitempty"`
	SecurityGroupIDs []*string   `json:"security_group_ids,omitempty"`
	Errors           interface{} `json:"errors,omitempty"`
}

func (CIDRAllowlist) String

func (o CIDRAllowlist) String() string

type CloudDetail

type CloudDetail struct {
	Provider       *string   `json:"provider,omitempty"`
	CloudAccountID *int      `json:"cloudAccountId,omitempty"`
	TotalSizeInGB  *float64  `json:"totalSizeInGb,omitempty"`
	Regions        []*Region `json:"regions,omitempty"`
}

func (CloudDetail) String

func (o CloudDetail) String() string

type CreateActiveActiveVPCPeering added in v0.1.13

type CreateActiveActiveVPCPeering struct {
	SourceRegion      *string   `json:"sourceRegion,omitempty"`
	DestinationRegion *string   `json:"destinationRegion,omitempty"`
	AWSAccountID      *string   `json:"awsAccountId,omitempty"`
	VPCId             *string   `json:"vpcId,omitempty"`
	VPCCidr           *string   `json:"vpcCidr,omitempty"`
	VPCCidrs          []*string `json:"vpcCidrs,omitempty"`
	Provider          *string   `json:"provider,omitempty"`
	VPCProjectUID     *string   `json:"vpcProjectUid,omitempty"`
	VPCNetworkName    *string   `json:"vpcNetworkName,omitempty"`
}

func (CreateActiveActiveVPCPeering) String added in v0.1.13

type CreateCloudProvider

type CreateCloudProvider struct {
	Provider       *string         `json:"provider,omitempty"`
	CloudAccountID *int            `json:"cloudAccountId,omitempty"`
	Regions        []*CreateRegion `json:"regions,omitempty"`
}

func (CreateCloudProvider) String

func (o CreateCloudProvider) String() string

type CreateDatabase

type CreateDatabase struct {
	Name                       *string                  `json:"name,omitempty"`
	Protocol                   *string                  `json:"protocol,omitempty"`
	MemoryLimitInGB            *float64                 `json:"memoryLimitInGb,omitempty"`
	SupportOSSClusterAPI       *bool                    `json:"supportOSSClusterApi,omitempty"`
	DataPersistence            *string                  `json:"dataPersistence,omitempty"`
	Replication                *bool                    `json:"replication,omitempty"`
	ThroughputMeasurement      *CreateThroughput        `json:"throughputMeasurement,omitempty"`
	LocalThroughputMeasurement []*CreateLocalThroughput `json:"localThroughputMeasurement,omitempty"`
	Modules                    []*CreateModules         `json:"modules,omitempty"`
	Quantity                   *int                     `json:"quantity,omitempty"`
	AverageItemSizeInBytes     *int                     `json:"averageItemSizeInBytes,omitempty"`
}

func (CreateDatabase) String

func (o CreateDatabase) String() string

type CreateLocalThroughput added in v0.1.10

type CreateLocalThroughput struct {
	Region                   *string `json:"region,omitempty"`
	WriteOperationsPerSecond *int    `json:"writeOperationsPerSecond"`
	ReadOperationsPerSecond  *int    `json:"readOperationsPerSecond"`
}

func (CreateLocalThroughput) String added in v0.1.10

func (o CreateLocalThroughput) String() string

type CreateModules

type CreateModules struct {
	Name *string `json:"name,omitempty"`
}

func (CreateModules) String

func (o CreateModules) String() string

type CreateNetworking

type CreateNetworking struct {
	DeploymentCIDR *string `json:"deploymentCIDR,omitempty"`
	VPCId          *string `json:"vpcId,omitempty"`
}

func (CreateNetworking) String

func (o CreateNetworking) String() string

type CreateRegion

type CreateRegion struct {
	Region                     *string           `json:"region,omitempty"`
	MultipleAvailabilityZones  *bool             `json:"multipleAvailabilityZones,omitempty"`
	PreferredAvailabilityZones []*string         `json:"preferredAvailabilityZones,omitempty"`
	Networking                 *CreateNetworking `json:"networking,omitempty"`
}

func (CreateRegion) String

func (o CreateRegion) String() string

type CreateSubscription

type CreateSubscription struct {
	Name            *string                `json:"name,omitempty"`
	DeploymentType  *string                `json:"deploymentType,omitempty"`
	DryRun          *bool                  `json:"dryRun,omitempty"`
	PaymentMethodID *int                   `json:"paymentMethodId,omitempty"`
	PaymentMethod   *string                `json:"paymentMethod,omitempty"`
	MemoryStorage   *string                `json:"memoryStorage,omitempty"`
	CloudProviders  []*CreateCloudProvider `json:"cloudProviders,omitempty"`
	Databases       []*CreateDatabase      `json:"databases,omitempty"`
	RedisVersion    *string                `json:"redisVersion,omitempty"`
}

func (CreateSubscription) String

func (o CreateSubscription) String() string

type CreateThroughput

type CreateThroughput struct {
	By    *string `json:"by,omitempty"`
	Value *int    `json:"value,omitempty"`
}

func (CreateThroughput) String

func (o CreateThroughput) String() string

type CreateVPCPeering

type CreateVPCPeering struct {
	Region         *string   `json:"region,omitempty"`
	AWSAccountID   *string   `json:"awsAccountId,omitempty"`
	VPCId          *string   `json:"vpcId,omitempty"`
	VPCCidr        *string   `json:"vpcCidr,omitempty"`
	VPCCidrs       []*string `json:"vpcCidrs,omitempty"`
	Provider       *string   `json:"provider,omitempty"`
	VPCProjectUID  *string   `json:"vpcProjectUid,omitempty"`
	VPCNetworkName *string   `json:"vpcNetworkName,omitempty"`
}

func (CreateVPCPeering) String

func (o CreateVPCPeering) String() string

type HttpClient

type HttpClient interface {
	Get(ctx context.Context, name, path string, responseBody interface{}) error
	Post(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error
	Put(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error
	Delete(ctx context.Context, name, path string, responseBody interface{}) error
}

type Log

type Log interface {
	Printf(format string, args ...interface{})
}

type Networking

type Networking struct {
	DeploymentCIDR *string `json:"deploymentCIDR,omitempty"`
	VPCId          *string `json:"vpcId,omitempty"`
	SubnetID       *string `json:"subnetId,omitempty"`
}

func (Networking) String

func (o Networking) String() string

type NotFound

type NotFound struct {
	ID int
}

func (*NotFound) Error

func (f *NotFound) Error() string

type Region

type Region struct {
	Region                     *string       `json:"region,omitempty"`
	Networking                 []*Networking `json:"networking,omitempty"`
	PreferredAvailabilityZones []*string     `json:"preferredAvailabilityZones,omitempty"`
	MultipleAvailabilityZones  *bool         `json:"multipleAvailabilityZones,omitempty"`
}

func (Region) String

func (o Region) String() string

type Subscription

type Subscription struct {
	ID                *int           `json:"id,omitempty"`
	Name              *string        `json:"name,omitempty"`
	Status            *string        `json:"status,omitempty"`
	DeploymentType    *string        `json:"deploymentType,omitempty"`
	PaymentMethod     *string        `json:"paymentMethodType,omitempty"`
	PaymentMethodID   *int           `json:"paymentMethodId,omitempty"`
	MemoryStorage     *string        `json:"memoryStorage,omitempty"`
	StorageEncryption *bool          `json:"storageEncryption,omitempty"`
	NumberOfDatabases *int           `json:"numberOfDatabases"`
	CloudDetails      []*CloudDetail `json:"cloudDetails,omitempty"`
}

func (Subscription) String

func (o Subscription) String() string

type TaskWaiter added in v0.9.0

type TaskWaiter interface {
	WaitForResourceId(ctx context.Context, id string) (int, error)
	WaitForResource(ctx context.Context, id string, resource interface{}) error
	Wait(ctx context.Context, id string) error
}

type UpdateCIDRAllowlist

type UpdateCIDRAllowlist struct {
	CIDRIPs          []*string `json:"cidrIps,omitempty"`
	SecurityGroupIDs []*string `json:"securityGroupIds,omitempty"`
}

func (UpdateCIDRAllowlist) String

func (o UpdateCIDRAllowlist) String() string

type UpdateSubscription

type UpdateSubscription struct {
	Name            *string `json:"name,omitempty"`
	PaymentMethodID *int    `json:"paymentMethodId,omitempty"`
}

func (UpdateSubscription) String

func (o UpdateSubscription) String() string

type VPCPeering

type VPCPeering struct {
	ID               *int    `json:"vpcPeeringId,omitempty"`
	Status           *string `json:"status,omitempty"`
	AWSAccountID     *string `json:"awsAccountId,omitempty"`
	AWSPeeringID     *string `json:"awsPeeringUid,omitempty"`
	VPCId            *string `json:"vpcUid,omitempty"`
	VPCCidr          *string `json:"vpcCidr,omitempty"`
	VPCCidrs         []*CIDR `json:"vpcCidrs,omitempty"`
	GCPProjectUID    *string `json:"projectUid,omitempty"`
	NetworkName      *string `json:"networkName,omitempty"`
	RedisProjectUID  *string `json:"redisProjectUid,omitempty"`
	RedisNetworkName *string `json:"redisNetworkName,omitempty"`
	CloudPeeringID   *string `json:"cloudPeeringId,omitempty"`
	Region           *string `json:"regionName,omitempty"`
}

func (VPCPeering) String

func (o VPCPeering) String() string

Jump to

Keyboard shortcuts

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