github.com/DaAlbrecht/cf-cli@v0.0.0-20231128151943-1fe19bb400b9/resources/task_resource.go (about)

     1  package resources
     2  
     3  import (
     4  	"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/constant"
     5  )
     6  
     7  // Task represents a Cloud Controller V3 Task.
     8  type Task struct {
     9  	// Command represents the command that will be executed. May be excluded
    10  	// based on the user's role.
    11  	Command string `json:"command,omitempty"`
    12  	// CreatedAt represents the time with zone when the object was created.
    13  	CreatedAt string `json:"created_at,omitempty"`
    14  	// DiskInMB represents the disk in MB allocated for the task.
    15  	DiskInMB uint64 `json:"disk_in_mb,omitempty"`
    16  	// GUID represents the unique task identifier.
    17  	GUID string `json:"guid,omitempty"`
    18  	// LogRateLimitInBPS represents the log rate limit in bytes allocated for the task.
    19  	LogRateLimitInBPS int `json:"log_rate_limit_in_bytes_per_second,omitempty"`
    20  	// MemoryInMB represents the memory in MB allocated for the task.
    21  	MemoryInMB uint64 `json:"memory_in_mb,omitempty"`
    22  	// Name represents the name of the task.
    23  	Name string `json:"name,omitempty"`
    24  	// SequenceID represents the user-facing id of the task. This number is
    25  	// unique for every task associated with a given app.
    26  	SequenceID int64 `json:"sequence_id,omitempty"`
    27  	// State represents the task state.
    28  	State constant.TaskState `json:"state,omitempty"`
    29  	// Tasks can use a process as a template to fill in
    30  	// command, memory, disk values
    31  	//
    32  	// Using a pointer so that it can be set to nil to prevent
    33  	// json serialization when no template is used
    34  	Template *TaskTemplate `json:"template,omitempty"`
    35  }
    36  
    37  type TaskTemplate struct {
    38  	Process TaskProcessTemplate `json:"process,omitempty"`
    39  }
    40  
    41  type TaskProcessTemplate struct {
    42  	Guid string `json:"guid,omitempty"`
    43  }