project

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 32 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 NewProjectResource

func NewProjectResource() resource.Resource

func ProjectEnvironmentResource

func ProjectEnvironmentResource() *schema.Resource

func ProjectGroupResource

func ProjectGroupResource() *schema.Resource

func ProjectRepositoryResource

func ProjectRepositoryResource() *schema.Resource

func ProjectRoleResource

func ProjectRoleResource() *schema.Resource

func ProjectUserResource

func ProjectUserResource() *schema.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 {
	sdk.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 ProjectEnvironment

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

func (ProjectEnvironment) Id

func (p ProjectEnvironment) Id() string

type ProjectEnvironmentUpdate

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

func (ProjectEnvironmentUpdate) Id

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 ProjectGroup

type ProjectGroup struct {
	ProjectKey string   `json:"-"`
	Name       string   `json:"name"`
	Roles      []string `json:"roles"`
}

func (ProjectGroup) Id

func (m ProjectGroup) Id() string

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 ProjectUser

type ProjectUser struct {
	ProjectKey        string   `json:"-"`
	Name              string   `json:"name"`
	Roles             []string `json:"roles"`
	IgnoreMissingUser bool     `json:"-"`
}

func (ProjectUser) Id

func (m ProjectUser) Id() string

type Repository

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

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