models

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProvisionedStatus = "PROVISIONED"
	RunningStatus     = "RUNNING"
	Disabled          = "DISABLED"
)
View Source
const (
	NoOperation = "NO_OPERATION"

	DefaultAccountName = "INSTACLUSTR"
)
View Source
const (
	Cadence            = "CADENCE"
	CadenceNodePurpose = "CADENCE"

	AWSAccessKeyID     = "awsAccessKeyId"
	AWSSecretAccessKey = "awsSecretAccessKey"

	SharedProvisioningType   = "SHARED"
	PackagedProvisioningType = "PACKAGED"
	StandardProvisioningType = "STANDARD"
)
View Source
const (
	Username = "Username"
	Password = "Password"
)
View Source
const (
	ResourceStateAnnotation   = "instaclustr.com/resourceState"
	ClusterDeletionAnnotation = "instaclustr.com/clusterDeletion"
	DeletionConfirmed         = "instaclustr.com/deletionConfirmed"
	DeletionFinalizer         = "instaclustr.com/deletionFinalizer"
	UpdatedFieldsAnnotation   = "instaclustr.com/updatedFields"
	StartTimestampAnnotation  = "instaclustr.com/startTimestamp"

	ControlledByLabel                  = "instaclustr.com/controlledBy"
	ClusterIDLabel                     = "instaclustr.com/clusterID"
	ClustersV1alpha1APIVersion         = "clusters.instaclustr.com/v1alpha1"
	ClusterresourcesV1alpha1APIVersion = "clusterresources.instaclustr.com/v1alpha1"

	CassandraKind        = "Cassandra"
	CassandraChildPrefix = "cassandra-"
	CassandraChildDCName = "cassandra-cadence-dc"

	KafkaKind        = "Kafka"
	KafkaChildPrefix = "kafka-"
	KafkaChildDCName = "kafka-cadence-dc"

	OpenSearchKind        = "OpenSearch"
	OpenSearchChildPrefix = "opensearch-"
	OpenSearchChildDCName = "opensearch-cadence-dc"

	V3_11_13   = "3.11.13"
	V2_7_1     = "2.7.1"
	V1_3_5     = "1.3.5"
	V1_3_7     = "1.3.7"
	VPC_PEERED = "VPC_PEERED"

	True  = "true"
	False = "false"

	Triggered = "triggered"

	ClusterBackupKind       = "ClusterBackup"
	PgClusterKind           = "PostgreSQL"
	RedisClusterKind        = "Redis"
	OsClusterKind           = "OpenSearch"
	CassandraClusterKind    = "Cassandra"
	PgBackupEventType       = "postgresql-backup"
	SnapshotUploadEventType = "snapshot-upload"
	PgBackupPrefix          = "postgresql-backup-"
	SnapshotUploadPrefix    = "snapshot-upload-"
)
View Source
const (
	CreatingEvent = "creating"
	CreatedEvent  = "created"
	UpdatingEvent = "updating"
	UpdatedEvent  = "updated"
	DeletingEvent = "deleting"
	DeletedEvent  = "deleted"
	GenericEvent  = "generic"
	SecretEvent   = "secret"
)
View Source
const (
	ReplaceOperation = "replace"
	AnnotationsPath  = "/metadata/annotations"
	FinalizersPath   = "/metadata/finalizers"
)
View Source
const Requeue60 = time.Second * 60

Variables

View Source
var (
	ZeroDataCentres            = errors.New("cluster spec doesn't have data centres")
	ErrEmptyAdvancedVisibility = errors.New("advanced visibility fields are empty")
	NetworkOverlaps            = errors.New("cluster network overlaps")
)

errors for operator

