schema

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 14 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 ConvertResource

func ConvertResource(resource Resource) api.Resource

ConvertResources is used to convert a resource object containing nested fields of type basetypes.StringValue to a resource object containing nested fields of type string. TODO (AV-53457): add unit testing.

func ConvertResources

func ConvertResources(resources []Resource) []api.Resource

ConvertResources is used to convert an array of resource objects containing nested fields of type basetypes.StringValue to resource objects containing nested fields of type string. TODO (AV-53457): add unit testing.

func ConvertRoles

func ConvertRoles(roles []basetypes.StringValue) []string

ConvertRoles is used to convert all roles in an array of basetypes.StringValue to strings. TODO (AV-53457): add unit testing.

func IsTrimmed

func IsTrimmed(planValue string) bool

IsTrimmed checks if a string is equal to its trimmed version.

func MorphAllowedCidrs

func MorphAllowedCidrs(allowedCIDRs []string) (basetypes.SetValue, error)

MorphAllowedCidrs is used to convert string list to basetypes.ListValue TODO : add unit testing.

func MorphApiKeyOrganizationRoles

func MorphApiKeyOrganizationRoles(organizationRoles []string) []basetypes.StringValue

MorphApiKeyOrganizationRoles is used to convert nested organizationRoles from strings to terraform type.String. TODO : add unit testing.

func MorphRoles

func MorphRoles(roles []string) []basetypes.StringValue

MorphRoles is used to convert nested organizationRoles from strings to terraform type.String. TODO (AV-53457): add unit testing.

Types

type Access

type Access struct {
	// Resources is the level at which the above privileges are defined.
	// Ex: Access of read/write privilege can be defined at the bucket level or scope level resource.
	Resources *Resources `tfsdk:"resources"`

	// Privileges is a list of permissions that the database credential will have over the data in the given bucket or scope.
	// Privileges can be "read", "write" or both.
	Privileges []types.String `tfsdk:"privileges"`
}

Access is a list of privileges or permissions which can be narrowed to the scope level of every bucket in the Capella cluster.

type AllowList

type AllowList struct {
	// Cidr represents the trusted CIDR to allow the database connections from.
	Cidr types.String `tfsdk:"cidr"`

	// Comment is a short description of the allowed CIDR.
	Comment types.String `tfsdk:"comment"`

	// ExpiresAt is an RFC3339 timestamp determining when the allowed CIDR should expire.
	ExpiresAt types.String `tfsdk:"expires_at"`

	// Id is a GUID4 identifier of the allowlist.
	Id types.String `tfsdk:"id"`

	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Audit represents all audit-related fields. It is of types.Object type to avoid conversion error for a nested field.
	Audit types.Object `tfsdk:"audit"`
}

AllowList maps AllowList resource schema data to the response received from V4 Capella Public API.

func (*AllowList) Validate

func (a *AllowList) Validate() (map[Attr]string, error)

Validate is used to verify that IDs have been properly imported.

type AllowLists

type AllowLists struct {
	// OrganizationId is the organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Data contains the list of resources.
	Data []OneAllowList `tfsdk:"data"`
}

AllowLists defines the attributes as received from the V4 Capella Public API when asked to list allowlists.

type ApiKey

type ApiKey struct {
	// Expiry is the expiry of the API key in number of days.
	// If set to -1, the token will not expire.
	Expiry types.Float64 `tfsdk:"expiry"`

	// Rotate is set only when updating(rotating) the API key,
	// and it should be set be set in incremental order from
	// the previously set rotate value, ideally we should start.
	// it from 1 when we are rotating for first time.
	Rotate types.Number `tfsdk:"rotate"`

	// AllowedCIDRs is the list of inbound CIDRs for the API key.
	// The system making a request must come from one of the allowed CIDRs.
	AllowedCIDRs   types.Set    `tfsdk:"allowed_cidrs"`
	OrganizationId types.String `tfsdk:"organization_id"`
	Audit          types.Object `tfsdk:"audit"`
	Description    types.String `tfsdk:"description"`
	Id             types.String `tfsdk:"id"`
	Name           types.String `tfsdk:"name"`

	// Secret associated with API key. One has to follow the secret key policy,
	// such as allowed characters and a length of 64 characters. If this field
	// is left empty, a secret will be auto-generated.
	Secret types.String `tfsdk:"secret"`

	// Token is a confidential piece of information that is used to authorize
	// requests made to v4 endpoints.
	Token             types.String   `tfsdk:"token"`
	OrganizationRoles []types.String `tfsdk:"organization_roles"`

	// Resources  is the resources are the resource level permissions associated
	// with the API key. To learn more about Organization Roles, see
	// [Organization Roles](https://docs.couchbase.com/cloud/organizations/organization-user-roles.html).
	Resources []ApiKeyResourcesItems `tfsdk:"resources"`
}

ApiKey maps ApiKey resource schema data.

func NewApiKey

func NewApiKey(apiKey *api.GetApiKeyResponse, organizationId string, auditObject basetypes.ObjectValue) (*ApiKey, error)

NewApiKey creates new apikey object.

func (*ApiKey) Validate

func (a *ApiKey) Validate() (map[Attr]string, error)

Validate checks the validity of an API key and extracts associated IDs. TODO : add unit testing.

type ApiKeyData

type ApiKeyData struct {
	// OrganizationId is the organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// AllowedCIDRs represents the list of inbound CIDRs for the API key.
	// The system making a request must come from one of the allowed CIDRs.
	AllowedCIDRs types.List   `tfsdk:"allowed_cidrs"`
	Audit        types.Object `tfsdk:"audit"`

	// Description is the description for the API key.
	Description types.String `tfsdk:"description"`

	// Expiry is the expiry of the API key in number of days.
	// If set to -1, the token will not expire.
	Expiry types.Float64 `tfsdk:"expiry"`

	// Id is the id is a unique identifier for an apiKey.
	Id types.String `tfsdk:"id"`

	// Name is the name of the API key.
	Name types.String `tfsdk:"name"`

	// OrganizationRoles are the organization level roles granted to the API key.
	OrganizationRoles []types.String `tfsdk:"organization_roles"`

	// Resources are the resource level permissions associated
	// with the API key. To learn more about Organization Roles, see
	// [Organization Roles](https://docs.couchbase.com/cloud/organizations/organization-user-roles.html).
	Resources []ApiKeyResourcesItems `tfsdk:"resources"`
}

