-
Notifications
You must be signed in to change notification settings - Fork 944
/
Copy pathtask_resource.go
50 lines (44 loc) · 1.78 KB
/
task_resource.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
package resources
import (
"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/constant"
)
// Task represents a Cloud Controller V3 Task.
type Task struct {
// Command represents the command that will be executed. May be excluded
// based on the user's role.
Command string `json:"command,omitempty"`
// CreatedAt represents the time with zone when the object was created.
CreatedAt string `json:"created_at,omitempty"`
// DiskInMB represents the disk in MB allocated for the task.
DiskInMB uint64 `json:"disk_in_mb,omitempty"`
// GUID represents the unique task identifier.
GUID string `json:"guid,omitempty"`
// LogRateLimitInBPS represents the log rate limit in bytes allocated for the task.
LogRateLimitInBPS int `json:"log_rate_limit_in_bytes_per_second,omitempty"`
// MemoryInMB represents the memory in MB allocated for the task.
MemoryInMB uint64 `json:"memory_in_mb,omitempty"`
// Name represents the name of the task.
Name string `json:"name,omitempty"`
// SequenceID represents the user-facing id of the task. This number is
// unique for every task associated with a given app.
SequenceID int64 `json:"sequence_id,omitempty"`
// State represents the task state.
State constant.TaskState `json:"state,omitempty"`
// Tasks can use a process as a template to fill in
// command, memory, disk values
//
// Using a pointer so that it can be set to nil to prevent
// json serialization when no template is used
Template *TaskTemplate `json:"template,omitempty"`
// Result contains the task result
Result *TaskResult `json:"result,omitempty"`
}
type TaskTemplate struct {
Process TaskProcessTemplate `json:"process,omitempty"`
}
type TaskProcessTemplate struct {
Guid string `json:"guid,omitempty"`
}
type TaskResult struct {
FailureReason string `json:"failure_reason,omitempty"`
}