regions

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: 5 Imported by: 1

Documentation

Overview

Package regions contains the API calls for the Active-Active Subscription regions service.

Index

Constants

This section is empty.

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 added in v0.1.11

func (a *API) Create(ctx context.Context, subId int, region CreateRegion) (int, error)

Create will create a new region

func (*API) DeleteWithQuery added in v0.1.11

func (a *API) DeleteWithQuery(ctx context.Context, id int, regions DeleteRegions) error

func (API) List

func (a API) List(ctx context.Context, subId int) (*Regions, error)

List will list all of a given subscription's active-active regions.

type CreateDatabase added in v0.1.11

type CreateDatabase struct {
	Name                       *string                `json:"name,omitempty"`
	LocalThroughputMeasurement *CreateLocalThroughput `json:"localThroughputMeasurement,omitempty"`
}

type CreateLocalThroughput added in v0.1.11

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

type CreateRegion added in v0.1.11

type CreateRegion struct {
	Region         *string           `json:"region,omitempty"`
	DeploymentCIDR *string           `json:"deploymentCIDR,omitempty"`
	DryRun         *bool             `json:"dryRun,omitempty"`
	RespVersion    *string           `json:"respVersion,omitempty"`
	Databases      []*CreateDatabase `json:"databases,omitempty"`
}

type Database

type Database struct {
	DatabaseId               *int    `json:"databaseId,omitempty"`
	DatabaseName             *string `json:"DatabaseName,omitempty"`
	ReadOperationsPerSecond  *int    `json:"readOperationsPerSecond,omitempty"`
	WriteOperationsPerSecond *int    `json:"writeOperationsPerSecond,omitempty"`
}

type DeleteRegion added in v0.1.11

type DeleteRegion struct {
	Region *string `json:"region,omitempty"`
}

type DeleteRegions added in v0.1.11

type DeleteRegions struct {
	Regions []*DeleteRegion `json:"regions,omitempty"`
}

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
	DeleteWithQuery(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error
}

type Log

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

type Region

type Region struct {
	RegionId       *int        `json:"regionId,omitempty"`
	Region         *string     `json:"region,omitempty"`
	RecreateRegion *bool       `json:"-"`
	DeploymentCIDR *string     `json:"deploymentCIDR,omitempty"`
	VpcId          *string     `json:"vpcId,omitempty"`
	Databases      []*Database `json:"databases,omitempty"`
}

func (Region) String

func (o Region) String() string

type Regions

type Regions struct {
	SubscriptionId *int      `json:"subscriptionId,omitempty"`
	Regions        []*Region `json:"regions,omitempty"`
}

func (Regions) String

func (o Regions) 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
}

Jump to

Keyboard shortcuts

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