Documentation ¶
Index ¶
- type CreateUserRequest
- type Project
- type ProjectRepository
- func (r *ProjectRepository) Cancel(projectID string) error
- func (r *ProjectRepository) Create(project Project) error
- func (r *ProjectRepository) GetAll() ([]Project, error)
- func (r *ProjectRepository) GetByID(projectID string) (Project, error)
- func (r *ProjectRepository) Handover(projectID string, targetCustomerName string) error
- func (r *ProjectRepository) Update(project Project) error
- type User
- type UserRepository
- func (r *UserRepository) AddToProject(userID string, projectID string) error
- func (r *UserRepository) ChangePassword(userID string, newPassword string) error
- func (r *UserRepository) Create(request CreateUserRequest) error
- func (r *UserRepository) Delete(userID string) error
- func (r *UserRepository) GetAll() ([]User, error)
- func (r *UserRepository) GetByID(userID string) (User, error)
- func (r *UserRepository) GetByProjectID(projectID string) ([]User, error)
- func (r *UserRepository) RemoveFromProject(userID string, projectID string) error
- func (r *UserRepository) Update(user User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateUserRequest ¶
type CreateUserRequest struct { // ProjectID to grant the user access to ProjectID string `json:"projectId"` Username string `json:"username"` Password string `json:"password"` Description string `json:"description"` Email string `json:"email"` }
CreateUserRequest is a struct used for creating OpenStack users
type Project ¶
type Project struct { ID string `json:"id,omitempty"` Name string `json:"name"` Description string `json:"description"` // IsLocked is set to true when an ongoing process blocks the project from being modified IsLocked bool `json:"isLocked"` // IsBlockes is set to true when a project has been administratively blocked IsBlocked bool `json:"isBlocked"` }
Project struct of an OpenStack project
type ProjectRepository ¶
type ProjectRepository repository.RestRepository
ProjectRepository is the repository for creating and modifying OpenStack projects
func (*ProjectRepository) Cancel ¶
func (r *ProjectRepository) Cancel(projectID string) error
Cancel will cancel an OpenStack project, deleting all the resources it contains
func (*ProjectRepository) Create ¶
func (r *ProjectRepository) Create(project Project) error
Create creates a new OpenStack project
func (*ProjectRepository) GetAll ¶
func (r *ProjectRepository) GetAll() ([]Project, error)
GetAll returns all OpenStack projects
func (*ProjectRepository) GetByID ¶
func (r *ProjectRepository) GetByID(projectID string) (Project, error)
GetByID returns information about an OpenStack project by ID
func (*ProjectRepository) Handover ¶
func (r *ProjectRepository) Handover(projectID string, targetCustomerName string) error
Handover initiates a handover procedure to another TransIP account.
func (*ProjectRepository) Update ¶
func (r *ProjectRepository) Update(project Project) error
Update allows for updating the project name and description
type User ¶
type User struct { ID string `json:"id,omitempty"` Username string `json:"username"` Description string `json:"description"` Email string `json:"email"` }
User contains information about an OpenStack user
type UserRepository ¶
type UserRepository repository.RestRepository
UserRepository lists and manages OpenStack users. It can also add and remove users from projects
func (*UserRepository) AddToProject ¶
func (r *UserRepository) AddToProject(userID string, projectID string) error
AddToProject adds a user to an OpenStack project
func (*UserRepository) ChangePassword ¶
func (r *UserRepository) ChangePassword(userID string, newPassword string) error
ChangePassword changes the password of an existing user
func (*UserRepository) Create ¶
func (r *UserRepository) Create(request CreateUserRequest) error
Create creates a new user and grants it access to the provided projectID
func (*UserRepository) Delete ¶
func (r *UserRepository) Delete(userID string) error
Delete removes an OpenStack user entirely
func (*UserRepository) GetAll ¶
func (r *UserRepository) GetAll() ([]User, error)
GetAll list all OpenStack users
func (*UserRepository) GetByID ¶
func (r *UserRepository) GetByID(userID string) (User, error)
GetByID fetches information about an user by their ID
func (*UserRepository) GetByProjectID ¶
func (r *UserRepository) GetByProjectID(projectID string) ([]User, error)
GetByProjectID gets all the users assigned to a project
func (*UserRepository) RemoveFromProject ¶
func (r *UserRepository) RemoveFromProject(userID string, projectID string) error
RemoveFromProject removes a user from an OpenStack project
func (*UserRepository) Update ¶
func (r *UserRepository) Update(user User) error
Update can be used to update the description and email of user. To change the password of as user see ChangePassword