ApiKeyData maps api key resource schema data to the GET API response as received from V4 Capella Public API.

func NewApiKeyData

func NewApiKeyData(apiKey *api.GetApiKeyResponse, organizationId string, auditObject basetypes.ObjectValue) (ApiKeyData, error)

NewApiKeyData creates a new apiKeyData object.

type ApiKeyResourcesItems

type ApiKeyResourcesItems struct {
	Id   types.String `tfsdk:"id"`
	Type types.String `tfsdk:"type"`

	// Roles is the Project Roles associated with the API key.
	// To learn more about Project Roles,
	// see [Project Roles](https://docs.couchbase.com/cloud/projects/project-roles.html).
	Roles []types.String `tfsdk:"roles"`
}

ApiKeyResourcesItems the individual item that is part of Resources. These items define the set of roles or access that can be had on a single type of resource.

func MorphApiKeyResources

func MorphApiKeyResources(resources api.Resources) []ApiKeyResourcesItems

MorphApiKeyResources is used to covert nested resources from strings to terraform types.String TODO : add unit testing.

func OrderList2

func OrderList2(list1, list2 []ApiKeyResourcesItems) ([]ApiKeyResourcesItems, error)

OrderList2 function to order list2 based on list1's Ids.

type ApiKeys

type ApiKeys struct {
	// OrganizationId The organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Data contains the list of resources.
	Data []ApiKeyData `tfsdk:"data"`
}

ApiKeys defines attributes as received in the LIST API response of Capella V4 Public API.

func (ApiKeys) Validate

func (a ApiKeys) Validate() (organizationId string, err error)

Validate is used to verify that all the fields in the datasource have been populated.

type AppService

type AppService struct {
	// Compute is the CPU and RAM configuration of the app service.
	Compute *AppServiceCompute `tfsdk:"compute"`

	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Description is the description for the app service (up to 256 characters).
	Description types.String `tfsdk:"description"`

	// CloudProvider is the cloud provider where the app service 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 types.String `tfsdk:"cloud_provider"`

	// Name is the name of the app service, the name of the app service should follow this naming criteria:
	// An app service name should have at least 2 characters and up to 256 characters.
	Name types.String `tfsdk:"name"`

	// Id is a UUID of the app service.
	Id types.String `tfsdk:"id"`

	// ProjectId is the projectId of the cluster.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the cluster.
	ClusterId types.String `tfsdk:"cluster_id"`

	// CurrentState defines the current state of app service.
	CurrentState types.String `tfsdk:"current_state"`

	// Version defines the version of the app service server
	Version types.String `tfsdk:"version"`

	// Audit represents all audit-related fields. It is of types.Object type to avoid conversion error for a nested field.
	Audit types.Object `tfsdk:"audit"`

	// Etag represents the version of the document.
	Etag types.String `tfsdk:"etag"`

	// IfMatch is a precondition header that specifies the entity tag of a resource.
	IfMatch types.String `tfsdk:"if_match"`

	// Nodes is the number of nodes configured for the app service.
	Nodes types.Int64 `tfsdk:"nodes"`
}

AppService defines the response as received from V4 Capella Public API when asked to create a new app service. To learn more about App Services, see https://docs.couchbase.com/cloud/app-services/index.html

func NewAppService

func NewAppService(
	appService *appservice.GetAppServiceResponse,
	organizationId, projectId string,
	auditObject basetypes.ObjectValue,
) *AppService

NewAppService creates a new instance of an App Service.

func (AppService) Validate

func (a AppService) Validate() (map[Attr]string, error)

Validate is used to verify that IDs have been properly imported.

type AppServiceCompute

type AppServiceCompute struct {
	// Cpu depicts cpu units (cores).
	Cpu types.Int64 `tfsdk:"cpu"`

	// Ram depicts ram units (GB).
	Ram types.Int64 `tfsdk:"ram"`
}

AppServiceCompute 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 AppServiceData

type AppServiceData struct {
	// Compute is the CPU and RAM configuration of the app service.
	Compute *AppServiceCompute `tfsdk:"compute"`

	// Id is a UUID of the app service.
	Id types.String `tfsdk:"id"`

	// Name is the name of the app service, the name of the app service should follow this naming criteria:
	// An app service name should have at least 2 characters and up to 256 characters.
	Name types.String `tfsdk:"name"`

	// Description is the description for the app service (up to 256 characters).
	Description types.String `tfsdk:"description"`

	// CloudProvider is the cloud provider where the app service 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 types.String `tfsdk:"cloud_provider"`

	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ClusterId is the clusterId of the cluster.
	ClusterId types.String `tfsdk:"cluster_id"`

	// CurrentState defines the current state of app service.
	CurrentState types.String `tfsdk:"current_state"`

	// Version defines the version of the app service server
	Version types.String `tfsdk:"version"`

	// Audit represents all audit-related fields. It is of types.Object type to avoid conversion error for a nested field.
	Audit types.Object `tfsdk:"audit"`

	// Nodes is the number of nodes configured for the app service.
	Nodes types.Int64 `tfsdk:"nodes"`
}

AppServiceData defines attributes for a single cluster when fetched from the V4 Capella Public API.

func NewAppServiceData

func NewAppServiceData(
	appService *appservice.GetAppServiceResponse,
	organizationId string,
	auditObject basetypes.ObjectValue,
) *AppServiceData

NewAppServiceData creates a new cluster data object.

type AppServices

type AppServices struct {
	// OrganizationId The organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Data contains the list of resources.
	Data []AppServiceData `tfsdk:"data"`
}

AppServices defines structure based on the response received from V4 Capella Public API when asked to list app services.

type Attr

type Attr string
const (
	OrganizationId Attr = "organizationId"
	ProjectId      Attr = "projectId"
	ClusterId      Attr = "clusterId"
	BucketId       Attr = "bucketId"
	Id             Attr = "id"
)

type Availability

type Availability struct {
	// Type is the availability zone type, either 'single' or 'multi'.
	Type types.String `tfsdk:"type"`
}

