tasks

package
v2.65.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2025 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNil

func IsNil(i interface{}) bool

Types

type ActivityElement added in v2.64.3

type ActivityElement struct {
	ID                 string                `json:"Id"`
	Name               string                `json:"Name"`
	Started            *time.Time            `json:"Started"`
	Ended              *time.Time            `json:"Ended"`
	Status             string                `json:"Status"`
	Children           []*ActivityElement    `json:"Children"`
	ShowAtSummaryLevel bool                  `json:"ShowAtSummaryLevel"`
	LogElements        []*ActivityLogElement `json:"LogElements"`
}

type ActivityLogElement added in v2.64.3

type ActivityLogElement struct {
	OccurredAt  time.Time `json:"OccurredAt"`
	Category    string    `json:"Category"`
	MessageText string    `json:"MessageText"`
	Number      int       `json:"Number"`
}

type Task

type Task struct {
	Arguments                  map[string]interface{} `json:"Arguments,omitempty"`
	CanRerun                   bool                   `json:"CanRerun"`
	Completed                  string                 `json:"Completed,omitempty"`
	CompletedTime              *time.Time             `json:"CompletedTime,omitempty"`
	Description                string                 `json:"Description,omitempty"`
	Duration                   string                 `json:"Duration,omitempty"`
	ErrorMessage               string                 `json:"ErrorMessage,omitempty"`
	FinishedSuccessfully       *bool                  `json:"FinishedSuccessfully"`
	HasBeenPickedUpByProcessor bool                   `json:"HasBeenPickedUpByProcessor"`
	HasPendingInterruptions    bool                   `json:"HasPendingInterruptions"`
	HasWarningsOrErrors        bool                   `json:"HasWarningsOrErrors"`
	IsCompleted                *bool                  `json:"IsCompleted"`
	LastUpdatedTime            *time.Time             `json:"LastUpdatedTime,omitempty"`
	Name                       string                 `json:"Name,omitempty"`
	QueueTime                  *time.Time             `json:"QueueTime,omitempty"`
	QueueTimeExpiry            *time.Time             `json:"QueueTimeExpiry,omitempty"`
	ServerNode                 string                 `json:"ServerNode,omitempty"`
	SpaceID                    string                 `json:"SpaceId,omitempty"`
	StartTime                  *time.Time             `json:"StartTime,omitempty"`
	State                      string                 `json:"State,omitempty"`

	resources.Resource
}

func NewTask

func NewTask() *Task

NewTask creates and initializes a task.

type TaskDetailsResource added in v2.64.3

type TaskDetailsResource struct {
	Task            *Task              `json:"Task"`
	ActivityLogs    []*ActivityElement `json:"ActivityLogs"`
	PhysicalLogSize int64              `json:"PhysicalLogSize"`
	Progress        *TaskProgress      `json:"Progress"`
	Links           map[string]string  `json:"Links"`
}

func GetDetails added in v2.64.3

func GetDetails(client newclient.Client, spaceID string, taskID string) (*TaskDetailsResource, error)

Get task detals by Id

type TaskProgress added in v2.64.3

type TaskProgress struct {
	ProgressPercentage     int    `json:"ProgressPercentage"`
	EstimatedTimeRemaining string `json:"EstimatedTimeRemaining"`
}

type TaskService

type TaskService struct {
	services.Service
	// contains filtered or unexported fields
}

func NewTaskService

func NewTaskService(sling *sling.Sling, uriTemplate string, taskTypesPath string) *TaskService

func (*TaskService) Add

func (s *TaskService) Add(task *Task) (*Task, error)

Add creates a new task.

func (*TaskService) Get

func (s *TaskService) Get(tasksQuery TasksQuery) (*resources.Resources[*Task], error)

Get returns a collection of tasks based on the criteria defined by its input query parameter. If an error occurs, an empty collection is returned along with the associated error.

type TasksQuery

type TasksQuery struct {
	Environment             string   `uri:"environment,omitempty" url:"environment,omitempty"`
	HasPendingInterruptions bool     `uri:"hasPendingInterruptions,omitempty" url:"hasPendingInterruptions,omitempty"`
	HasWarningsOrErrors     bool     `uri:"hasWarningsOrErrors,omitempty" url:"hasWarningsOrErrors,omitempty"`
	IDs                     []string `uri:"ids,omitempty" url:"ids,omitempty"`
	IncludeSystem           bool     `uri:"includeSystem,omitempty" url:"includeSystem,omitempty"`
	IsActive                bool     `uri:"active,omitempty" url:"active,omitempty"`
	IsRunning               bool     `uri:"running,omitempty" url:"running,omitempty"`
	Name                    string   `uri:"name,omitempty" url:"name,omitempty"`
	Node                    string   `uri:"node,omitempty" url:"node,omitempty"`
	PartialName             string   `uri:"partialName,omitempty" url:"partialName,omitempty"`
	Project                 string   `uri:"project,omitempty" url:"project,omitempty"`
	Runbook                 string   `uri:"runbook,omitempty" url:"runbook,omitempty"`
	Skip                    int      `uri:"skip,omitempty" url:"skip,omitempty"`
	Spaces                  []string `uri:"spaces,omitempty" url:"spaces,omitempty"`
	States                  []string `uri:"states,omitempty" url:"states,omitempty"`
	Take                    int      `uri:"take,omitempty" url:"take,omitempty"`
	Tenant                  string   `uri:"tenant,omitempty" url:"tenant,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL