-
Notifications
You must be signed in to change notification settings - Fork 14
/
vm_groups.go
60 lines (50 loc) · 2.07 KB
/
vm_groups.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package egoscale
// InstanceGroup represents a group of VM
type InstanceGroup struct {
Account string `json:"account,omitempty" doc:"the account owning the instance group"`
Created string `json:"created,omitempty" doc:"time and date the instance group was created"`
ID *UUID `json:"id,omitempty" doc:"the id of the instance group"`
Name string `json:"name,omitempty" doc:"the name of the instance group"`
}
// CreateInstanceGroup creates a VM group
type CreateInstanceGroup struct {
Name string `json:"name" doc:"the name of the instance group"`
_ bool `name:"createInstanceGroup" description:"Creates a vm group"`
}
func (CreateInstanceGroup) response() interface{} {
return new(InstanceGroup)
}
// UpdateInstanceGroup updates a VM group
type UpdateInstanceGroup struct {
ID *UUID `json:"id" doc:"Instance group ID"`
Name string `json:"name,omitempty" doc:"new instance group name"`
_ bool `name:"updateInstanceGroup" description:"Updates a vm group"`
}
func (UpdateInstanceGroup) response() interface{} {
return new(InstanceGroup)
}
// DeleteInstanceGroup deletes a VM group
type DeleteInstanceGroup struct {
ID *UUID `json:"id" doc:"the ID of the instance group"`
_ bool `name:"deleteInstanceGroup" description:"Deletes a vm group"`
}
func (DeleteInstanceGroup) response() interface{} {
return new(booleanResponse)
}
// ListInstanceGroups lists VM groups
type ListInstanceGroups struct {
ID *UUID `json:"id,omitempty" doc:"list instance groups by ID"`
Keyword string `json:"keyword,omitempty" doc:"List by keyword"`
Name string `json:"name,omitempty" doc:"list instance groups by name"`
Page int `json:"page,omitempty"`
PageSize int `json:"pagesize,omitempty"`
_ bool `name:"listInstanceGroups" description:"Lists vm groups"`
}
// ListInstanceGroupsResponse represents a list of instance groups
type ListInstanceGroupsResponse struct {
Count int `json:"count"`
InstanceGroup []InstanceGroup `json:"instancegroup"`
}
func (ListInstanceGroups) response() interface{} {
return new(ListInstanceGroupsResponse)
}