project

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProjectsUrl           = "/access/api/v1/projects"
	ProjectUrl            = ProjectsUrl + "/{projectKey}"
	MaxStorageInGibibytes = 8589934591
)
View Source
const ProjectEnvironmentUrl = "/access/api/v1/projects/{projectKey}/environments"
View Source
const ProjectGroupsUrl = "access/api/v1/projects/{projectKey}/groups/{name}"
View Source
const ProjectRoleUrl = ProjectRolesUrl + "/{roleName}"
View Source
const ProjectRolesUrl = ProjectUrl + "/roles"
View Source
const ProjectUsersUrl = "access/api/v1/projects/{projectKey}/users/{name}"

Variables

This section is empty.

Functions

func BytesToGibibytes

func BytesToGibibytes(bytes int64) int64

func GibibytesToBytes

func GibibytesToBytes(bytes int64) int64

func NewProjectEnvironmentResource added in v1.6.1

func NewProjectEnvironmentResource() resource.Resource

func NewProjectGroupResource added in v1.6.2

func NewProjectGroupResource() resource.Resource

func NewProjectRepositoryResource added in v1.6.2

func NewProjectRepositoryResource() resource.Resource

func NewProjectResource

func NewProjectResource() resource.Resource

func NewProjectRoleResource added in v1.6.2

func NewProjectRoleResource() resource.Resource

func NewProjectUserResource added in v1.6.2

func NewProjectUserResource() resource.Resource

func RetryOnSpecificMsgBody

func RetryOnSpecificMsgBody(matchString string) func(response *resty.Response, err error) bool

Types

type AdminPrivilegesAPIModel

type AdminPrivilegesAPIModel struct {
	ManageMembers   bool `json:"manage_members"`
	ManageResources bool `json:"manage_resources"`
	IndexResources  bool `json:"index_resources"`
}

type ArtifactoryRepo

type ArtifactoryRepo struct {
	Key string
}

type Equatable

type Equatable interface {
	util.Identifiable
	Equals(other Equatable) bool
}

type MemberAPIModel

type MemberAPIModel struct {
	Name  string   `json:"name"`
	Roles []string `json:"roles"`
}

Use by both project user and project group, as they shared identical data structure

func (MemberAPIModel) Equals

func (a MemberAPIModel) Equals(b Equatable) bool

func (MemberAPIModel) Id

func (m MemberAPIModel) Id() string

type MembershipAPIModel

type MembershipAPIModel struct {
	Members []MemberAPIModel
}

Use by both project user and project group, as they shared identical data structure

type ProjectAPIModel

type ProjectAPIModel struct {
	Key                    string                  `json:"project_key"`
	DisplayName            string                  `json:"display_name"`
	Description            string                  `json:"description"`
	AdminPrivileges        AdminPrivilegesAPIModel `json:"admin_privileges"`
	StorageQuota           int64                   `json:"storage_quota_bytes"`
	SoftLimit              bool                    `json:"soft_limit"`
	QuotaEmailNotification bool                    `json:"storage_quota_email_notification"`
}

Project GET {{ host }}/access/api/v1/projects/{{projKey}}/ GET {{ host }}/artifactory/api/repositories/?project={{projKey}}

type ProjectEnvironmentAPIModel added in v1.6.1

type ProjectEnvironmentAPIModel struct {
	Name string `json:"name"`
}

type ProjectEnvironmentResource

type ProjectEnvironmentResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*ProjectEnvironmentResource) Configure added in v1.6.1

func (*ProjectEnvironmentResource) Create added in v1.6.1

func (*ProjectEnvironmentResource) Delete added in v1.6.1

func (*ProjectEnvironmentResource) ImportState added in v1.6.1

ImportState imports the resource into the Terraform state.

func (*ProjectEnvironmentResource) Metadata added in v1.6.1

func (*ProjectEnvironmentResource) Read added in v1.6.1

func (*ProjectEnvironmentResource) Schema added in v1.6.1

func (*ProjectEnvironmentResource) Update added in v1.6.1

func (ProjectEnvironmentResource) ValidateConfig added in v1.6.1

type ProjectEnvironmentResourceModel added in v1.6.1

type ProjectEnvironmentResourceModel struct {
	ID         types.String `tfsdk:"id"`
	Name       types.String `tfsdk:"name"`
	ProjectKey types.String `tfsdk:"project_key"`
}

type ProjectEnvironmentUpdateAPIModel added in v1.6.1

type ProjectEnvironmentUpdateAPIModel struct {
	NewName string `json:"new_name"`
}

type ProjectError

type ProjectError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

func (ProjectError) String

func (e ProjectError) String() string

type ProjectErrorsResponse

type ProjectErrorsResponse struct {
	Errors []ProjectError `json:"errors"`
}

func (ProjectErrorsResponse) String

func (r ProjectErrorsResponse) String() string

type ProjectGroupAPIModel added in v1.6.2

type ProjectGroupAPIModel struct {
	Name  string   `json:"name"`
	Roles []string `json:"roles"`
}

type ProjectGroupResource

type ProjectGroupResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*ProjectGroupResource) Configure added in v1.6.2

func (*ProjectGroupResource) Create added in v1.6.2

func (*ProjectGroupResource) Delete added in v1.6.2

func (*ProjectGroupResource) ImportState added in v1.6.2

ImportState imports the resource into the Terraform state.

func (*ProjectGroupResource) Metadata added in v1.6.2

func (*ProjectGroupResource) Read added in v1.6.2

func (*ProjectGroupResource) Schema added in v1.6.2

func (*ProjectGroupResource) Update added in v1.6.2

type ProjectGroupResourceModel added in v1.6.2

type ProjectGroupResourceModel struct {
	ID         types.String `tfsdk:"id"`
	Name       types.String `tfsdk:"name"`
	ProjectKey types.String `tfsdk:"project_key"`
	Roles      types.Set    `tfsdk:"roles"`
}

type ProjectRepositoryAPIModel added in v1.6.2

type ProjectRepositoryAPIModel struct {
	Key        string `json:"key"`
	ProjectKey string `json:"projectKey"`
}

type ProjectRepositoryResource

type ProjectRepositoryResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*ProjectRepositoryResource) Configure added in v1.6.2

func (*ProjectRepositoryResource) Create added in v1.6.2

func (*ProjectRepositoryResource) Delete added in v1.6.2

func (*ProjectRepositoryResource) ImportState added in v1.6.2

ImportState imports the resource into the Terraform state.

func (*ProjectRepositoryResource) Metadata added in v1.6.2

func (*ProjectRepositoryResource) Read added in v1.6.2

func (*ProjectRepositoryResource) Schema added in v1.6.2

func (*ProjectRepositoryResource) Update added in v1.6.2

type ProjectRepositoryResourceModel added in v1.6.2

type ProjectRepositoryResourceModel struct {
	ID         types.String `tfsdk:"id"`
	Key        types.String `tfsdk:"key"`
	ProjectKey types.String `tfsdk:"project_key"`
}

type ProjectResource

type ProjectResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*ProjectResource) Configure

func (*ProjectResource) Create

func (*ProjectResource) Delete

func (*ProjectResource) ImportState

ImportState imports the resource into the Terraform state.

func (*ProjectResource) Metadata

func (*ProjectResource) Read

func (*ProjectResource) Schema

func (*ProjectResource) Update

func (*ProjectResource) UpgradeState

func (r *ProjectResource) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader

type ProjectResourceModelV1

type ProjectResourceModelV1 struct {
	ID                     types.String `tfsdk:"id"`
	Key                    types.String `tfsdk:"key"`
	DisplayName            types.String `tfsdk:"display_name"`
	Description            types.String `tfsdk:"description"`
	AdminPrivileges        types.Set    `tfsdk:"admin_privileges"`
	MaxStorageInGibibytes  types.Int64  `tfsdk:"max_storage_in_gibibytes"`
	SoftLimit              types.Bool   `tfsdk:"block_deployments_on_limit"`
	QuotaEmailNotification types.Bool   `tfsdk:"email_notification"`
	Members                types.Set    `tfsdk:"member"`
	Groups                 types.Set    `tfsdk:"group"`
	Roles                  types.Set    `tfsdk:"role"`
	Repos                  types.Set    `tfsdk:"repos"`
}

type ProjectResourceModelV2

type ProjectResourceModelV2 struct {
	ID                     types.String `tfsdk:"id"`
	Key                    types.String `tfsdk:"key"`
	DisplayName            types.String `tfsdk:"display_name"`
	Description            types.String `tfsdk:"description"`
	AdminPrivileges        types.Set    `tfsdk:"admin_privileges"`
	MaxStorageInGibibytes  types.Int64  `tfsdk:"max_storage_in_gibibytes"`
	SoftLimit              types.Bool   `tfsdk:"block_deployments_on_limit"`
	QuotaEmailNotification types.Bool   `tfsdk:"email_notification"`
	Members                types.Set    `tfsdk:"member"`
	Groups                 types.Set    `tfsdk:"group"`
	Roles                  types.Set    `tfsdk:"role"`
	Repos                  types.Set    `tfsdk:"repos"`
	UseProjectRoleResource types.Bool   `tfsdk:"use_project_role_resource"`
}

type ProjectResourceModelV3

type ProjectResourceModelV3 struct {
	ID                      types.String `tfsdk:"id"`
	Key                     types.String `tfsdk:"key"`
	DisplayName             types.String `tfsdk:"display_name"`
	Description             types.String `tfsdk:"description"`
	AdminPrivileges         types.Set    `tfsdk:"admin_privileges"`
	MaxStorageInGibibytes   types.Int64  `tfsdk:"max_storage_in_gibibytes"`
	SoftLimit               types.Bool   `tfsdk:"block_deployments_on_limit"`
	QuotaEmailNotification  types.Bool   `tfsdk:"email_notification"`
	Members                 types.Set    `tfsdk:"member"`
	Groups                  types.Set    `tfsdk:"group"`
	Roles                   types.Set    `tfsdk:"role"`
	Repos                   types.Set    `tfsdk:"repos"`
	UseProjectRoleResource  types.Bool   `tfsdk:"use_project_role_resource"`
	UseProjectUserResource  types.Bool   `tfsdk:"use_project_user_resource"`
	UseProjectGroupResource types.Bool   `tfsdk:"use_project_group_resource"`
}

