forked from canonical/lxd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
project.go
42 lines (35 loc) · 1.01 KB
/
project.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package api
// ProjectsPost represents the fields of a new LXD project
//
// API extension: projects
type ProjectsPost struct {
ProjectPut `yaml:",inline"`
Name string `json:"name" yaml:"name"`
}
// ProjectPost represents the fields required to rename a LXD project
//
// API extension: projects
type ProjectPost struct {
Name string `json:"name" yaml:"name"`
}
// ProjectPut represents the modifiable fields of a LXD project
//
// API extension: projects
type ProjectPut struct {
Description string `json:"description" yaml:"description"`
Config map[string]string `json:"config" yaml:"config"`
}
// Project represents a LXD project
//
// API extension: projects
type Project struct {
ProjectPut `yaml:",inline"`
Name string `json:"name" yaml:"name"`
UsedBy []string `json:"used_by" yaml:"used_by"`
}
// Writable converts a full Project struct into a ProjectPut struct (filters read-only fields)
//
// API extension: projects
func (project *Project) Writable() ProjectPut {
return project.ProjectPut
}