Availability defines the type of Availability Zone configuration for a cluster resource. single type means the nodes in the cluster will all be deployed in a single availability zone in the cloud region. multi type means the nodes in the cluster will all be deployed in separate multiple availability zones in the cloud region.

type Backup

type Backup struct {
	// RestoreTimes represents the number of times we have requested a restore.
	// It represents the incremental count each time we request a restore.
	RestoreTimes types.Number `tfsdk:"restore_times"`

	// Method represents the mechanism of the backup.
	// Enum: "incremental" "full"
	// Incremental backups include the data that has changed since the last scheduled backup.
	// Full backup includes all bucket data from the time the backup was created.
	Method types.String `tfsdk:"method"`

	// Date represents the time at which backup was created.
	Date types.String `tfsdk:"date"`

	// BucketName represents the name of the bucket to which the backup belongs to.
	BucketName types.String `tfsdk:"bucket_name"`

	// CycleId is the cycleId to the which the backup belongs to.
	CycleId types.String `tfsdk:"cycle_id"`

	// BucketId is the ID of the bucket to which the backup belongs to.
	BucketId types.String `tfsdk:"bucket_id"`

	// RestoreBefore represents the time at which backup will expire.
	RestoreBefore types.String `tfsdk:"restore_before"`

	// Status represents the status of the backup.
	// Enum: "pending" "ready" "failed"
	Status types.String `tfsdk:"status"`

	// Source represents the way a backup job was initiated.
	// Enum: "manual" "scheduled"
	// Manual represents a manually triggered backup job or on-demand.
	// Scheduled represents a backup job created from a schedule.
	Source types.String `tfsdk:"source"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// Id is a GUID4 identifier of the backup.
	Id types.String `tfsdk:"id"`

	// Provider is the cloud provider where the cluster is hosted.
	CloudProvider types.String `tfsdk:"cloud_provider"`

	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// BackupStats represents various backup level data that couchbase provides.
	BackupStats types.Object `tfsdk:"backup_stats"`

	// ScheduleInfo represents the schedule information of the backup.
	ScheduleInfo types.Object `tfsdk:"schedule_info"`

	// Restore represents information about how to restore the backup.
	Restore types.Object `tfsdk:"restore"`

	// ElapsedTimeInSeconds represents the amount of seconds that have elapsed between the creation and completion of the backup.
	ElapsedTimeInSeconds types.Int64 `tfsdk:"elapsed_time_in_seconds"`
}

Backup maps Backup resource schema data to the response received from V4 Capella Public API.

func NewBackup

func NewBackup(backup *backup.GetBackupResponse,
	organizationId, projectId string,
	bStatsObj, sInfoObj basetypes.ObjectValue,
) *Backup

NewBackup creates new backup object.

func (Backup) Validate

func (b Backup) Validate() (map[Attr]string, error)

Validate is used to verify that IDs have been properly imported.

type BackupData

type BackupData struct {
	// Method represents the mechanism of the backup.
	// Enum: "incremental" "full"
	// Incremental backups include the data that has changed since the last scheduled backup.
	// Full backup includes all bucket data from the time the backup was created.
	Method types.String `tfsdk:"method"`

	// RestoreBefore represents the time at which backup will expire.
	RestoreBefore types.String `tfsdk:"restore_before"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Id is a GUID4 identifier of the backup.
	Id types.String `tfsdk:"id"`

	// Date represents the time at which backup was created.
	Date types.String `tfsdk:"date"`

	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Status represents the status of the backup.
	// Enum: "pending" "ready" "failed"
	Status types.String `tfsdk:"status"`

	// CycleId is the cycleId to the which the backup belongs to.
	CycleId types.String `tfsdk:"cycle_id"`

	// BucketName represents the name of the bucket to which the backup belongs to.
	BucketName types.String `tfsdk:"bucket_name"`

	// BucketId is the ID of the bucket to which the backup belongs to.
	BucketId types.String `tfsdk:"bucket_id"`

	// Source represents the way a backup job was initiated.
	// Enum: "manual" "scheduled"
	// Manual represents a manually triggered backup job or on-demand.
	// Scheduled represents a backup job created from a schedule.
	Source types.String `tfsdk:"source"`

	// Provider is the cloud provider where the cluster is hosted.
	CloudProvider types.String `tfsdk:"cloud_provider"`

	// BackupStats represents various backup level data that couchbase provides.
	BackupStats types.Object `tfsdk:"backup_stats"`

	// ScheduleInfo represents the schedule information of the backup.
	ScheduleInfo types.Object `tfsdk:"schedule_info"`

	// ElapsedTimeInSeconds represents the amount of seconds that have elapsed between the creation and completion of the backup.
	ElapsedTimeInSeconds types.Int64 `tfsdk:"elapsed_time_in_seconds"`
}

BackupData defines attributes for a single Backup when fetched from the V4 Capella Public API.

func NewBackupData

func NewBackupData(backup *backup.GetBackupResponse,
	organizationId, projectId string,
	bStatsObj, sInfoObj basetypes.ObjectValue,
) *BackupData

NewBackupData creates new backup data object.

type BackupSchedule

type BackupSchedule struct {
	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// BucketId is the ID of the bucket to which the backup belongs to.
	BucketId types.String `tfsdk:"bucket_id"`

	// Type represents whether the backup is a Weekly or Daily backup.
	// e.g. 'weekly'
	Type types.String `tfsdk:"type"`

	// WeeklySchedule represents the weekly schedule of the backup.
	WeeklySchedule types.Object `tfsdk:"weekly_schedule"`
}

BackupSchedule defines the response as received from V4 Capella Public API when asked to create a new backup schedule.

func NewBackupSchedule

func NewBackupSchedule(backupSchedule *backup_schedule.GetBackupScheduleResponse,
	organizationId, projectId string,
	scheduleObj basetypes.ObjectValue,
) *BackupSchedule

NewBackupSchedule creates new backup schedule object.

func (*BackupSchedule) Validate

func (a *BackupSchedule) Validate() (map[Attr]string, error)

Validate checks the validity of an API key and extracts associated IDs. TODO : add unit testing.

type BackupStats