View Source
var (
	ReconcileRequeue = reconcile.Result{RequeueAfter: Requeue60}
	ReconcileResult  = reconcile.Result{}
)
View Source
var (
	RedisVersions      = []string{"6.2.7", "7.0.5"}
	CassandraVersions  = []string{"4.0.4", "3.11.13"}
	SparkVersions      = []string{"2.3.2", "3.0.1"}
	PostgreSQLVersions = []string{"15.1.0", "14.6.0", "14.5.0", "13.9.0", "13.8.0"}
	PGBouncerVersions  = []string{"1.17.0"}
	PoolModes          = []string{"TRANSACTION", "SESSION", "STATEMENT"}
	ReplicationModes   = []string{"ASYNCHRONOUS", "SYNCHRONOUS"}
	CloudProviders     = []string{"AWS_VPC", "GCP", "AZURE", "AZURE_AZ"}
	SLATiers           = []string{"PRODUCTION", "NON_PRODUCTION"}
	ClusterNameRegExp  = "^[a-zA-Z0-9][a-zA-Z0-9_-]{2,31}$"
)

Functions

This section is empty.

Types

type AWSArchival

type AWSArchival struct {
	ArchivalS3Region   string `json:"archivalS3Region,omitempty"`
	AWSAccessKeyID     string `json:"awsAccessKeyId,omitempty"`
	ArchivalS3URI      string `json:"archivalS3Uri,omitempty"`
	AWSSecretAccessKey string `json:"awsSecretAccessKey,omitempty"`
}

type AddonBundle

type AddonBundle struct {
	Bundle  string         `json:"bundle"`
	Version string         `json:"version"`
	Options *BundleOptions `json:"options"`
}

type AdvancedVisibility

type AdvancedVisibility struct {
	TargetKafka      *TargetKafka      `json:"targetKafka"`
	TargetOpenSearch *TargetOpenSearch `json:"targetOpenSearch"`
}

type BackupDataCentre

type BackupDataCentre struct {
	Nodes []*BackupNode `json:"nodes"`
}

type BackupEvent

type BackupEvent struct {
	Type     string  `json:"type"`
	State    string  `json:"state"`
	Progress float32 `json:"progress"`
	Start    int     `json:"start"`
	End      int     `json:"end"`
}

type BackupNode

type BackupNode struct {
	Events []*BackupEvent `json:"events"`
}

type Bundle

type Bundle struct {
	Bundle  string `json:"bundle"`
	Version string `json:"version"`
}

type BundleOptions

type BundleOptions struct {
	DataNodeSize                 string `json:"dataNodeSize,omitempty"`
	MasterNodeSize               string `json:"masterNodeSize,omitempty"`
	OpenSearchDashboardsNodeSize string `json:"openSearchDashboardsNodeSize,omitempty"`
	ClientEncryption             bool   `json:"clientEncryption,omitempty"`
	ReplicationMode              string `json:"replicationMode,omitempty"`
	SynchronousModeStrict        bool   `json:"synchronousModeStrict,omitempty"`
	PostgresqlNodeCount          int32  `json:"postgresqlNodeCount,omitempty"`
	PoolMode                     string `json:"poolMode,omitempty"`
	IndexManagementPlugin        bool   `json:"indexManagementPlugin,omitempty"`
	AlertingPlugin               bool   `json:"alertingPlugin,omitempty"`
	ICUPlugin                    bool   `json:"icuPlugin,omitempty"`
	KNNPlugin                    bool   `json:"knnPlugin,omitempty"`
	NotificationsPlugin          bool   `json:"notificationsPlugin,omitempty"`
	ReportsPlugin                bool   `json:"reportsPlugin,omitempty"`
	DedicatedMasterNodes         bool   `json:"dedicatedMasterNodes,omitempty"`
}

type CadenceBundleAPIv1

type CadenceBundleAPIv1 struct {
	Bundle  `json:",inline"`
	Options *CadenceBundleOptionsAPIv1 `json:"options"`
}

type CadenceBundleOptionsAPIv1

