swarmingv2

package
v0.0.0-...-b04d5d2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BotDimensionsToStringMap

func BotDimensionsToStringMap(dims []*apipb.StringListPair) map[string][]string

BotDimensionsToStringMap converts Swarming bot dimensions as represented in the Swarming API to a map[string][]string.

func BotDimensionsToStringSlice

func BotDimensionsToStringSlice(dims []*apipb.StringListPair) []string

BotDimensionsToStringSlice converts Swarming bot dimensions as represented in the Swarming API to a []string.

func ConvertCIPDInput

func ConvertCIPDInput(pkgs []*cipd.Package) *apipb.CipdInput

ConvertCIPDInput converts a slice of cipd.Package to a SwarmingRpcsCipdInput.

func DefaultPRPCClient

func DefaultPRPCClient(httpClient *http.Client, swarmingServer string) *prpc.Client

DefaultPRPCClient returns a prpc.Client using default settings.

func DeleteBots

func DeleteBots(ctx context.Context, c apipb.BotsClient, botIds []string) error

DeleteBots performs multiple calls to DeleteBot in parallel.

func GetRequestMetadataForTasks

func GetRequestMetadataForTasks(ctx context.Context, c apipb.TasksClient, tasks []*apipb.TaskResultResponse) ([]*apipb.TaskRequestMetadataResponse, error)

GetRequestMetadataForTasks returns the apipb.TaskRequestMetadataResponse for each of the given apipb.TaskResultResponses.

func GetTaskRequestProperties

func GetTaskRequestProperties(t *apipb.TaskRequestResponse) *apipb.TaskProperties

GetTaskRequestProperties returns the SwarmingRpcsTaskProperties for the given SwarmingRpcsTaskRequestMetadata.

func ListBotsForPool

func ListBotsForPool(ctx context.Context, c apipb.BotsClient, pool string) ([]*apipb.BotInfo, error)

ListBotsForPool retrieves all of the bots in the given pool.

func ListBotsHelper

func ListBotsHelper(ctx context.Context, c apipb.BotsClient, req *apipb.BotsRequest) ([]*apipb.BotInfo, error)

ListBotsHelper makes multiple paginated requests to ListBots to retrieve all results.

func ListTaskRequestMetadataHelper

func ListTaskRequestMetadataHelper(ctx context.Context, c apipb.TasksClient, req *apipb.TasksWithPerfRequest) ([]*apipb.TaskRequestMetadataResponse, error)

ListTaskRequestMetadataHelper is like ListTasksHelper but retrieves the apipb.TaskRequestMetadataResponse for each of the task. This is significantly more expensive, so it should only be used where necessary.

func ListTasksHelper

ListTasksHelper makes multiple paginated requests to ListTasks to retrieve all results.

func MakeCASReference

func MakeCASReference(digest, casInstance string) (*apipb.CASReference, error)

MakeCASReference returns a CASReference which can be used as input to a Swarming task.

func RetryTask

RetryTask duplicates fields from the given request and triggers a new task as a retry of it.

func StringMapToBotDimensions

func StringMapToBotDimensions(dims map[string][]string) []*apipb.StringListPair

StringMapToBotDimensions converts Swarming bot dimensions from a map[string][]string to their Swarming API representation.

func StringMapToTaskDimensions

func StringMapToTaskDimensions(dims map[string]string) []*apipb.StringPair

StringMapToTaskDimensions converts Swarming task dimensions from a map[string]string to their Swarming API representation.

Types

type SwarmingV2Client

type SwarmingV2Client interface {
	apipb.BotsClient
	apipb.TasksClient
}

SwarmingV2Client wraps a Swarming BotsClient and TasksClient.

type WrappedClient

type WrappedClient struct {
	apipb.BotsClient
	apipb.TasksClient
}

WrappedClient implements SwarmingV2Client by wrapping a BotsClient and a TasksClient

func NewClient

func NewClient(prpcClient *prpc.Client) *WrappedClient

NewClient returns a SwarmingV2Client implementation.

func NewDefaultClient

func NewDefaultClient(httpClient *http.Client, swarmingServer string) *WrappedClient

NewDefaultClient returns a SwarmingV2Client implementation using default PRPC client settings.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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