type BackupStats struct {
	// SizeInMB represents backup size in megabytes.
	SizeInMB types.Float64 `tfsdk:"size_in_mb"`

	// Items is the number of items saved during the backup.
	Items types.Int64 `tfsdk:"items"`

	// Mutations is the number of mutations saved during the backup.
	Mutations types.Int64 `tfsdk:"mutations"`

	// Tombstones is the number of tombstones saved during the backup.
	Tombstones types.Int64 `tfsdk:"tombstones"`

	// GSI is the number of global secondary indexes saved during the backup.
	GSI types.Int64 `tfsdk:"gsi"`

	// FTS is the number of full text search entities saved during the backup.
	FTS types.Int64 `tfsdk:"fts"`

	// CBAS is the number of analytics entities saved during the backup.
	CBAS types.Int64 `tfsdk:"cbas"`

	// Event represents the number of event entities saved during the backup.
	Event types.Int64 `tfsdk:"event"`
}

BackupStats has the backup level stats provided by Couchbase.

func NewBackupStats

func NewBackupStats(backupStats backup.BackupStats) BackupStats

NewBackupStats creates a new BackupStats data object.

func (BackupStats) AttributeTypes

func (b BackupStats) AttributeTypes() map[string]attr.Type

type Backups

type Backups struct {
	// OrganizationId The organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// BucketId is the ID of the bucket to which the backup belongs to.
	BucketId types.String `tfsdk:"bucket_id"`

	// Data contains the list of resources.
	Data []BackupData `tfsdk:"data"`
}

Backups defines structure based on the response received from V4 Capella Public API when asked to list backups.

func (Backups) Validate

func (b Backups) Validate() (bucketId, clusterId, projectId, organizationId string, err error)

Validate is used to verify that IDs have been properly imported.

type Bucket