type CadenceBundleOptionsAPIv1 struct {
	UseAdvancedVisibility   bool   `json:"useAdvancedVisibility,omitempty"`
	UseCadenceWebAuth       bool   `json:"useCadenceWebAuth,omitempty"`
	ClientEncryption        bool   `json:"clientEncryption,omitempty"`
	TargetCassandraCDCID    string `json:"targetCassandraCdcId"`
	TargetCassandraVPCType  string `json:"targetCassandraVpcType,omitempty"`
	TargetKafkaCDCID        string `json:"targetKafkaCdcId,omitempty"`
	TargetKafkaVPCType      string `json:"targetKafkaVpcType,omitempty"`
	TargetOpenSearchCDCID   string `json:"targetOpenSearchCdcId,omitempty"`
	TargetOpenSearchVPCType string `json:"targetOpenSearchVpcType,omitempty"`
	EnableArchival          bool   `json:"enableArchival,omitempty"`
	ArchivalS3URI           string `json:"archivalS3Uri,omitempty"`
	ArchivalS3Region        string `json:"archivalS3Region,omitempty"`
	AWSAccessKeyID          string `json:"awsAccessKeyId,omitempty"`
	AWSSecretAccessKey      string `json:"awsSecretAccessKey,omitempty"`
	CadenceNodeCount        int    `json:"cadenceNodeCount"`
	ProvisioningType        string `json:"provisioningType"`
}

type CadenceClusterAPIv1

type CadenceClusterAPIv1 struct {
	Cluster     `json:",inline"`
	Bundles     []*CadenceBundleAPIv1     `json:"bundles"`
	DataCentres []*CadenceDataCentreAPIv1 `json:"dataCentres,omitempty"`
}

type CadenceClusterAPIv2

type CadenceClusterAPIv2 struct {
	Name                  string                         `json:"name"`
	CadenceVersion        string                         `json:"cadenceVersion"`
	CadenceDataCentres    []*CadenceDataCentre           `json:"dataCentres"`
	SharedProvisioning    []*CadenceSharedProvisioning   `json:"sharedProvisioning,omitempty"`
	StandardProvisioning  []*CadenceStandardProvisioning `json:"standardProvisioning,omitempty"`
	PCIComplianceMode     bool                           `json:"pciComplianceMode"`
	TwoFactorDelete       []*modelsv2.TwoFactorDelete    `json:"twoFactorDelete,omitempty"`
	UseCadenceWebAuth     bool                           `json:"useCadenceWebAuth"`
	PrivateNetworkCluster bool                           `json:"privateNetworkCluster"`
	SLATier               string                         `json:"slaTier"`
	AWSArchival           *AWSArchival                   `json:"awsArchival,omitempty"`
}

type CadenceDataCentre

type CadenceDataCentre struct {
	modelsv2.DataCentre       `json:",inline"`
	ClientToClusterEncryption bool `json:"clientToClusterEncryption"`
}

type CadenceDataCentreAPIv1

type CadenceDataCentreAPIv1 struct {
	DataCentre `json:",inline"`
	Bundles    []*CadenceBundleAPIv1 `json:"bundles"`
}

type CadenceSharedProvisioning

type CadenceSharedProvisioning struct {
	UseAdvancedVisibility bool `json:"useAdvancedVisibility"`
}

type CadenceStandardProvisioning

type CadenceStandardProvisioning struct {
	AdvancedVisibility []*AdvancedVisibility `json:"advancedVisibility,omitempty"`
	TargetCassandra    *TargetCassandra      `json:"targetCassandra"`
}

type CadenceUpdatedFields

type CadenceUpdatedFields struct {
	NodeSizeUpdated        bool `json:"nodeSize"`
	DescriptionUpdated     bool `json:"description"`
	TwoFactorDeleteUpdated bool `json:"twoFactorDelete"`
}

type Cluster

type Cluster struct {
	ClusterName           string           `json:"clusterName"`
	Provider              *ClusterProvider `json:"provider"`
	PrivateNetworkCluster bool             `json:"privateNetworkCluster,omitempty"`
	SLATier               string           `json:"slaTier,omitempty"`
	NodeSize              string           `json:"nodeSize"`
	ClusterNetwork        string           `json:"clusterNetwork,omitempty"`

	// DataCentre is a single data centre, for multiple leave blank and use DataCentres.
	DataCentre            string           `json:"dataCentre,omitempty"`
	DataCentreCustomName  string           `json:"dataCentreCustomName,omitempty"`
	RackAllocation        *RackAllocation  `json:"rackAllocation,omitempty"`
	FirewallRules         []*FirewallRule  `json:"firewallRules,omitempty"`
	TwoFactorDelete       *TwoFactorDelete `json:"twoFactorDelete,omitempty"`
	OIDCProvider          string           `json:"oidcProvider,omitempty"`
	BundledUseOnlyCluster bool             `json:"bundledUseOnlyCluster,omitempty"`
}

type ClusterBackup

type ClusterBackup struct {
	ClusterDataCentres []*BackupDataCentre `json:"clusterDataCentres"`
}

func (*ClusterBackup) GetBackupEvents

func (cb *ClusterBackup) GetBackupEvents(clusterKind string) map[int]*BackupEvent

type ClusterConfigurations

type ClusterConfigurations struct {
	ParameterName  string `json:"parameterName"`
	ParameterValue string `json:"parameterValue"`
}

type ClusterModifyRequest

type ClusterModifyRequest struct {
	TwoFactorDelete *TwoFactorDelete `json:"twoFactorDelete,omitempty"`
	Description     string           `json:"description,omitempty"`
}

type ClusterProvider

type ClusterProvider struct {
	Name                   string            `json:"name"`
	AccountName            string            `json:"accountName,omitempty"`
	CustomVirtualNetworkID string            `json:"customVirtualNetworkId,omitempty"`
	Tags                   map[string]string `json:"tags,omitempty"`
	ResourceGroup          string            `json:"resourceGroup,omitempty"`
	DiskEncryptionKey      string            `json:"diskEncryptionKey,omitempty"`
	ResourceName           string            `json:"resourceName,omitempty"`
}

type ClusterSpec

type ClusterSpec struct {
	ClusterName            string             `json:"clusterName"`
	BundleVersion          string             `json:"bundleVersion"`
	BundleOptions          BundleOptions      `json:"bundleOptions"`
	SLATier                string             `json:"slaTier"`
	PCICompliance          string             `json:"pciCompliance"`
	DataCentres            []*DataCentreSpec  `json:"dataCentres"`
	AddonBundles           []*AddonBundle     `json:"addonBundles"`
	ClusterProvider        []*ClusterProvider `json:"clusterProvider"`
	TwoFactorDeleteEnabled bool               `json:"twoFactorDelete"`
}

type ClusterStatus

type ClusterStatus struct {
	ClusterName     string              `json:"clusterName,omitempty"`
	ID              string              `json:"id,omitempty"`
	ClusterStatus   string              `json:"clusterStatus,omitempty"`
	TwoFactorDelete bool                `json:"twoFactorDelete,omitempty"`
	CDCID           string              `json:"cdcid,omitempty"`
	DataCentres     []*DataCentreStatus `json:"dataCentres,omitempty"`
	BundleOptions   *BundleOptions      `json:"bundleOptions,omitempty"`
}

type ConfigurationProperties

type ConfigurationProperties struct {
	Name      string `json:"name"`
	ClusterID string `json:"clusterId"`
	ID        string `json:"id,omitempty"`
	Value     string `json:"value"`
}

type DataCentre

type DataCentre struct {
	Name           string           `json:"name,omitempty"`
	DataCentre     string           `json:"dataCentre"`
	Network        string           `json:"network"`
	Provider       *ClusterProvider `json:"provider,omitempty"`
	NodeSize       string           `json:"nodeSize,omitempty"`
	RackAllocation *RackAllocation  `json:"rackAllocation,omitempty"`
	Nodes          []*NodeStatus    `json:"nodes"`
}

