Documentation
¶
Index ¶
- type CreateProjectRequest
- type MandatoryLabels
- type Parent
- type ProjectMember
- type ProjectResponse
- type ProjectsResponse
- type ProjectsService
- func (svc *ProjectsService) Create(ctx context.Context, name string, labels map[string]string, ...) (res ProjectResponse, err error)
- func (svc *ProjectsService) Delete(ctx context.Context, containerID string) (err error)
- func (svc *ProjectsService) Get(ctx context.Context, containerID string) (res ProjectResponse, err error)
- func (svc *ProjectsService) GetLifecycleState(ctx context.Context, containerID string) (string, error)
- func (svc *ProjectsService) List(ctx context.Context, containerParentID string, filters map[string]string, ...) (res ProjectsResponse, err error)
- func (svc *ProjectsService) Update(ctx context.Context, containerID, name, containerParentID string, ...) (res ProjectResponse, err error)
- func (svc *ProjectsService) ValidateCreateData(name string, labels map[string]string, members []ProjectMember) error
- func (svc *ProjectsService) ValidateList(containerParentID string, containerIDs []string, ...) error
- func (svc *ProjectsService) ValidateUpdateData(containerID, containerParentID, name string, labels map[string]string) error
- type UpdateProjectRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateProjectRequest ¶
type CreateProjectRequest struct {
Name string `json:"name"`
ParentID string `json:"containerParentId"`
Members []ProjectMember `json:"members"`
Labels map[string]string `json:"labels"`
}
CreateProjectRequest is the structure representing the request body for creating a project
type MandatoryLabels ¶
type MandatoryLabels struct {
BillingReference string `json:"billingReference"`
Scope string `json:"scope"`
}
MandatoryLabels represent the project's mandatory labels
func (*MandatoryLabels) ToMap ¶
func (m *MandatoryLabels) ToMap() map[string]string
type Parent ¶
type Parent struct {
ID string `json:"id"`
ContainerID string `json:"containerId"` // User friendly container ID
Type string `json:"type"` // ORGANIZATION or FOLDER
}
Parent represents a project's parent details
type ProjectMember ¶
type ProjectMember struct {
Role string `json:"role"`
Subject string `json:"subject"` // email address
}
ProjectMember is the structure representing a member of a project role can be one of "project.owner" "project.member" "project.admin" "project.auditor" the subject is the email address
type ProjectResponse ¶
type ProjectResponse struct {
Name string `json:"name"`
Parent Parent `json:"parent"`
ContainerID string `json:"containerId"` // Globally unique, user friendly identifier
ProjectID string `json:"projectId"` // Legacy identifier
LifecycleState string `json:"lifecycleState"`
Labels map[string]string `json:"labels"`
UpdateTime string `json:"updateTime"`
CreationTime string `json:"creationTime"`
}
ProjectResponse is the structure representing the server response for a project
type ProjectsResponse ¶
type ProjectsResponse struct {
Iteams []ProjectResponse `json:"items"`
Offset int `json:"offset"`
Limit int `json:"limit"`
}
ProjectsResponse is the List (get all) projects response from the API
type ProjectsService ¶
ProjectsService is the service that handles CRUD functionality for STACKIT projects
func (*ProjectsService) Create ¶
func (svc *ProjectsService) Create(ctx context.Context, name string, labels map[string]string, members ...ProjectMember) (res ProjectResponse, err error)
Create creates a new STACKIT project See also https://api.stackit.schwarz/resource-management/openapi.v2.html#operation/post-projects
func (*ProjectsService) Delete ¶
func (svc *ProjectsService) Delete(ctx context.Context, containerID string) (err error)
Delete deletes a project by ID See also https://api.stackit.schwarz/resource-management/openapi.v2.html#operation/delete-projects-containerId
func (*ProjectsService) Get ¶
func (svc *ProjectsService) Get(ctx context.Context, containerID string) (res ProjectResponse, err error)
Get returns the project by id See also https://api.stackit.schwarz/resource-management/openapi.v2.html#operation/get-projects-containerId
func (*ProjectsService) GetLifecycleState ¶
func (svc *ProjectsService) GetLifecycleState(ctx context.Context, containerID string) (string, error)
GetLifecycleState returns the project state See also https://api.stackit.schwarz/resource-management/openapi.v2.html#operation/get-projects-containerId
func (*ProjectsService) List ¶
func (svc *ProjectsService) List(ctx context.Context, containerParentID string, filters map[string]string, containerIDs ...string) (res ProjectsResponse, err error)
List returns a list of projects if containerParentID == "" at least one containerID needs to be specified (and vice versa) See also https://api.stackit.schwarz/resource-management/openapi.v2.html#operation/get-all-projects
func (*ProjectsService) Update ¶
func (svc *ProjectsService) Update(ctx context.Context, containerID, name, containerParentID string, labels map[string]string) (res ProjectResponse, err error)
Update updates an existing STACKIT project See also https://api.stackit.schwarz/resource-management/openapi.v2.html#operation/patch-projects-containerId
func (*ProjectsService) ValidateCreateData ¶
func (svc *ProjectsService) ValidateCreateData(name string, labels map[string]string, members []ProjectMember) error
ValidateCreateData validates the data required for creating a project
func (*ProjectsService) ValidateList ¶
func (svc *ProjectsService) ValidateList(containerParentID string, containerIDs []string, offset, limit, creationTime string) error
ValidateList validates the filters & container information required for listing projects
func (*ProjectsService) ValidateUpdateData ¶
func (svc *ProjectsService) ValidateUpdateData(containerID, containerParentID, name string, labels map[string]string) error
ValidateUpdateData validates the data required for updating a project