project

package
v1.15.1-pre Latest Latest
Warning

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

Go to latest
Published: Feb 6, 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 NewGroupName

func NewGroupName(tfProject *TFProjectRSModel) *admin.GroupName

func NewTFIPAddressesModel added in v1.15.0

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

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, client GroupProjectService) 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, client GroupProjectService, 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, client GroupProjectService, projectState, projectPlan *TFProjectRSModel) error

func UpdateProjectTeams

func UpdateProjectTeams(ctx context.Context, client GroupProjectService, 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, client GroupProjectService, 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 GroupProjectService

type GroupProjectService interface {
	UpdateProject(ctx context.Context, groupID string, groupName *admin.GroupName) (*admin.Group, *http.Response, error)
	ListProjectTeams(ctx context.Context, groupID string) (*admin.PaginatedTeamRole, *http.Response, error)
	GetProjectSettings(ctx context.Context, groupID string) (*admin.GroupSettings, *http.Response, error)
	DeleteProjectLimit(ctx context.Context, limitName, projectID string) (map[string]interface{}, *http.Response, error)
	SetProjectLimit(ctx context.Context, limitName, groupID string, dataFederationLimit *admin.DataFederationLimit) (*admin.DataFederationLimit, *http.Response, error)
	ListProjectLimits(ctx context.Context, groupID string) ([]admin.DataFederationLimit, *http.Response, error)
	RemoveProjectTeam(ctx context.Context, groupID, teamID string) (*http.Response, error)
	UpdateTeamRoles(ctx context.Context, groupID, teamID string, teamRole *admin.TeamRole) (*admin.PaginatedTeamRole, *http.Response, error)
	AddAllTeamsToProject(ctx context.Context, groupID string, teamRole *[]admin.TeamRole) (*admin.PaginatedTeamRole, *http.Response, error)
	ListClusters(ctx context.Context, groupID string) (*admin.PaginatedAdvancedClusterDescription, *http.Response, error)
	ReturnAllIPAddresses(ctx context.Context, groupID string) (*admin.GroupIPAddresses, *http.Response, error)
}

func ServiceFromClient

func ServiceFromClient(client *admin.APIClient) GroupProjectService

type GroupProjectServiceFromClient

type GroupProjectServiceFromClient struct {
	// contains filtered or unexported fields
}

func (*GroupProjectServiceFromClient) AddAllTeamsToProject

func (a *GroupProjectServiceFromClient) AddAllTeamsToProject(ctx context.Context, groupID string, teamRole *[]admin.TeamRole) (*admin.PaginatedTeamRole, *http.Response, error)

func (*GroupProjectServiceFromClient) DeleteProjectLimit

func (a *GroupProjectServiceFromClient) DeleteProjectLimit(ctx context.Context, limitName, projectID string) (map[string]interface{}, *http.Response, error)

func (*GroupProjectServiceFromClient) GetProjectSettings

func (a *GroupProjectServiceFromClient) GetProjectSettings(ctx context.Context, groupID string) (*admin.GroupSettings, *http.Response, error)

func (*GroupProjectServiceFromClient) ListClusters

func (*GroupProjectServiceFromClient) ListProjectLimits

func (*GroupProjectServiceFromClient) ListProjectTeams

func (*GroupProjectServiceFromClient) RemoveProjectTeam

func (a *GroupProjectServiceFromClient) RemoveProjectTeam(ctx context.Context, groupID, teamID string) (*http.Response, error)

func (*GroupProjectServiceFromClient) ReturnAllIPAddresses added in v1.15.0

func (a *GroupProjectServiceFromClient) ReturnAllIPAddresses(ctx context.Context, groupID string) (*admin.GroupIPAddresses, *http.Response, error)

func (*GroupProjectServiceFromClient) SetProjectLimit

func (a *GroupProjectServiceFromClient) SetProjectLimit(ctx context.Context, limitName, groupID string,
	dataFederationLimit *admin.DataFederationLimit) (*admin.DataFederationLimit, *http.Response, error)

func (*GroupProjectServiceFromClient) UpdateProject

func (a *GroupProjectServiceFromClient) UpdateProject(ctx context.Context, groupID string, groupName *admin.GroupName) (*admin.Group, *http.Response, error)

func (*GroupProjectServiceFromClient) UpdateTeamRoles

func (a *GroupProjectServiceFromClient) UpdateTeamRoles(ctx context.Context, groupID, teamID string, teamRole *admin.TeamRole) (*admin.PaginatedTeamRole, *http.Response, error)

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"`
	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"`
	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