cluster

package
v1.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreEqual

func AreEqual[T comparable](array1 []T, array2 []T) bool

AreEqual returns true if the two arrays contain the same elements, without any extra values, False otherwise.

func IsFinalState

func IsFinalState(state State) bool

IsFinalState checks whether cluster is successfully deployed/updated or not while creation/updation TODO: Degraded, draft, peeringFailed, turningOffFailed, and turningOnFailed are not known when it occurs and What happens if rebalancing fails? Will it retry?".

Types

type Availability

type Availability struct {
	// Type is availability zone type, either 'single' or 'multi'.
	Type AvailabilityType `json:"type"`
}

Availability defines if the cluster nodes will be deployed in multiple or single availability zones in the cloud.

type AvailabilityType

type AvailabilityType string

AvailabilityType is availability zone type, either 'single' or 'multi'.

type CloudProvider

type CloudProvider struct {
	// Cidr block for Cloud Provider.
	Cidr string `json:"cidr"`

	// Region is cloud provider region, e.g. 'us-west-2'. For information about supported regions, see
	// [Amazon Web Services](https://docs.couchbase.com/cloud/reference/aws.html).
	// [Google Cloud Provider](https://docs.couchbase.com/cloud/reference/gcp.html).
	// [Azure Cloud](https://docs.couchbase.com/cloud/reference/azure.html).
	Region string `json:"region"`

	// Type is cloud provider type, either 'AWS', 'GCP', or 'Azure'.
	Type CloudProviderType `json:"type"`
}