type ProjectResourceModelV4

type ProjectResourceModelV4 struct {
	ID                           types.String `tfsdk:"id"`
	Key                          types.String `tfsdk:"key"`
	DisplayName                  types.String `tfsdk:"display_name"`
	Description                  types.String `tfsdk:"description"`
	AdminPrivileges              types.Set    `tfsdk:"admin_privileges"`
	MaxStorageInGibibytes        types.Int64  `tfsdk:"max_storage_in_gibibytes"`
	SoftLimit                    types.Bool   `tfsdk:"block_deployments_on_limit"`
	QuotaEmailNotification       types.Bool   `tfsdk:"email_notification"`
	Members                      types.Set    `tfsdk:"member"`
	Groups                       types.Set    `tfsdk:"group"`
	Roles                        types.Set    `tfsdk:"role"`
	Repos                        types.Set    `tfsdk:"repos"`
	UseProjectRoleResource       types.Bool   `tfsdk:"use_project_role_resource"`
	UseProjectUserResource       types.Bool   `tfsdk:"use_project_user_resource"`
	UseProjectGroupResource      types.Bool   `tfsdk:"use_project_group_resource"`
	UseProjectRepositoryResource types.Bool   `tfsdk:"use_project_repository_resource"`
}

type ProjectRoleAPIModel added in v1.6.2

type ProjectRoleAPIModel struct {
	Name         string   `json:"name"`
	Type         string   `json:"type"`
	Environments []string `json:"environments"`
	Actions      []string `json:"actions"`
}

type ProjectRoleResource

type ProjectRoleResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*ProjectRoleResource) Configure added in v1.6.2

func (*ProjectRoleResource) Create added in v1.6.2

func (*ProjectRoleResource) Delete added in v1.6.2

func (*ProjectRoleResource) ImportState added in v1.6.2

ImportState imports the resource into the Terraform state.

func (*ProjectRoleResource) Metadata added in v1.6.2

func (*ProjectRoleResource) Read added in v1.6.2

func (*ProjectRoleResource) Schema added in v1.6.2

func (*ProjectRoleResource) Update added in v1.6.2

type ProjectRoleResourceModel added in v1.6.2

type ProjectRoleResourceModel struct {
	ID           types.String `tfsdk:"id"`
	Name         types.String `tfsdk:"name"`
	Type         types.String `tfsdk:"type"`
	ProjectKey   types.String `tfsdk:"project_key"`
	Environments types.Set    `tfsdk:"environments"`
	Actions      types.Set    `tfsdk:"actions"`
}

type ProjectUserAPIModel added in v1.6.2

type ProjectUserAPIModel struct {
	Name  string   `json:"name"`
	Roles []string `json:"roles"`
}

type ProjectUserResource

type ProjectUserResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*ProjectUserResource) Configure added in v1.6.2

func (*ProjectUserResource) Create added in v1.6.2

func (*ProjectUserResource) Delete added in v1.6.2

func (*ProjectUserResource) ImportState added in v1.6.2

ImportState imports the resource into the Terraform state.

func (*ProjectUserResource) Metadata added in v1.6.2

func (*ProjectUserResource) Read added in v1.6.2

func (*ProjectUserResource) Schema added in v1.6.2

func (*ProjectUserResource) Update added in v1.6.2

type ProjectUserResourceModel added in v1.6.2

type ProjectUserResourceModel struct {
	ID                types.String `tfsdk:"id"`
	Name              types.String `tfsdk:"name"`
	ProjectKey        types.String `tfsdk:"project_key"`
	Roles             types.Set    `tfsdk:"roles"`
	IgnoreMissingUser types.Bool   `tfsdk:"ignore_missing_user"`
}

type Role

type Role struct {
	Name         string   `json:"name"`
	Description  string   `json:"description"`
	Type         string   `json:"type"`
	Environments []string `json:"environments"`
	Actions      []string `json:"actions"`
}

func (Role) Equals

func (a Role) Equals(b Equatable) bool

func (Role) Id

func (r Role) Id() string

type Set

type Set[T Equatable] []T

func SetFromSlice

func SetFromSlice[T Equatable](values []T) Set[T]

func (Set[T]) Contains

func (s Set[T]) Contains(b T) bool

func (Set[T]) Difference

func (s Set[T]) Difference(other Set[T]) Set[T]

Difference returns a Set containing all the items not contained in the other set. Note this is "unidirectional", and the result is _only_ the elements in A that are not in B. Example: [1, 2, 3].Difference([2, 3, 4]) = [1].

func (Set[T]) Intersection

func (s Set[T]) Intersection(other Set[T]) Set[T]

Intersection returns a Set containing all the common items between both Sets. Example: [1, 2, 3].Intersection([2, 3, 4]) = [2, 3].

Jump to

Keyboard shortcuts

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