advancedcluster

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorClusterSetting            = "error setting `%s` for MongoDB Cluster (%s): %s"
	ErrorAdvancedConfRead          = "error reading Advanced Configuration Option form MongoDB Cluster (%s): %s"
	ErrorClusterAdvancedSetting    = "error setting `%s` for MongoDB ClusterAdvanced (%s): %s"
	ErrorAdvancedClusterListStatus = "error awaiting MongoDB ClusterAdvanced List IDLE: %s"
	ErrorOperationNotPermitted     = "error operation not permitted"

	DeprecationOldSchemaAction = "" /* 206-byte string literal not displayed */
)

Variables

View Source
var (
	DSTagsSchema = schema.Schema{
		Type:     schema.TypeSet,
		Computed: true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"key": {
					Type:     schema.TypeString,
					Computed: true,
				},
				"value": {
					Type:     schema.TypeString,
					Computed: true,
				},
			},
		},
	}
	RSTagsSchema = schema.Schema{
		Type:     schema.TypeSet,
		Optional: true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"key": {
					Type:     schema.TypeString,
					Required: true,
				},
				"value": {
					Type:     schema.TypeString,
					Required: true,
				},
			},
		},
	}
)
View Source
var DeprecationMsgOldSchema = fmt.Sprintf("%s %s", constant.DeprecationParam, DeprecationOldSchemaAction)

Functions

func AddIDsToReplicationSpecs added in v1.18.0

func AddIDsToReplicationSpecs(replicationSpecs []admin.ReplicationSpec20240805, zoneToReplicationSpecsIDs map[string][]string) []admin.ReplicationSpec20240805

func CreateStateChangeConfig added in v1.16.0

func CreateStateChangeConfig(ctx context.Context, connV2 *admin.APIClient, projectID, name string, timeout time.Duration) retry.StateChangeConf

func DataSource

func DataSource() *schema.Resource

func DeleteStateChangeConfig added in v1.16.0

func DeleteStateChangeConfig(ctx context.Context, connV2 *admin.APIClient, projectID, name string, timeout time.Duration) retry.StateChangeConf

func FlattenAdvancedReplicationSpecsOldSDK added in v1.18.0

func FlattenAdvancedReplicationSpecsOldSDK(ctx context.Context, apiObjects []admin20240530.ReplicationSpec, zoneNameToZoneIDs map[string]string, rootDiskSizeGB float64, tfMapObjects []any,
	d *schema.ResourceData, connV2 *admin.APIClient) ([]map[string]any, error)

func FormatMongoDBMajorVersion

func FormatMongoDBMajorVersion(val any) string

func GetDiskSizeGBFromReplicationSpec added in v1.18.0

func GetDiskSizeGBFromReplicationSpec(cluster *admin.ClusterDescription20240805) float64

GetDiskSizeGBFromReplicationSpec obtains the diskSizeGB value by looking into the electable spec of the first replication spec. Independent storage size scaling is not supported (CLOUDP-201331), meaning all electable/analytics/readOnly configs in all replication specs are the same.

func HashCodeString

func HashCodeString(s string) int

HashCodeString hashes a string to a unique hashcode.

crc32 returns a uint32, but for our use we need and non negative integer. Here we cast to an integer and invert it if the result is negative.

func HashFunctionForKeyValuePair

func HashFunctionForKeyValuePair(v any) int

func IsChangeStreamOptionsMinRequiredMajorVersion added in v1.20.0

func IsChangeStreamOptionsMinRequiredMajorVersion(input *string) bool

func IsSharedTier

func IsSharedTier(instanceSize string) bool

func MigrateBIConnectorConfig

func MigrateBIConnectorConfig(rawState map[string]any) map[string]any

func PluralDataSource

func PluralDataSource() *schema.Resource

func Resource

func Resource() *schema.Resource

func ResourceClusterListAdvancedRefreshFunc

func ResourceClusterListAdvancedRefreshFunc(ctx context.Context, projectID string, clustersAPI admin.ClustersApi) retry.StateRefreshFunc

func ResourceV0

func ResourceV0() *schema.Resource

func SchemaAdvancedConfig added in v1.15.2

func SchemaAdvancedConfig() *schema.Schema

func SchemaAdvancedConfigDS added in v1.15.2

func SchemaAdvancedConfigDS() *schema.Schema

func SchemaConnectionStrings added in v1.15.2

func SchemaConnectionStrings() *schema.Schema

func SyncAutoScalingConfigs added in v1.18.0

func SyncAutoScalingConfigs(replicationSpecs *[]admin.ReplicationSpec20240805)

Having the following considerations: - Existing replication specs can have the autoscaling values present in the state with default values even if not defined in the config (case when cluster is imported) - API expects autoScaling and analyticsAutoScaling aligned cross all region configs in the PATCH request This function is needed to avoid errors if a new replication spec is added, ensuring the PATCH request will have the auto scaling aligned with other replication specs when not present in config.

func UpgradeRefreshFunc added in v1.15.2

func UpgradeRefreshFunc(ctx context.Context, name, projectID string, client admin.ClustersApi) retry.StateRefreshFunc

Types

type ReplicationSpecSDKModel added in v1.18.0

type ReplicationSpecSDKModel interface {
	admin20240530.ReplicationSpec | admin.ReplicationSpec20240805
}

Jump to

Keyboard shortcuts

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