CloudProvider depicts where the cluster will be hosted. To learn more, see [Amazon Web Services](https://docs.couchbase.com/cloud/reference/aws.html).

type CloudProviderType

type CloudProviderType string

CloudProviderType is cloud provider type, either 'AWS', 'GCP', or 'Azure'.

const (
	Aws   CloudProviderType = "aws"
	Azure CloudProviderType = "azure"
	Gcp   CloudProviderType = "gcp"
)

Defines values for CloudProviderType.

type Compute

type Compute struct {
	// Cpu depicts cpu units (cores).
	Cpu int `json:"cpu"`

	// Ram depicts ram units (GB).
	Ram int `json:"ram"`
}

Compute depicts the couchbase compute, following are the supported compute combinations for CPU and RAM for different cloud providers. To learn more, see: [AWS] https://docs.couchbase.com/cloud/reference/aws.html [GCP] https://docs.couchbase.com/cloud/reference/gcp.html Azure https://docs.couchbase.com/cloud/reference/azure.html

type ConfigurationType

type ConfigurationType string

ConfigurationType defines model for ConfigurationType, either 'multiNode' or 'singleNode'.

type CouchbaseServer

type CouchbaseServer struct {
	// Version is version of the Couchbase Server to be installed
	// in the cluster. Refer to documentation
	// [here](https://docs.couchbase.com/cloud/clusters/upgrade-database.html#server-version-maintenance-support)
	// for list of supported versions. The latest Couchbase Server version
	// will be deployed by default.
	Version *string `json:"version,omitempty"`
}

CouchbaseServer defines version for the Couchbase Server to be launched during the creation of the Capella cluster.

type CreateClusterRequest

type CreateClusterRequest struct {
	// CouchbaseServer is the version of the Couchbase Server to be installed in the cluster.
	// Refer to documentation here (https://docs.couchbase.com/cloud/clusters/upgrade-database.html#server-version-maintenance-support)
	// for list of supported versions.
	// The latest Couchbase Server version will be deployed by default.
	CouchbaseServer *CouchbaseServer `json:"couchbaseServer,omitempty"`

	// Description depicts description of the cluster (up to 1024 characters).
	Description *string `json:"description,omitempty"`

	// CloudProvider is the cloud provider where the cluster will be hosted.
	// To learn more, see:
	// [AWS] https://docs.couchbase.com/cloud/reference/aws.html
	// [GCP] https://docs.couchbase.com/cloud/reference/gcp.html
	// [Azure] https://docs.couchbase.com/cloud/reference/azure.html
	CloudProvider CloudProvider `json:"cloudProvider"`

	// Support defines the support plan and timezone for this particular cluster.
	Support Support `json:"support"`

	// Availability zone type, either 'single' or 'multi'.
	// Enum: "single" "multi"
	Availability Availability `json:"availability"`

	// ConfigurationType defines model for ConfigurationType, either 'multiNode' or 'singleNode'
	ConfigurationType ConfigurationType `json:"configurationType"`

	// Name is the name of the cluster (up to 256 characters).
	Name string `json:"name"`

	// ServiceGroups is the couchbase service groups to be run. At least one
	// service group must contain the data service.
	ServiceGroups []ServiceGroup `json:"serviceGroups"`
}

CreateClusterRequest is the request payload sent to the Capella V4 Public API in order to create a new cluster. A Couchbase cluster consists of one or more instances of Couchbase Capella, each running on an independent node. Data and services are shared across the cluster. A cluster may be referred to as a "database" in the documentation and in the Couchbase Capella user interface.

In order to access this endpoint, the provided API key must have at least one of the following roles:

Organization Owner Project Owner Project Manager To learn more, see https://docs.couchbase.com/cloud/organizations/organization-projects-overview.html

type CreateClusterResponse

type CreateClusterResponse struct {
	// Id is the UUID of the cluster created.
	Id uuid.UUID `json:"id"`
}

CreateClusterResponse is the response received from the Capella V4 Public API when asked to create a new cluster.

type DiskAWS

type DiskAWS struct {
	// Type depicts type of disk. Please choose from the given list for
	// AWS cloud provider.
	Type DiskAWSType `json:"type"`

	// Iops Please refer to documentation for supported IOPS.
	Iops int `json:"iops"`

	// Storage depicts storage in GB. See documentation for supported storage.
	Storage int `json:"storage"`
}

DiskAWS defines the disk metadata as supported by AWS.

type DiskAWSType

type DiskAWSType string

DiskAWSType depicts type of disk. Please choose from the given list for AWS cloud provider.

type DiskAzure

type DiskAzure struct {
	// Iops is required for ultra disk types. Please refer to documentation
	// for supported IOPS.
	Iops *int `json:"iops,omitempty"`

	// Storage depicts storage in GB. Required for ultra disk types.
	// Please refer to documentation for supported storage.
	Storage *int `json:"storage,omitempty"`

	// Type depicts type of disk. Please choose from the given list
	// for Azure cloud provider.
	Type DiskAzureType `json:"type"`

	// Autoexpansion determines if disk auto expansion is enabled
	Autoexpansion *bool `json:"autoexpansion,omitempty"`
}

DiskAzure defines attributes for disks metadata supported in Azure.

type DiskAzureType

type DiskAzureType string

DiskAzureType depicts type of disk. Please choose from the given list for Azure cloud provider.

type DiskGCP

type DiskGCP struct {
	// Type is type of disk. Please choose from the given list for GCP cloud provider.
	Type DiskGCPType `json:"type"`

	// Storage is storage in GB. Please refer to documentation for supported storage.
	Storage int `json:"storage"`
}

DiskGCP defines the disk metadata as supported by GCP.

type DiskGCPType

type DiskGCPType string

DiskGCPType is type of disk. Please choose from the given list for GCP cloud provider.

type GetClusterResponse

type GetClusterResponse struct {
	// CouchbaseServer is the version of the Couchbase Server to be installed in the cluster.
	// Refer to documentation here (https://docs.couchbase.com/cloud/clusters/upgrade-database.html#server-version-maintenance-support)
	// for list of supported versions.
	// The latest Couchbase Server version will be deployed by default.
	CouchbaseServer CouchbaseServer `json:"couchbaseServer"`

	// AppServiceId is the ID of the linked app service.
	AppServiceId *uuid.UUID `json:"appServiceId,omitempty"`

	// CloudProvider is the cloud provider where the cluster will be hosted.
	// To learn more, see:
	// [AWS] https://docs.couchbase.com/cloud/reference/aws.html
	// [GCP] https://docs.couchbase.com/cloud/reference/gcp.html
	// [Azure] https://docs.couchbase.com/cloud/reference/azure.html
	CloudProvider CloudProvider `json:"cloudProvider"`

	// Support defines the support plan and timezone for this particular cluster.
	Support Support `json:"support"`

	// CurrentState tells the status of the cluster - if it's healthy or degraded.
	CurrentState State `json:"currentState"`

	// ConfigurationType defines model for ConfigurationType, either 'multiNode' or 'singleNode'
	ConfigurationType ConfigurationType `json:"configurationType"`

	// Availability zone type, either 'single' or 'multi'.
	// Enum: "single" "multi"
	Availability Availability `json:"availability"`

	// Description depicts description of the cluster (up to 1024 characters).
	Description string `json:"description"`

	// Name is the name of the cluster (up to 256 characters).
	Name string `json:"name"`

	// Etag represents the version of the document
	Etag  string
	Audit api.CouchbaseAuditData `json:"audit"`

	// ServiceGroups is the couchbase service groups to be run. At least one
	// service group must contain the data service.
	ServiceGroups []ServiceGroup `json:"serviceGroups"`

	// Id is the ID of the cluster created.
	Id uuid.UUID `json:"id"`
}

GetClusterResponse is the response received from the Capella V4 Public API when asked to fetch details of an existing cluster.

In order to access this endpoint, the provided API key must have at least one of the following roles:

Organization Owner Project Owner Project Manager Project Viewer Database Data Reader/Writer Database Data Reader To learn more, see https://docs.couchbase.com/cloud/organizations/organization-projects-overview.html

type Node

type Node struct {
	// Disk is the type of disk that is supported per cloud provider during cluster creation.
	Disk json.RawMessage `json:"disk"`

	// Compute is the family of instances in cloud that are supported during cluster creation.
	// Following are the supported compute combinations for CPU
	// and RAM for different cloud providers. To learn more,
	// see [Amazon Web Services](https://docs.couchbase.com/cloud/reference/aws.html).
	Compute Compute `json:"compute"`
}

Node defines attributes of a cluster node.

func (*Node) AsDiskAWS

func (n *Node) AsDiskAWS() (DiskAWS, error)

AsDiskAWS returns the disk data as a DiskAWS.

func (*Node) AsDiskAzure

func (n *Node) AsDiskAzure() (DiskAzure, error)

AsDiskAzure returns the disk data as a DiskAzure.

func (*Node) AsDiskGCP

func (n *Node) AsDiskGCP() (DiskGCP, error)

AsDiskGCP returns the disk data as a DiskGCP.

func (*Node) FromDiskAWS

func (n *Node) FromDiskAWS(v DiskAWS) error

FromDiskAWS overwrites any disk data inside as the provided DiskAWS.

func (*Node) FromDiskAzure

func (n *Node) FromDiskAzure(v DiskAzure) error

FromDiskAzure overwrites any disk data as the provided DiskAzure.

func (*Node) FromDiskGCP

func (n *Node) FromDiskGCP(v DiskGCP) error

FromDiskGCP overwrites any disk data as the provided DiskGCP.

type Service

type Service string

Service is a string for each individual service in Couchbase Server. This field can accept enums: kv, index, n1ql, fts, analytics and eventing.

type ServiceGroup

type ServiceGroup struct {
	Node *Node `json:"node,omitempty"`

	// NumOfNodes is the number of nodes. The minimum number of
	// nodes for the cluster can be 3 and maximum can be 27 nodes.
	// Additional service groups can have 2 nodes minimum and 24 nodes maximum.
	NumOfNodes *int `json:"numOfNodes,omitempty"`

	// Services is the couchbase service to run on the node.
	Services *[]Service `json:"services,omitempty"`
}

ServiceGroup The set of nodes that share the same disk, number of nodes and services.

type State

type State string

State is the state that a cluster can have based on the fact if deployment of the cluster was successful or not.

const (
	Degraded         State = "degraded"
	Deploying        State = "deploying"
	DeploymentFailed State = "deploymentFailed"
	DestroyFailed    State = "destroyFailed"
	Destroying       State = "destroying"
	Draft            State = "draft"
	Healthy          State = "healthy"
	Offline          State = "offline"
	Peering          State = "peering"
	PeeringFailed    State = "peeringFailed"
	RebalanceFailed  State = "rebalanceFailed"
	Rebalancing      State = "rebalancing"
	ScaleFailed      State = "scaleFailed"
	Scaling          State = "scaling"
	TurnedOff        State = "turnedOff"
	TurningOff       State = "turningOff"
	TurningOffFailed State = "turningOffFailed"
	TurningOn        State = "turningOn"
	TurningOnFailed  State = "turningOnFailed"
	UpgradeFailed    State = "upgradeFailed"
	Upgrading        State = "upgrading"
)

type Support

type Support struct {
	// Plan is plan type, either 'Basic', 'Developer Pro', or 'Enterprise'.
	Plan SupportPlan `json:"plan"`

	// Timezone is the standard timezone for the cluster. Should be the TZ identifier.
	Timezone SupportTimezone `json:"timezone"`
}

Support defines the support plan and timezone for this particular cluster.

type SupportPlan

type SupportPlan string

SupportPlan is plan type, either 'Basic', 'Developer Pro', or 'Enterprise'.

type SupportTimezone

type SupportTimezone string

SupportTimezone is the standard timezone for the cluster. Should be the TZ identifier.

type UpdateClusterRequest

type UpdateClusterRequest struct {
	// Support defines the support plan and timezone for this particular cluster.
	Support Support `json:"support"`

	// Description is the new cluster description (up to 1024 characters).
	Description string `json:"description"`

	// Name is the new name of the cluster (up to 256 characters).
	Name string `json:"name"`

	// ServiceGroups is the couchbase service groups to be run. At least one
	// service group must contain the data service.
	ServiceGroups []ServiceGroup `json:"serviceGroups"`
}

UpdateClusterRequest is the payload sent to the Capella V4 Public API when asked to update an existing cluster.

In order to access this endpoint, the provided API key must have at least one of the following roles:

Organization Owner Project Owner Project Manager To learn more, see https://docs.couchbase.com/cloud/organizations/organization-projects-overview.html

Jump to

Keyboard shortcuts

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