projects

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateProjectCreationRoles

func ValidateProjectCreationRoles(roles []ProjectRole) error

ValidateProjectCreationRoles validates that the given users and roles are correctly defined to fit project creation requirements Reference: https://api.stackit.schwarz/resource-management/openapi.v1.html#operation/post-organizations-organizationId-projects

Types

type Project

type Project struct {
	ID               string
	Name             string
	BillingReference string
	OrganizationID   string
}

Project struct holds important info about a STACKIT project

type ProjectRole

type ProjectRole struct {
	Name            string              `json:"name"`
	Users           []ProjectRoleMember `json:"users"`
	ServiceAccounts []ProjectRoleMember `json:"service_accounts"`
}

ProjectRole represents a role in the project

type ProjectRoleMember

type ProjectRoleMember struct {
	ID    string `json:"id"`
	Email string `json:"email,omitempty"`
}

ProjectRoleMember represents a user or service account

type ProjectService

type ProjectService common.Service

ProjectService is the service that handles CRUD functionality for STACKIT projects

func New

New returns a new handler for the service

func (*ProjectService) Create

func (svc *ProjectService) Create(ctx context.Context, name, billingRef string, roles ...ProjectRole) (Project, *wait.Handler, error)

Create creates a new STACKIT project it returns a wait handler - running Wait() will wait for the project to be active See also https://api.stackit.schwarz/resource-management/openapi.v1.html#operation/post-organizations-organizationId-projects

func (*ProjectService) Delete

func (svc *ProjectService) Delete(ctx context.Context, projectID string) (*wait.Handler, error)

Delete deletes a project by ID it returns a wait handler - running Wait() will wait for the project to be deleted See also https://api.stackit.schwarz/resource-management/openapi.v1.html#operation/delete-projects-projectId

func (*ProjectService) Get

func (svc *ProjectService) Get(ctx context.Context, projectID string) (Project, error)

Get returns the project by id See also https://api.stackit.schwarz/resource-management/openapi.v1.html#operation/get-projects-projectId

func (*ProjectService) GetLifecycleState

func (svc *ProjectService) GetLifecycleState(ctx context.Context, projectID string) (string, error)

GetLifecycleState returns the project state See also https://api.stackit.schwarz/resource-management/openapi.v1.html#operation/get-projects-projectId

func (*ProjectService) Update

func (svc *ProjectService) Update(ctx context.Context, id, name, billingRef string) error

Update updates an existing STACKIT project See also https://api.stackit.schwarz/resource-management/openapi.v1.html#operation/patch-project-projectId

type ProjectsLabelsResBody

type ProjectsLabelsResBody struct {
	BillingReference string `json:"billingReference"`
}

ProjectsLabelsResBody is the labels response

type ProjectsParentResBody

type ProjectsParentResBody struct {
	Type string `json:"type"`
	ID   string `json:"id"`
}

ProjectsParentResBody is the parent entity response

type ProjectsResBody

type ProjectsResBody struct {
	ProjectID      string                `json:"projectId"`
	LifecycleState string                `json:"lifecycleState"`
	Scope          string                `json:"scope"`
	Name           string                `json:"name"`
	CreateTime     string                `json:"createTime"`
	Labels         ProjectsLabelsResBody `json:"labels"`
	Parent         ProjectsParentResBody
}

ProjectsResBody is the generic api response struct

Jump to

Keyboard shortcuts

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