project

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorProjectRead = "error getting project (%s): %s"
)

Variables

View Source
var ClusterIPsObjectType = types.ObjectType{AttrTypes: map[string]attr.Type{
	"cluster_name": types.StringType,
	"inbound":      types.ListType{ElemType: types.StringType},
	"outbound":     types.ListType{ElemType: types.StringType},
}}
View Source
var IPAddressesObjectType = types.ObjectType{AttrTypes: map[string]attr.Type{
	"services": ServicesObjectType,
}}
View Source
var ServicesObjectType = types.ObjectType{AttrTypes: map[string]attr.Type{
	"clusters": types.ListType{ElemType: ClusterIPsObjectType},
}}
View Source
var TfLimitObjectType = types.ObjectType{AttrTypes: map[string]attr.Type{
	"name":          types.StringType,
	"value":         types.Int64Type,
	"current_usage": types.Int64Type,
	"default_limit": types.Int64Type,
	"maximum_limit": types.Int64Type,
}}
View Source
var TfTeamObjectType = types.ObjectType{AttrTypes: map[string]attr.Type{
	"team_id":    types.StringType,
	"role_names": types.SetType{ElemType: types.StringType},
}}

Functions

func DataSource

func DataSource() datasource.DataSource

func FilterUserDefinedLimits

func FilterUserDefinedLimits(allAtlasLimits []admin.DataFederationLimit, tflimits []TFLimitModel) []admin.DataFederationLimit

func NewGroupUpdate added in v1.15.3

func NewGroupUpdate(tfProject *TFProjectRSModel, tags *[]admin.ResourceTag) *admin.GroupUpdate

func NewResourceTags added in v1.16.0

func NewResourceTags(ctx context.Context, tags types.Map) []admin.ResourceTag

func NewTFIPAddressesModel added in v1.15.0

func NewTFIPAddressesModel(ctx context.Context, ipAddresses *admin.GroupIPAddresses) (types.Object, diag.Diagnostics)

func NewTFTags added in v1.16.0

func NewTFTags(tags []admin.ResourceTag) types.Map

func NewTeamRoleList

func NewTeamRoleList(ctx context.Context, teams []TFTeamModel) *[]admin.TeamRole

func NewTfLimitModelMap

func NewTfLimitModelMap(limits []TFLimitModel) map[types.String]TFLimitModel

func NewTfTeamModelMap

func NewTfTeamModelMap(teams []TFTeamModel) map[types.String]TFTeamModel

func PluralDataSource

func PluralDataSource() datasource.DataSource

func Resource

func Resource() resource.Resource

func ResourceProjectDependentsDeletingRefreshFunc

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

resourceProjectDependentsDeletingRefreshFunc assumes the project CRUD outcome will be the same for any non-zero number of dependents

If all dependents are deleting, wait to try and delete Else consider the aggregate dependents idle.

If we get a defined error response, return that right away Else retry

func SetProjectBool added in v1.15.0

func SetProjectBool(plan types.Bool, setting **bool)

func UpdateProject

func UpdateProject(ctx context.Context, projectsAPI admin.ProjectsApi, projectState, projectPlan *TFProjectRSModel) error

func UpdateProjectBool added in v1.15.0

func UpdateProjectBool(plan, state types.Bool, setting **bool) bool

func UpdateProjectLimits

func UpdateProjectLimits(ctx context.Context, projectsAPI admin.ProjectsApi, projectState, projectPlan *TFProjectRSModel) error

func UpdateProjectTeams

func UpdateProjectTeams(ctx context.Context, teamsAPI admin.TeamsApi, projectState, projectPlan *TFProjectRSModel) error

Types

type AdditionalProperties added in v1.15.0

type AdditionalProperties struct {
	Teams       *admin.PaginatedTeamRole
	Settings    *admin.GroupSettings
	IPAddresses *admin.GroupIPAddresses
	Limits      []admin.DataFederationLimit
}

func GetProjectPropsFromAPI

func GetProjectPropsFromAPI(ctx context.Context, projectsAPI admin.ProjectsApi, teamsAPI admin.TeamsApi, projectID string) (*AdditionalProperties, error)

GetProjectPropsFromAPI fetches properties obtained from complementary endpoints associated with a project.

type AtlasProjectDependants

type AtlasProjectDependants struct {
	AdvancedClusters *admin.PaginatedAdvancedClusterDescription
}

Resources that need to be cleaned up before a project can be deleted

type ProjectsDS

type ProjectsDS struct {
	config.DSCommon
}

func (*ProjectsDS) Read

func (*ProjectsDS) Schema

type TFClusterIPsModel added in v1.15.0

type TFClusterIPsModel struct {
	ClusterName types.String `tfsdk:"cluster_name"`
	Inbound     types.List   `tfsdk:"inbound"`
	Outbound    types.List   `tfsdk:"outbound"`
}

type TFIPAddressesModel added in v1.15.0

type TFIPAddressesModel struct {
	Services TFServicesModel `tfsdk:"services"`
}

type TFLimitModel added in v1.15.0

