api

package
v0.0.0-...-3c039c4 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package api defines the API for managing test and task scheduling on Devices.

Index

Constants

This section is empty.

Variables

View Source
var File_go_chromium_org_infra_libs_fleet_scheduling_api_task_scheduling_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CancelTasksRequest

type CancelTasksRequest struct {
	TaskIds []int64 `protobuf:"varint,2,rep,packed,name=task_ids,json=taskIds,proto3" json:"task_ids,omitempty"`
	// contains filtered or unexported fields
}

CancelTasksRequest is the request for the TaskSchedulingAPI.CancelTasks endpoint.

func (*CancelTasksRequest) Descriptor deprecated

func (*CancelTasksRequest) Descriptor() ([]byte, []int)

Deprecated: Use CancelTasksRequest.ProtoReflect.Descriptor instead.

func (*CancelTasksRequest) GetTaskIds

func (x *CancelTasksRequest) GetTaskIds() []int64

func (*CancelTasksRequest) ProtoMessage

func (*CancelTasksRequest) ProtoMessage()

func (*CancelTasksRequest) ProtoReflect

func (x *CancelTasksRequest) ProtoReflect() protoreflect.Message

func (*CancelTasksRequest) Reset

func (x *CancelTasksRequest) Reset()

func (*CancelTasksRequest) String

func (x *CancelTasksRequest) String() string

func (*CancelTasksRequest) Validate

func (r *CancelTasksRequest) Validate() error

Validate validates inputs of CancelTasksRequest.

type ScheduleTaskRequest

type ScheduleTaskRequest struct {

	// BuildBucket request to instantiate task.
	BuildbucketRequest *proto.ScheduleBuildRequest `protobuf:"bytes,2,opt,name=buildbucket_request,json=buildbucketRequest,proto3" json:"buildbucket_request,omitempty"`
	// Device name. Refers to the Swarming dut_name or hostname.
	DeviceName string `protobuf:"bytes,3,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"`
	// contains filtered or unexported fields
}

ScheduleTaskRequest is the request for the TaskSchedulingAPI.ScheduleTask endpoint.

func (*ScheduleTaskRequest) Descriptor deprecated

func (*ScheduleTaskRequest) Descriptor() ([]byte, []int)

Deprecated: Use ScheduleTaskRequest.ProtoReflect.Descriptor instead.

func (*ScheduleTaskRequest) GetBuildbucketRequest

func (x *ScheduleTaskRequest) GetBuildbucketRequest() *proto.ScheduleBuildRequest

func (*ScheduleTaskRequest) GetDeviceName

func (x *ScheduleTaskRequest) GetDeviceName() string

func (*ScheduleTaskRequest) ProtoMessage

func (*ScheduleTaskRequest) ProtoMessage()

func (*ScheduleTaskRequest) ProtoReflect

func (x *ScheduleTaskRequest) ProtoReflect() protoreflect.Message

func (*ScheduleTaskRequest) Reset

func (x *ScheduleTaskRequest) Reset()

func (*ScheduleTaskRequest) String

func (x *ScheduleTaskRequest) String() string

func (*ScheduleTaskRequest) Validate

func (r *ScheduleTaskRequest) Validate() error

Validate validates inputs of ScheduleTaskRequest.

type Task

type Task struct {
	Id  int64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	// contains filtered or unexported fields
}

Task contains a task ID and url provided by the backend.

func (*Task) Descriptor deprecated

func (*Task) Descriptor() ([]byte, []int)

Deprecated: Use Task.ProtoReflect.Descriptor instead.

func (*Task) GetId

func (x *Task) GetId() int64

func (*Task) GetUrl

func (x *Task) GetUrl() string

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) ProtoReflect

func (x *Task) ProtoReflect() protoreflect.Message

func (*Task) Reset

func (x *Task) Reset()

func (*Task) String

func (x *Task) String() string

type TaskSchedulingAPI

type TaskSchedulingAPI interface {
	// ScheduleTask schedules a task.
	ScheduleTask(context.Context, *ScheduleTaskRequest) (*Task, error)
	// CancelTasks cancels specified tasks.
	CancelTasks(context.Context, *CancelTasksRequest) error
	// ShouldUseDM determines if the caller should use Device Manager or not.
	ShouldUseDM(context.Context) (bool, error)
}

TaskSchedulingAPI is the Device management API that all providers implement.

Jump to

Keyboard shortcuts

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