type DataCentreResizeOperations

type DataCentreResizeOperations struct {
	CDCID  string `json:"cdc"`
	Status string `json:"completedStatus"`
}

type DataCentreSpec

type DataCentreSpec struct {
	Name                          string        `json:"name"`
	CDCName                       string        `json:"CDCName"`
	Provider                      string        `json:"provider"`
	CDCNetwork                    string        `json:"cdcNetwork"`
	ClientEncryption              bool          `json:"clientEncryption"`
	PasswordAuthentication        bool          `json:"passwordAuthentication"`
	UserAuthorization             bool          `json:"userAuthorization"`
	UsePrivateBroadcastRPCAddress bool          `json:"usePrivateBroadcastRPCAddress"`
	PrivateIPOnly                 bool          `json:"privateIPOnly"`
	Nodes                         []*NodeStatus `json:"nodes"`
	PrivateLink                   *PrivateLink  `json:"privateLink,omitempty"`
}

type DataCentreStatus

type DataCentreStatus struct {
	ID              string        `json:"id,omitempty"`
	CDCStatus       string        `json:"cdcStatus,omitempty"`
	Nodes           []*NodeStatus `json:"nodes,omitempty"`
	NodeCount       int32         `json:"nodeCount,omitempty"`
	EncryptionKeyID string        `json:"encryptionKeyId,omitempty"`
}

type FirewallRule

type FirewallRule struct {
	Network         string      `json:"network,omitempty"`
	SecurityGroupId string      `json:"securityGroupId,omitempty"`
	Rules           []*RuleType `json:"rules"`
}

type NodeStatus

type NodeStatus struct {
	ID             string `json:"id"`
	Rack           string `json:"rack"`
	Size           string `json:"size"`
	PublicAddress  string `json:"publicAddress"`
	PrivateAddress string `json:"privateAddress"`
	NodeStatus     string `json:"nodeStatus"`
}

type NodeStatusV2

type NodeStatusV2 struct {
	ID             string   `json:"id"`
	Rack           string   `json:"rack"`
	NodeSize       string   `json:"nodeSize"`
	PublicAddress  string   `json:"publicAddress"`
	PrivateAddress string   `json:"privateAddress"`
	Status         string   `json:"status"`
	NodeRoles      []string `json:"nodeRoles"`
}

type PGBouncer

type PGBouncer struct {
	PGBouncerVersion string `json:"pgBouncerVersion"`
	PoolMode         string `json:"poolMode"`
}

type PGCluster

type PGCluster struct {
	Name                  string                      `json:"name"`
	PostgreSQLVersion     string                      `json:"postgresqlVersion"`
	DataCentres           []*PGDataCentre             `json:"dataCentres"`
	SynchronousModeStrict bool                        `json:"synchronousModeStrict"`
	PrivateNetworkCluster bool                        `json:"privateNetworkCluster"`
	SLATier               string                      `json:"slaTier"`
	TwoFactorDelete       []*modelsv2.TwoFactorDelete `json:"twoFactorDelete,omitempty"`
}

type PGConfigs

type PGConfigs struct {
	ClusterID               string                     `json:"clusterId,omitempty"`
	ConfigurationProperties []*ConfigurationProperties `json:"configurationProperties"`
}

type PGDataCentre

type PGDataCentre struct {
	modelsv2.DataCentre        `json:",inline"`
	ClientToClusterEncryption  bool                    `json:"clientToClusterEncryption"`
	InterDataCentreReplication []*PGInterDCReplication `json:"interDataCentreReplication,omitempty"`
	IntraDataCentreReplication []*PGIntraDCReplication `json:"intraDataCentreReplication"`
	PGBouncer                  []*PGBouncer            `json:"pgBouncer,omitempty"`
	Status                     string                  `json:"status,omitempty"`
	ID                         string                  `json:"id,omitempty"`
	Nodes                      []*NodeStatusV2         `json:"nodes,omitempty"`
}

type PGInterDCReplication

type PGInterDCReplication struct {
	IsPrimaryDataCentre bool `json:"isPrimaryDataCentre"`
}

type PGIntraDCReplication

type PGIntraDCReplication struct {
	ReplicationMode string `json:"replicationMode"`
}

type PGStatus

type PGStatus struct {
	ID                            string                      `json:"id,omitempty"`
	Name                          string                      `json:"name"`
	PostgreSQLVersion             string                      `json:"postgresqlVersion"`
	PCIComplianceMode             bool                        `json:"PCIComplianceMode,omitempty"`
	DataCentres                   []*PGDataCentre             `json:"dataCentres"`
	CurrentClusterOperationStatus string                      `json:"currentClusterOperationStatus,omitempty"`
	SynchronousModeStrict         bool                        `json:"synchronousModeStrict"`
	PrivateNetworkCluster         bool                        `json:"privateNetworkCluster"`
	TwoFactorDelete               []*modelsv2.TwoFactorDelete `json:"twoFactorDelete,omitempty"`
	SLATier                       string                      `json:"slaTier"`
	Status                        string                      `json:"status,omitempty"`
}
type PrivateLink struct {
	IAMPrincipalARNs []string `json:"iamPrincipalARNs"`
}

type RackAllocation

type RackAllocation struct {
	NumberOfRacks int32 `json:"numberOfRacks"`
	NodesPerRack  int32 `json:"nodesPerRack"`
}

type RedisCluster

type RedisCluster struct {
	Name                   string                      `json:"name"`
	RedisVersion           string                      `json:"redisVersion"`
	ClientToNodeEncryption bool                        `json:"clientToNodeEncryption"`
	PCIComplianceMode      bool                        `json:"pciComplianceMode"`
	DataCentres            []*RedisDataCentre          `json:"dataCentres"`
	PrivateNetworkCluster  bool                        `json:"privateNetworkCluster"`
	PasswordAndUserAuth    bool                        `json:"passwordAndUserAuth"`
	TwoFactorDelete        []*modelsv2.TwoFactorDelete `json:"twoFactorDelete,omitempty"`
	SLATier                string                      `json:"slaTier"`
}

type RedisDataCentre

type RedisDataCentre struct {
	modelsv2.DataCentre
	MasterNodes  int `json:"masterNodes"`
	ReplicaNodes int `json:"replicaNodes"`
}

type ResizeRequest

type ResizeRequest struct {
	NewNodeSize           string `json:"newNodeSize"`
	ConcurrentResizes     int    `json:"concurrentResizes"`
	NotifySupportContacts bool   `json:"notifySupportContacts"`
	NodePurpose           string `json:"nodePurpose"`
	ClusterID             string `json:"-"`
	DataCentreID          string `json:"-"`
}

type RuleType

type RuleType struct {
	Type string `json:"type"`
}

type TargetCassandra

type TargetCassandra struct {
	DependencyCDCID   string `json:"dependencyCdcId"`
	DependencyVPCType string `json:"dependencyVpcType"`
}

type TargetKafka

type TargetKafka struct {
	DependencyCDCID   string `json:"dependencyCdcId"`
	DependencyVPCType string `json:"dependencyVpcType"`
}

type TargetOpenSearch

type TargetOpenSearch struct {
	DependencyCDCID   string `json:"dependencyCdcId"`
	DependencyVPCType string `json:"dependencyVpcType"`
}

type TwoFactorDelete

type TwoFactorDelete struct {
	DeleteVerifyEmail string `json:"deleteVerifyEmail,omitempty"`
	DeleteVerifyPhone string `json:"deleteVerifyPhone,omitempty"`
}

Jump to

Keyboard shortcuts

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