type Bucket struct {
	// DurabilityLevel is the minimum level at which all writes to the bucket must occur.
	// Default: "none"
	// Enum: "none" "majority" "majorityAndPersistActive" "persistToMajority"
	//
	// The options for Durability level are as follows, according to the bucket type.
	//
	// For a Couchbase bucket:
	// None
	// Replicate to Majority
	// Majority and Persist to Active
	// Persist to Majority
	//
	//For an Ephemeral bucket:
	// None
	// Replicate to Majority
	DurabilityLevel types.String `tfsdk:"durability_level"`

	// Stats has the bucket stats that are related to memory and disk consumption.
	// itemCount: Number of documents in the bucket.
	// opsPerSecond: Number of operations per second.
	// diskUsedInMib: The amount of disk used (in MiB).
	// memoryUsedInMib: The amount of memory used (in MiB).
	Stats types.Object `tfsdk:"stats"`

	// Type defines the type of the bucket.
	// Default: "couchbase"
	// Enum: "couchbase" "ephemeral"
	// If selected Ephemeral, it is not eligible for imports or App Endpoints creation. This field cannot be changed later.
	// The options may also be referred to as Memory and Disk (Couchbase), Memory Only (Ephemeral) in the Couchbase documentation.
	// To learn more, see https://docs.couchbase.com/cloud/clusters/data-service/manage-buckets.html#add-bucket
	Type types.String `tfsdk:"type"`

	// StorageBackend defines the storage engine that is used by the bucket.
	// Default: "couchstore"
	// Enum: "couchstore" "magma"
	//
	// Ephemeral buckets do not support StorageBackend, hence not applicable for Ephemeral buckets and throws an error if this field is added.
	// This field is only applicable for a Couchbase bucket. The default value mentioned (Couchstore) is for Couchbase bucket.
	// This field cannot be changed later.
	// To learn more, see https://docs.couchbase.com/cloud/clusters/data-service/storage-engines.html
	StorageBackend types.String `tfsdk:"storage_backend"`

	// ClusterId is the ID of the cluster for which the database credential needs to be created.
	ClusterId types.String `tfsdk:"cluster_id"`

	// BucketConflictResolution is the means by which conflicts are resolved during replication.
	// Default: "seqno"
	// Enum: "seqno" "lww"
	// This field may be referred to as "conflict resolution" in the Couchbase documentation.
	// seqno and lww may be referred to as "sequence number" and "timestamp" respectively.
	// This field cannot be changed later.
	// To learn more, see https://docs.couchbase.com/cloud/clusters/xdcr/xdcr.html#conflict-resolution
	BucketConflictResolution types.String `tfsdk:"bucket_conflict_resolution"`

	// Name is the name of the bucket.
	Name types.String `tfsdk:"name"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	// The database credential will be created for the cluster.
	ProjectId types.String `tfsdk:"project_id"`

	// Id is the id of the created bucket.
	Id types.String `tfsdk:"id"`

	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	// The database credential will be created for the cluster.
	OrganizationId types.String `tfsdk:"organization_id"`

	// EvictionPolicy is the policy which Capella adopts to prevent data loss due to memory exhaustion.
	// This may be also known as Ejection Policy in the Couchbase documentation.
	//
	// For Couchbase bucket, Eviction Policy is fullEviction by default.
	// For Ephemeral buckets, Eviction Policy is a required field, and should be one of the following:
	// noEviction
	// nruEviction
	// Default: "fullEviction"
	// Enum: "fullEviction" "noEviction" "nruEviction"
	// To learn more, see https://docs.couchbase.com/server/current/rest-api/rest-bucket-create.html#evictionpolicy
	EvictionPolicy types.String `tfsdk:"eviction_policy"`

	// MemoryAllocationInMB is the amount of memory to allocate for the bucket memory in MiB.
	// This is the maximum limit is dependent on the allocation of the KV service. For example, 80% of the allocation.
	// Default: 100
	//
	// The default value (100MiB) mentioned is for Couchbase type buckets with Couchstore as the Storage Backend.
	//
	// For Couchbase buckets, the default and minimum memory allocation changes according to the Storage Backend type as follows:
	// For Couchstore, the default and minimum memory allocation is 100 MiB.
	// For Magma, the default and minimum memory allocation is 1024 MiB.
	// For Ephemeral buckets, the default and minimum memory allocation is 100 MiB.
	MemoryAllocationInMB types.Int64 `tfsdk:"memory_allocation_in_mb"`

	// TimeToLiveInSeconds specifies the time to live (TTL) value in seconds.
	// This is the maximum time to live for items in the bucket.
	// Default is 0, that means TTL is disabled. This is a non-negative value.
	TimeToLiveInSeconds types.Int64 `tfsdk:"time_to_live_in_seconds"`

	// Replicas is the number of replicas for the bucket.
	// Default: 1
	// Enum: 1 2 3
	Replicas types.Int64 `tfsdk:"replicas"`

	// Flush determines whether flushing is enabled on the bucket.
	// Enable Flush to delete all items in this bucket at the earliest opportunity.
	// Disable Flush to avoid inadvertent data loss.
	// Default: false
	Flush types.Bool `tfsdk:"flush"`
}

func (Bucket) Validate

func (b Bucket) Validate() (map[Attr]string, error)

Validate will split the IDs by a delimiter i.e. comma , in case a terraform import CLI is invoked. The format of the terraform import CLI would include the IDs as follows - `terraform import capella_bucket.new_bucket id=<uuid>,cluster_id=<uuid>,project_id=<uuid>,organization_id=<uuid>`.

type BucketResource

type BucketResource struct {
	Name types.String `tfsdk:"name"`
	// Scopes is the details of the scopes inside the bucket to which we want to apply access privileges.
	Scopes []Scope `tfsdk:"scopes"`
}

BucketResource contains the details of a single bucket with scope and collection level information. Scopes can be a subset of all scopes inside the bucket, since this is defined only to govern the access.

type Buckets

type Buckets struct {
	// OrganizationId The organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Data It contains the list of resources.
	Data []OneBucket `tfsdk:"data"`
}

Buckets defines attributes for the LIST buckets response received from V4 Capella Public API.

func (Buckets) Validate

func (b Buckets) Validate() (clusterId, projectId, organizationId string, err error)

Validate is used to verify that all the fields in the datasource have been populated.

type Certificate

type Certificate struct {
	// OrganizationId is the organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	Data []OneCertificate `tfsdk:"data"`
}

func (*Certificate) Validate

func (c *Certificate) Validate() error

Validate is used to verify that all the fields in the datasource have been populated.

type CloudProvider

type CloudProvider struct {
	// Cidr is the cidr block for Cloud Provider.
	Cidr types.String `tfsdk:"cidr"`

	// Region is the 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 types.String `tfsdk:"region"`

	// Type is the cloud provider type, either 'AWS', 'GCP', or 'Azure'.
	Type types.String `tfsdk:"type"`
}

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

type Cluster

type Cluster struct {
	Availability *Availability `tfsdk:"availability"`
	Support      *Support      `tfsdk:"support"`

	// CloudProvider The cloud provider where the cluster will be hosted.
	// To learn more, see [Amazon Web Services](https://docs.couchbase.com/cloud/reference/aws.html).
	CloudProvider  *CloudProvider `tfsdk:"cloud_provider"`
	ProjectId      types.String   `tfsdk:"project_id"`
	Id             types.String   `tfsdk:"id"`
	OrganizationId types.String   `tfsdk:"organization_id"`
	Audit          types.Object   `tfsdk:"audit"`

	// ConfigurationType represents whether a cluster is configured as a single-node or multi-node cluster.
	ConfigurationType types.String `tfsdk:"configuration_type"`
	CouchbaseServer   types.Object `tfsdk:"couchbase_server"`

	// Description of the cluster (up to 1024 characters).
	Description types.String `tfsdk:"description"`

	// Name of the cluster (up to 256 characters).
	Name types.String `tfsdk:"name"`

	// AppServiceId is the ID of the linked app service.
	AppServiceId types.String `tfsdk:"app_service_id"`
	CurrentState types.String `tfsdk:"current_state"`
	Etag         types.String `tfsdk:"etag"`
	IfMatch      types.String `tfsdk:"if_match"`

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

Cluster defines the response as received from V4 Capella Public API when asked to create a new cluster.

func NewCluster

func NewCluster(ctx context.Context, cluster *clusterapi.GetClusterResponse, organizationId, projectId string, auditObject basetypes.ObjectValue) (*Cluster, error)

NewCluster create new cluster object.

func (*Cluster) Validate

func (c *Cluster) Validate() (map[Attr]string, error)

type ClusterData

type ClusterData struct {
	Availability    *Availability    `tfsdk:"availability"`
	Support         *Support         `tfsdk:"support"`
	CouchbaseServer *CouchbaseServer `tfsdk:"couchbase_server"`
	CloudProvider   *CloudProvider   `tfsdk:"cloud_provider"`
	OrganizationId  types.String     `tfsdk:"organization_id"`
	ProjectId       types.String     `tfsdk:"project_id"`
	Id              types.String     `tfsdk:"id"`
	Audit           types.Object     `tfsdk:"audit"`
	Description     types.String     `tfsdk:"description"`
	Name            types.String     `tfsdk:"name"`
	AppServiceId    types.String     `tfsdk:"app_service_id"`
	CurrentState    types.String     `tfsdk:"current_state"`
	ServiceGroups   []ServiceGroup   `tfsdk:"service_groups"`
}

ClusterData defines attributes for a single cluster when fetched from the V4 Capella Public API.

func NewClusterData

func NewClusterData(cluster *clusterapi.GetClusterResponse, organizationId, projectId string, auditObject basetypes.ObjectValue) (*ClusterData, error)

NewClusterData creates a new cluster data object.

type Clusters

type Clusters struct {
	// OrganizationId is the organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the cluster
	ProjectId types.String `tfsdk:"project_id"`

	// Data It contains the list of resources.
	Data []ClusterData `tfsdk:"data"`
}

Clusters defines structure based on the response received from V4 Capella Public API when asked to list clusters.

type Compute

type Compute struct {
	// Cpu depicts cpu units (cores).
	Cpu types.Int64 `tfsdk:"cpu"`

	// Ram depicts ram units (GB).
	Ram types.Int64 `tfsdk:"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 Config

type Config struct {
	Host                types.String `tfsdk:"host"`
	AuthenticationToken types.String `tfsdk:"authentication_token"`
}

Config maps provider schema data to a Go type.

type CouchbaseAuditData

type CouchbaseAuditData struct {
	// CreatedAt The RFC3339 timestamp associated with when the resource was initially
	// created.
	CreatedAt types.String `tfsdk:"created_at"`

	// CreatedBy The user who created the resource; this will be a UUID4 ID for standard
	// users and will be a string such as "internal-support" for internal
	// Couchbase support users.
	CreatedBy types.String `tfsdk:"created_by"`

	// ModifiedAt The RFC3339 timestamp associated with when the resource was last modified.
	ModifiedAt types.String `tfsdk:"modified_at"`

	// ModifiedBy The user who last modified the resource; this will be a UUID4 ID for
	// standard users and wilmal be a string such asas "internal-support" for
	// internal Couchbase support users.
	ModifiedBy types.String `tfsdk:"modified_by"`

	// Version The version of the document. This value is incremented each time the
	// resource is modified.
	Version types.Int64 `tfsdk:"version"`
}

CouchbaseAuditData contains all audit-related fields.

func NewCouchbaseAuditData

func NewCouchbaseAuditData(audit api.CouchbaseAuditData) CouchbaseAuditData

func (CouchbaseAuditData) AttributeTypes

func (c CouchbaseAuditData) AttributeTypes() map[string]attr.Type

type CouchbaseServer

type CouchbaseServer struct {
	// Version 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.
	Version types.String `tfsdk:"version"`
}

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

func (CouchbaseServer) AttributeTypes

func (c CouchbaseServer) AttributeTypes() map[string]attr.Type

AttributeTypes returns a mapping of field names to their respective attribute types for the CouchbaseServer struct. It is used during the conversion of a types.Object field to a CouchbaseServer type.

type Data

type Data struct {
	Client  *api.Client
	HostURL string
	Token   string
}

Data is provider-defined data, clients, etc. that is passed to data sources or resources in the provider that implement the Configure method.

type DatabaseCredential

type DatabaseCredential struct {
	// Id is the id of the created database credential.
	Id types.String `tfsdk:"id"`

	// Name is the name of the database credential, the name of the database credential should follow this naming criteria:
	// A database credential name should have at least 2 characters and up to 256 characters and should not contain spaces.
	Name types.String `tfsdk:"name"`

	// Password is the password that you may want to use to create this database credential.
	// This password can later be used to authenticate connections to the underlying couchbase server.
	// The password should contain 8+ characters, at least 1 lower, 1 upper, 1 numerical and 1 special character.
	Password types.String `tfsdk:"password"`

	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	// The database credential will be created for the cluster.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	// The database credential will be created for the cluster.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the ID of the cluster for which the database credential needs to be created.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Audit contains all audit-related fields. It is of types.Object type to avoid conversion error for a nested field.
	Audit types.Object `tfsdk:"audit"`

	// Access is a list of access which can be narrowed to the scope level of every bucket in the Capella cluster.
	// Access can be "read", "write" or both.
	Access []Access `tfsdk:"access"`
}

DatabaseCredential maps the schema for the resource - database credential in Capella. A database credential is created on a cluster resource to gain read/write access to the cluster's data. This credential can have a fixed password supplied during creation or the password can be auto-generated.

A database credential is simply a user in the couchbase server with some roles attached to it based on the Access field supplied during creation.

func NewDatabaseCredential

func NewDatabaseCredential(
	Id types.String,
	name types.String,
	organizationId, projectId, clusterId types.String,
	auditObject basetypes.ObjectValue,
) *DatabaseCredential

func (DatabaseCredential) Validate

func (c DatabaseCredential) Validate() (map[Attr]string, error)

Validate will split the IDs by a delimiter i.e. comma , in case a terraform import CLI is invoked. The format of the terraform import CLI would include the IDs as follows - `terraform import capella_database_credential.new_database_credential id=<uuid>,cluster_id=<uuid>,project_id=<uuid>,organization_id=<uuid>`.

type DatabaseCredentialItem

type DatabaseCredentialItem struct {
	// Id A GUID4 identifier of the created database credential.
	Id types.String `tfsdk:"id"`

	// Name is the name of the database credential, the name of the database credential should follow this naming criteria:
	// A database credential name should have at least 2 characters and up to 256 characters and should not contain spaces.
	Name types.String `tfsdk:"name"`

	// OrganizationId is the ID of the organization to which the Capella cluster belongs.
	// The database credential will be created for the cluster.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the ID of the project to which the Capella cluster belongs.
	// The database credential will be created for the cluster.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the ID of the cluster for which the database credential needs to be created.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Access is a list of access which can be narrowed to the scope level of every bucket in the Capella cluster.
	// Access can be "read", "write" or both.
	Access []Access `tfsdk:"access"`

	// Audit All audit-related fields.
	Audit CouchbaseAuditData `tfsdk:"audit"`
}

DatabaseCredentialItem is used to retrieve the new state of a database credential after it is created by Terraform. This struct is separate from the DatabaseCredential struct because of the change in data type of its attributes after retrieval.

type DatabaseCredentials

type DatabaseCredentials struct {
	// OrganizationId The organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// ProjectId is the projectId of the capella tenant.
	ProjectId types.String `tfsdk:"project_id"`

	// ClusterId is the clusterId of the capella tenant.
	ClusterId types.String `tfsdk:"cluster_id"`

	// Data It contains the list of resources.
	Data []DatabaseCredentialItem `tfsdk:"data"`
}

DatabaseCredentials defines model for GetDatabaseCredentialsResponse.

func (DatabaseCredentials) Validate

func (d DatabaseCredentials) Validate() (clusterId, projectId, organizationId string, err error)

Validate is used to verify that all the fields in the datasource have been populated.

type Node

type Node struct {
	// Disk is the type of disk that is supported per cloud provider during cluster creation.
	Disk Node_Disk `tfsdk:"disk"`
	// Compute 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 `tfsdk:"compute"`
}

Node defines attributes of a cluster node.

type Node_Disk

type Node_Disk struct {
	Type    types.String `tfsdk:"type"`
	Storage types.Int64  `tfsdk:"storage"`
	IOPS    types.Int64  `tfsdk:"iops"`
}

Node_Disk is the type of disk on a particular node that is supported per cloud provider during cluster creation.

type OneAllowList

type OneAllowList struct {
	Cidr    types.String `tfsdk:"cidr"`
	Comment types.String `tfsdk:"comment"`

	// ExpiresAt is an RFC3339 timestamp determining when the allowed CIDR should expire.
	ExpiresAt      types.String       `tfsdk:"expires_at"`
	Id             types.String       `tfsdk:"id"`
	OrganizationId types.String       `tfsdk:"organization_id"`
	ProjectId      types.String       `tfsdk:"project_id"`
	ClusterId      types.String       `tfsdk:"cluster_id"`
	Audit          CouchbaseAuditData `tfsdk:"audit"`
}

OneAllowList maps allowlist resource schema data; there is a separate response object to avoid conversion error for nested fields.

type OneBucket

type OneBucket struct {
	Stats                    *Stats       `tfsdk:"stats"`
	DurabilityLevel          types.String `tfsdk:"durability_level"`
	Name                     types.String `tfsdk:"name"`
	StorageBackend           types.String `tfsdk:"storage_backend"`
	ClusterId                types.String `tfsdk:"cluster_id"`
	BucketConflictResolution types.String `tfsdk:"bucket_conflict_resolution"`
	Id                       types.String `tfsdk:"id"`
	ProjectId                types.String `tfsdk:"project_id"`
	OrganizationId           types.String `tfsdk:"organization_id"`
	Type                     types.String `tfsdk:"type"`
	EvictionPolicy           types.String `tfsdk:"eviction_policy"`
	TimeToLiveInSeconds      types.Int64  `tfsdk:"time_to_live_in_seconds"`
	Replicas                 types.Int64  `tfsdk:"replicas"`
	MemoryAllocationInMB     types.Int64  `tfsdk:"memory_allocation_in_mb"`
	Flush                    types.Bool   `tfsdk:"flush"`
}

type OneCertificate

type OneCertificate struct {
	Certificate types.String `tfsdk:"certificate"`
}

type OneProject

type OneProject struct {
	Description    types.String       `tfsdk:"description"`
	Id             types.String       `tfsdk:"id"`
	OrganizationId types.String       `tfsdk:"organization_id"`
	Name           types.String       `tfsdk:"name"`
	Etag           types.String       `tfsdk:"etag"`
	IfMatch        types.String       `tfsdk:"if_match"`
	Audit          CouchbaseAuditData `tfsdk:"audit"`
}

OneProject maps project resource schema data; there is a separate response object to avoid conversion error for nested fields.

type Organization

type Organization struct {
	// Audit represents all audit-related fields.
	Audit types.Object `tfsdk:"audit"`

	// OrganizationId is the organizationId of the capella tenant.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Name represents the name of the organization
	Name types.String `tfsdk:"name"`

	// Description is a short description of the organization.
	Description types.String `tfsdk:"description"`

	// Preferences stores preferences for the tenant.
	Preferences types.Object `tfsdk:"preferences"`
}

type Preferences

type Preferences struct {
	// SessionDuration: Maximum allowed time in seconds inside the tenant for a user.
	SessionDuration types.Int64 `tfsdk:"session_duration"`
}

func NewPreferences

func NewPreferences(preference organization.Preferences) Preferences

NewPreferences create new preferences object.

func (Preferences) AttributeTypes

func (p Preferences) AttributeTypes() map[string]attr.Type

type Project

type Project struct {
	// Description The description of a particular project.
	Description types.String `tfsdk:"description"`

	// Id A GUID4 identifier of the project.
	Id types.String `tfsdk:"id"`

	// OrganizationId The organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Name The name of the project.
	Name types.String `tfsdk:"name"`

	Etag types.String `tfsdk:"etag"`

	IfMatch types.String `tfsdk:"if_match"`

	// Audit All audit-related fields. It is of types.Object type to avoid conversion error for a nested field.
	Audit types.Object `tfsdk:"audit"`
}

Project maps project resource schema data.

func (Project) Validate

func (p Project) Validate() (map[Attr]string, error)

type Projects

type Projects struct {
	// OrganizationId The organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Data It contains the list of resources.
	Data []OneProject `tfsdk:"data"`
}

Projects defines the attributes for a list of projects in Capella.

type Resource

type Resource struct {
	// Id is a GUID4 identifier of the resource.
	Id types.String `tfsdk:"id"`

	// Type is the type of the resource.
	Type types.String `tfsdk:"type"`

	// Roles is an array of strings representing a users project roles
	Roles []types.String `tfsdk:"roles"`
}

func MorphResources

func MorphResources(resources []api.Resource) []Resource

MorphResources is used to covert nested resources from strings to terraform types.String TODO (AV-53457): add unit testing.

type Resources

type Resources struct {
	// Buckets contains the details of all buckets with scope and collection level information to which the access applies.
	Buckets []BucketResource `tfsdk:"buckets"`
}

Resources is the level at which the above privileges are defined. Ex: Access of read/write privilege can be defined at the bucket level or scope level resource.

type Restore

type Restore struct {
	// MapData is specified when you want to restore source data into a different location.
	MapData types.String `tfsdk:"map_data"`

	// SourceClusterId represents the Id of the source cluster the restore is based on.
	SourceClusterId types.String `tfsdk:"source_cluster_id"`

	// FilterKeys represents a regular expression. It is used to selectively
	// restore data, allowing only the restoration of data where the key
	// matches a specific regular expression.
	FilterKeys types.String `tfsdk:"filter_keys"`

	// FilterValues represents a regular expression. It is used to selectively
	// restore data, allowing restoration only when the value matches a
	// specific regular expression.
	FilterValues types.String `tfsdk:"filter_values"`

	// IncludeData when specified restores only the data specified here
	IncludeData types.String `tfsdk:"include_data"`

	// ExcludeData when specified, skips restoring the data specified here.
	ExcludeData types.String `tfsdk:"exclude_data"`

	// TargetClusterId represents the Id of the target cluster to restore to.
	TargetClusterId types.String `tfsdk:"target_cluster_id"`

	// ReplaceTTL sets a new expiration (time-to-live) value for the specified keys.
	ReplaceTTL types.String `tfsdk:"replace_ttl"`

	// ReplaceTTLWith updates the expiration for the keys.
	ReplaceTTLWith types.String `tfsdk:"replace_ttl_with"`

	// Status represents the status of restore.
	Status types.String `tfsdk:"status"`

	// Services represents the array of strings (Services) like data, query.
	Services []types.String `tfsdk:"services"`

	// ForceUpdates when marked true forces data in the Couchbase cluster to
	// be overwritten even if the data in the cluster is newer.
	ForceUpdates types.Bool `tfsdk:"force_updates"`

	// AutoRemoveCollections when marked true automatically delete scopes/collections
	// which are known to be deleted in the backup.
	AutoRemoveCollections types.Bool `tfsdk:"auto_remove_collections"`
}

Restore provides information about how to restore the backup.

func (Restore) AttributeTypes

func (r Restore) AttributeTypes() map[string]attr.Type

type ScheduleInfo

type ScheduleInfo struct {
	// BackupType represents whether the backup is a Weekly or Daily backup.
	BackupType types.String `tfsdk:"backup_type"`

	// BackupTime is the timestamp indicating the backup created time.
	BackupTime types.String `tfsdk:"backup_time"`

	// Retention represents retention time in days.
	Retention types.String `tfsdk:"retention"`

	// Increment represents interval in hours for incremental backup.
	Increment types.Int64 `tfsdk:"increment"`
}

ScheduleInfo provides schedule information of the backup.

func NewScheduleInfo

func NewScheduleInfo(scheduleInfo backup.ScheduleInfo) ScheduleInfo

NewScheduleInfo creates a new ScheduleInfo data object.

func (ScheduleInfo) AttributeTypes

func (b ScheduleInfo) AttributeTypes() map[string]attr.Type

type Scope

type Scope struct {
	Name        types.String   `tfsdk:"name"`
	Collections []types.String `tfsdk:"collections"`
}

Scope is the details of a single scope inside the bucket, and it contains the collections details too. This collections can be a subset of all collections inside the scope, since this is defined only to govern the access.

type Service

type Service string

Service is the couchbase service to run on the node.

type ServiceGroup

type ServiceGroup struct {
	Node *Node `tfsdk:"node"`

	// Services is the couchbase service to run on the node.
	Services []types.String `tfsdk:"services"`

	// NumOfNodes is 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 types.Int64 `tfsdk:"num_of_nodes"`
}

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

type Stats

type Stats struct {
	// ItemCount: Number of documents in the bucket.
	ItemCount types.Int64 `tfsdk:"item_count"`
	// OpsPerSecond: Number of operations per second.
	OpsPerSecond types.Int64 `tfsdk:"ops_per_second"`
	// DiskUsedInMib: The amount of disk used (in MiB).
	DiskUsedInMiB types.Int64 `tfsdk:"disk_used_in_mib"`
	// MemoryUsedInMib: The amount of memory used (in MiB).
	MemoryUsedInMiB types.Int64 `tfsdk:"memory_used_in_mib"`
}

Stats has the bucket stats that are related to memory and disk consumption.

func (Stats) AttributeTypes

func (s Stats) AttributeTypes() map[string]attr.Type

type Support

type Support struct {
	// Plan is the plan type, either 'Basic', 'Developer Pro', or 'Enterprise'.
	Plan types.String `tfsdk:"plan"`

	// Timezone is the standard timezone for the cluster.
	// Should be the TZ identifier.
	Timezone types.String `tfsdk:"timezone"`
}

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

type User

type User struct {
	TimeZone       types.String `tfsdk:"time_zone"`
	Region         types.String `tfsdk:"region"`
	Email          types.String `tfsdk:"email"`
	Status         types.String `tfsdk:"status"`
	Audit          types.Object `tfsdk:"audit"`
	OrganizationId types.String `tfsdk:"organization_id"`
	Name           types.String `tfsdk:"name"`
	LastLogin      types.String `tfsdk:"last_login"`
	// ExpiresAt is the time at which user invitation expires.
	ExpiresAt         types.String   `tfsdk:"expires_at"`
	Id                types.String   `tfsdk:"id"`
	OrganizationRoles []types.String `tfsdk:"organization_roles"`
	// Resources is an array of objects representing the resources the user has access to
	Resources           []Resource `tfsdk:"resources"`
	EnableNotifications types.Bool `tfsdk:"enable_notifications"`
	Inactive            types.Bool `tfsdk:"inactive"`
}

User maps User resource schema data.

func NewUser

func NewUser(
	Id types.String,
	name types.String,
	email types.String,
	status types.String,
	inactive types.Bool,
	organizationId types.String,
	organizationRoles []types.String,
	lastLogin types.String,
	region types.String,
	timeZone types.String,
	enableNotifications types.Bool,
	expiresAt types.String,
	resources []Resource,
	audit basetypes.ObjectValue,
) *User

NewUser creates a new instance of a User object.

func (*User) Validate

func (u *User) Validate() (map[Attr]string, error)

Validate is used to verify that IDs have been properly imported.

type Users

type Users struct {
	// OrganizationId is the organizationId of the capella.
	OrganizationId types.String `tfsdk:"organization_id"`

	// Data contains the list of resources.
	Data []User `tfsdk:"data"`
}

Users defines the attributes for a list of users in Capella.

type WeeklySchedule

type WeeklySchedule struct {
	// DayOfWeek represents the day of the week for the backup.
	// Enum: "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"
	DayOfWeek types.String `tfsdk:"day_of_week"`

	// RetentionTime represents the retention time in days.
	// Enum: "30days", "60days", "90days", "180days", "1year", "2years", "3years", "4years", "5years"
	RetentionTime types.String `tfsdk:"retention_time"`

	// StartAt represents the start hour of the backup.
	// Enum: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
	StartAt types.Int64 `tfsdk:"start_at"`

	// IncrementalEvery represents the interval in hours for incremental backup.
	// Enum: 1, 2, 4, 6, 8, 12, 24
	IncrementalEvery types.Int64 `tfsdk:"incremental_every"`

	// CostOptimizedRetention optimizes backup retention to reduce total cost of ownership (TCO).
	CostOptimizedRetention types.Bool `tfsdk:"cost_optimized_retention"`
}

WeeklySchedule represents the weekly schedule of the backup.

func NewWeeklySchedule

func NewWeeklySchedule(weeklySchedule backup_schedule.WeeklySchedule) WeeklySchedule

NewWeeklySchedule creates a new WeeklySchedule data object.

func (WeeklySchedule) AttributeTypes

func (b WeeklySchedule) AttributeTypes() map[string]attr.Type

Jump to

Keyboard shortcuts

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