type TFLimitModel struct {
	Name         types.String `tfsdk:"name"`
	Value        types.Int64  `tfsdk:"value"`
	CurrentUsage types.Int64  `tfsdk:"current_usage"`
	DefaultLimit types.Int64  `tfsdk:"default_limit"`
	MaximumLimit types.Int64  `tfsdk:"maximum_limit"`
}

func NewTFLimitsDataSourceModel

func NewTFLimitsDataSourceModel(ctx context.Context, dataFederationLimits []admin.DataFederationLimit) []*TFLimitModel

type TFProjectDSModel added in v1.15.0

type TFProjectDSModel struct {
	IPAddresses                                 types.Object     `tfsdk:"ip_addresses"`
	Created                                     types.String     `tfsdk:"created"`
	OrgID                                       types.String     `tfsdk:"org_id"`
	RegionUsageRestrictions                     types.String     `tfsdk:"region_usage_restrictions"`
	ID                                          types.String     `tfsdk:"id"`
	Name                                        types.String     `tfsdk:"name"`
	ProjectID                                   types.String     `tfsdk:"project_id"`
	Tags                                        types.Map        `tfsdk:"tags"`
	Teams                                       []*TFTeamDSModel `tfsdk:"teams"`
	Limits                                      []*TFLimitModel  `tfsdk:"limits"`
	ClusterCount                                types.Int64      `tfsdk:"cluster_count"`
	IsCollectDatabaseSpecificsStatisticsEnabled types.Bool       `tfsdk:"is_collect_database_specifics_statistics_enabled"`
	IsRealtimePerformancePanelEnabled           types.Bool       `tfsdk:"is_realtime_performance_panel_enabled"`
	IsSchemaAdvisorEnabled                      types.Bool       `tfsdk:"is_schema_advisor_enabled"`
	IsPerformanceAdvisorEnabled                 types.Bool       `tfsdk:"is_performance_advisor_enabled"`
	IsExtendedStorageSizesEnabled               types.Bool       `tfsdk:"is_extended_storage_sizes_enabled"`
	IsDataExplorerEnabled                       types.Bool       `tfsdk:"is_data_explorer_enabled"`
}

func NewTFProjectDataSourceModel

func NewTFProjectDataSourceModel(ctx context.Context, project *admin.Group, projectProps AdditionalProperties) (*TFProjectDSModel, diag.Diagnostics)

type TFProjectRSModel added in v1.15.0

type TFProjectRSModel struct {
	Limits                                      types.Set    `tfsdk:"limits"`
	Teams                                       types.Set    `tfsdk:"teams"`
	Tags                                        types.Map    `tfsdk:"tags"`
	IPAddresses                                 types.Object `tfsdk:"ip_addresses"`
	RegionUsageRestrictions                     types.String `tfsdk:"region_usage_restrictions"`
	Name                                        types.String `tfsdk:"name"`
	OrgID                                       types.String `tfsdk:"org_id"`
	Created                                     types.String `tfsdk:"created"`
	ProjectOwnerID                              types.String `tfsdk:"project_owner_id"`
	ID                                          types.String `tfsdk:"id"`
	ClusterCount                                types.Int64  `tfsdk:"cluster_count"`
	IsDataExplorerEnabled                       types.Bool   `tfsdk:"is_data_explorer_enabled"`
	IsPerformanceAdvisorEnabled                 types.Bool   `tfsdk:"is_performance_advisor_enabled"`
	IsRealtimePerformancePanelEnabled           types.Bool   `tfsdk:"is_realtime_performance_panel_enabled"`
	IsSchemaAdvisorEnabled                      types.Bool   `tfsdk:"is_schema_advisor_enabled"`
	IsExtendedStorageSizesEnabled               types.Bool   `tfsdk:"is_extended_storage_sizes_enabled"`
	IsCollectDatabaseSpecificsStatisticsEnabled types.Bool   `tfsdk:"is_collect_database_specifics_statistics_enabled"`
	WithDefaultAlertsSettings                   types.Bool   `tfsdk:"with_default_alerts_settings"`
}

func NewTFProjectResourceModel

func NewTFProjectResourceModel(ctx context.Context, projectRes *admin.Group, projectProps AdditionalProperties) (*TFProjectRSModel, diag.Diagnostics)

type TFServicesModel added in v1.15.0

type TFServicesModel struct {
	Clusters []TFClusterIPsModel `tfsdk:"clusters"`
}

type TFTeamDSModel added in v1.15.0

type TFTeamDSModel struct {
	TeamID    types.String `tfsdk:"team_id"`
	RoleNames types.List   `tfsdk:"role_names"`
}

func NewTFTeamsDataSourceModel

func NewTFTeamsDataSourceModel(ctx context.Context, atlasTeams *admin.PaginatedTeamRole) []*TFTeamDSModel

type TFTeamModel added in v1.15.0

type TFTeamModel struct {
	TeamID    types.String `tfsdk:"team_id"`
	RoleNames types.Set    `tfsdk:"role_names"`
}

Jump to

Keyboard shortcuts

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