singularity

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: MIT Imports: 4 Imported by: 3

README

go-singularity

Singularity API client, originally for use with Sous. Perhaps useful to others.

Components:

  • jq-scripts/ and process_api.sh are helpers to clean up the Sigularity JSON; Singularity's generated JSON files are... not completely valid Swagger, so they need a little massage before they're used.

Development:

The vast majority of this code is generated using the swagger-client-maker. To install the tool:

Singularity

Should you need to build Singularity, the incantation is: mvn compile -Dbasepom.check.fail-extended=false

Quickstart
go get github.com/opentable/swaggering/cmd/swagger-client-maker

mkdir dtos
swagger-client-maker --import-name=github.com/opentable/go-singularity --client-package=singularity api-docs/ .

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	swaggering.Requester
}

Client is the top level singularity client. Wraps the swaggering GenericClient

func NewClient

func NewClient(apiBase string, loggerOpt ...swaggering.LogSink) (client *Client)

NewClient builds a new Client

func NewDummyClient

func NewDummyClient(apiBase string) (*Client, swaggering.DummyControl)

NewDummyClient builds a client/control pair for testing

func (*Client) AddWebhook

func (client *Client) AddWebhook(body *dtos.SingularityWebhook) (response string, err error)

func (*Client) Bounce

func (client *Client) Bounce(requestId string, body *dtos.SingularityBounceRequest) (response *dtos.SingularityRequestParent, err error)

func (*Client) Browse

func (client *Client) Browse(taskId string, path string) (response *dtos.SingularitySandbox, err error)

func (*Client) CancelDeploy

func (client *Client) CancelDeploy(requestId string, deployId string) (response *dtos.SingularityRequestParent, err error)

func (*Client) CreatePriorityFreeze

func (client *Client) CreatePriorityFreeze(body *dtos.SingularityPriorityFreeze) (response *dtos.SingularityPriorityFreezeParent, err error)

DeleteActivePriorityFreeze is invalid

func (*Client) DeleteExpiringBounce

func (client *Client) DeleteExpiringBounce(requestId string) (response *dtos.SingularityRequestParent, err error)

func (*Client) DeleteExpiringPause

func (client *Client) DeleteExpiringPause(requestId string) (response *dtos.SingularityRequestParent, err error)

func (*Client) DeleteExpiringScale

func (client *Client) DeleteExpiringScale(requestId string) (response *dtos.SingularityRequestParent, err error)

func (*Client) DeleteExpiringSkipHealthchecks

func (client *Client) DeleteExpiringSkipHealthchecks(requestId string) (response *dtos.SingularityRequestParent, err error)

func (*Client) DeleteExpiringSkipHealthchecksDeprecated

func (client *Client) DeleteExpiringSkipHealthchecksDeprecated(requestId string) (response *dtos.SingularityRequestParent, err error)

func (*Client) DeleteRequest

func (client *Client) DeleteRequest(requestId string, body *dtos.SingularityDeleteRequestRequest) (response *dtos.SingularityRequest, err error)

func (*Client) DeleteWebhook

func (client *Client) DeleteWebhook(webhookId string) (response string, err error)

func (*Client) DeleteWebhookDeprecated

func (client *Client) DeleteWebhookDeprecated(webhookId string) (response string, err error)

func (*Client) Deploy

func (client *Client) Deploy(body *dtos.SingularityDeployRequest) (response *dtos.SingularityRequestParent, err error)

func (*Client) ExitCooldown

func (client *Client) ExitCooldown(requestId string, body *dtos.SingularityExitCooldownRequest) (response *dtos.SingularityRequestParent, err error)

func (*Client) GetActiveDeployTasks

func (client *Client) GetActiveDeployTasks(requestId string, deployId string) (response dtos.SingularityTaskIdHistoryList, err error)

func (*Client) GetActivePriorityFreeze

func (client *Client) GetActivePriorityFreeze() (response *dtos.SingularityPriorityFreezeParent, err error)

func (*Client) GetActiveRequests

func (client *Client) GetActiveRequests(useWebCache bool) (response dtos.SingularityRequestParentList, err error)

func (*Client) GetActiveTask

func (client *Client) GetActiveTask(taskId string) (response *dtos.SingularityTask, err error)

func (*Client) GetActiveTasks

func (client *Client) GetActiveTasks(useWebCache bool) (response dtos.SingularityTaskList, err error)

func (*Client) GetActiveWebhooks

func (client *Client) GetActiveWebhooks() (response dtos.SingularityWebhookList, err error)

func (*Client) GetCleaningTasks

func (client *Client) GetCleaningTasks(useWebCache bool) (response dtos.SingularityTaskCleanupList, err error)

func (*Client) GetCleanupRequests

func (client *Client) GetCleanupRequests() (response dtos.SingularityRequestCleanupList, err error)

func (*Client) GetCooldownRequests

func (client *Client) GetCooldownRequests(useWebCache bool) (response dtos.SingularityRequestParentList, err error)

func (*Client) GetDeploy

func (client *Client) GetDeploy(requestId string, deployId string) (response *dtos.SingularityDeployHistory, err error)

func (*Client) GetDeploys

func (client *Client) GetDeploys(requestId string, count int32, page int32) (response dtos.SingularityDeployHistoryList, err error)

func (*Client) GetDeploysWithMetadata

func (client *Client) GetDeploysWithMetadata(requestId string, count int32, page int32) (response dtos.SingularityDeployHistoryList, err error)

func (*Client) GetExpiringRackStateChanges

func (client *Client) GetExpiringRackStateChanges() (response dtos.SingularityExpiringMachineStateList, err error)

DeleteExpiringRackStateChange is invalid

func (*Client) GetExpiringSlaveStateChanges

func (client *Client) GetExpiringSlaveStateChanges() (response dtos.SingularityExpiringMachineStateList, err error)

DecommissionSlave is invalid FreezeSlave is invalid DeleteExpiringSlaveStateChange is invalid

func (*Client) GetFinishedRequests

func (client *Client) GetFinishedRequests(useWebCache bool) (response dtos.SingularityRequestParentList, err error)

func (*Client) GetHistoryForTask

func (client *Client) GetHistoryForTask(taskId string) (response *dtos.SingularityTaskHistory, err error)

func (*Client) GetInactiveDeployTasks

func (client *Client) GetInactiveDeployTasks(requestId string, deployId string, count int32, page int32) (response dtos.SingularityTaskIdHistoryList, err error)

func (*Client) GetInactiveDeployTasksWithMetadata

func (client *Client) GetInactiveDeployTasksWithMetadata(requestId string, deployId string, count int32, page int32) (response dtos.SingularityTaskIdHistoryList, err error)

func (*Client) GetKilledTasks

func (client *Client) GetKilledTasks() (response dtos.SingularityKilledTaskIdRecordList, err error)

func (*Client) GetLbCleanupRequests

func (client *Client) GetLbCleanupRequests(useWebCache bool) (response swaggering.StringList, err error)

func (*Client) GetLbCleanupTasks

func (client *Client) GetLbCleanupTasks() (response dtos.SingularityTaskIdList, err error)

func (*Client) GetOverProvisionedRequestIds

func (client *Client) GetOverProvisionedRequestIds(skipCache bool) (response swaggering.StringList, err error)

func (*Client) GetPaginatedS3Logs

func (client *Client) GetPaginatedS3Logs(body *dtos.SingularityS3SearchRequest) (response dtos.SingularityS3LogList, err error)

func (*Client) GetPausedRequests

func (client *Client) GetPausedRequests(useWebCache bool) (response dtos.SingularityRequestParentList, err error)

func (*Client) GetPendingDeploys

func (client *Client) GetPendingDeploys() (response dtos.SingularityPendingDeployList, err error)

func (*Client) GetPendingRequests

func (client *Client) GetPendingRequests() (response dtos.SingularityPendingRequestList, err error)

func (*Client) GetPendingTask

func (client *Client) GetPendingTask(pendingTaskId string) (response *dtos.SingularityTaskRequest, err error)

func (*Client) GetQueuedDeployUpdates

func (client *Client) GetQueuedDeployUpdates(webhookId string) (response dtos.SingularityDeployUpdateList, err error)

func (*Client) GetQueuedDeployUpdatesDeprecated

func (client *Client) GetQueuedDeployUpdatesDeprecated(webhookId string) (response dtos.SingularityDeployUpdateList, err error)

func (*Client) GetQueuedRequestUpdates

func (client *Client) GetQueuedRequestUpdates(webhookId string) (response dtos.SingularityRequestHistoryList, err error)

func (*Client) GetQueuedRequestUpdatesDeprecated

func (client *Client) GetQueuedRequestUpdatesDeprecated(webhookId string) (response dtos.SingularityRequestHistoryList, err error)

func (*Client) GetQueuedTaskUpdates

func (client *Client) GetQueuedTaskUpdates(webhookId string) (response dtos.SingularityTaskHistoryUpdateList, err error)

func (*Client) GetQueuedTaskUpdatesDeprecated

func (client *Client) GetQueuedTaskUpdatesDeprecated(webhookId string) (response dtos.SingularityTaskHistoryUpdateList, err error)

func (*Client) GetRackHistory

func (client *Client) GetRackHistory(rackId string) (response dtos.SingularityMachineStateHistoryUpdateList, err error)

func (*Client) GetRacks

func (client *Client) GetRacks(state string) (response dtos.SingularityRackList, err error)

func (*Client) GetRecentCommandLineArgs

func (client *Client) GetRecentCommandLineArgs(requestId string, count int32) (response *dtos.Set, err error)

func (*Client) GetRequest

func (client *Client) GetRequest(requestId string, useWebCache bool) (response *dtos.SingularityRequestParent, err error)

func (*Client) GetRequestGroup

func (client *Client) GetRequestGroup(requestGroupId string) (response *dtos.SingularityRequestGroup, err error)

func (*Client) GetRequestGroupIds

func (client *Client) GetRequestGroupIds(useWebCache bool) (response dtos.SingularityRequestGroupList, err error)

DeleteRequestGroup is invalid

func (*Client) GetRequestHistoryForRequest

func (client *Client) GetRequestHistoryForRequest(requestId string, count int32, page int32) (response dtos.SingularityRequestHistoryList, err error)

func (*Client) GetRequestHistoryForRequestLike

func (client *Client) GetRequestHistoryForRequestLike(requestIdLike string, count int32, page int32, useWebCache bool) (response swaggering.StringList, err error)

func (*Client) GetRequestHistoryForRequestWithMetadata

func (client *Client) GetRequestHistoryForRequestWithMetadata(requestId string, count int32, page int32) (response dtos.SingularityRequestHistoryList, err error)

func (*Client) GetRequests

func (client *Client) GetRequests(useWebCache bool) (response dtos.SingularityRequestParentList, err error)

func (*Client) GetS3LogsForDeploy

func (client *Client) GetS3LogsForDeploy(requestId string, deployId string, start int64, end int64, excludeMetadata bool, list bool, maxPerPage int32) (response dtos.SingularityS3LogList, err error)

func (*Client) GetS3LogsForRequest

func (client *Client) GetS3LogsForRequest(requestId string, start int64, end int64, excludeMetadata bool, list bool, maxPerPage int32) (response dtos.SingularityS3LogList, err error)

func (*Client) GetS3LogsForTask

func (client *Client) GetS3LogsForTask(taskId string, start int64, end int64, excludeMetadata bool, list bool) (response dtos.SingularityS3LogList, err error)

func (*Client) GetScheduledTaskIds

func (client *Client) GetScheduledTaskIds(useWebCache bool) (response dtos.SingularityPendingTaskIdList, err error)

func (*Client) GetScheduledTasks

func (client *Client) GetScheduledTasks(useWebCache bool) (response dtos.SingularityTaskRequestList, err error)

func (*Client) GetScheduledTasksForRequest

func (client *Client) GetScheduledTasksForRequest(requestId string, useWebCache bool) (response dtos.SingularityTaskRequestList, err error)

func (*Client) GetSlave

func (client *Client) GetSlave(slaveId string) (response *dtos.SingularitySlave, err error)

RemoveSlave is invalid

func (*Client) GetSlaveHistory

func (client *Client) GetSlaveHistory(slaveId string) (response dtos.SingularityMachineStateHistoryUpdateList, err error)

func (*Client) GetSlaves

func (client *Client) GetSlaves(state string) (response dtos.SingularitySlaveList, err error)

ReactivateSlave is invalid

func (*Client) GetState

func (client *Client) GetState(skipCache bool, includeRequestIds bool) (response *dtos.SingularityState, err error)

func (*Client) GetTaskByRunId

func (client *Client) GetTaskByRunId(requestId string, runId string) (response *dtos.SingularityTaskId, err error)

func (*Client) GetTaskCleanup

func (client *Client) GetTaskCleanup(taskId string) (response *dtos.SingularityTaskCleanup, err error)

func (*Client) GetTaskHistory

func (client *Client) GetTaskHistory(requestId string, deployId string, runId string, host string, lastTaskStatus string, startedBefore int64, startedAfter int64, updatedBefore int64, updatedAfter int64, orderDirection string, count int32, page int32) (response dtos.SingularityTaskIdHistoryList, err error)

func (*Client) GetTaskHistoryForActiveRequest

func (client *Client) GetTaskHistoryForActiveRequest(requestId string) (response dtos.SingularityTaskIdHistoryList, err error)

func (*Client) GetTaskHistoryForRequest

func (client *Client) GetTaskHistoryForRequest(requestId string, deployId string, runId string, host string, lastTaskStatus string, startedBefore int64, startedAfter int64, updatedBefore int64, updatedAfter int64, orderDirection string, count int32, page int32) (response dtos.SingularityTaskIdHistoryList, err error)

func (*Client) GetTaskHistoryForRequestAndRunId

func (client *Client) GetTaskHistoryForRequestAndRunId(requestId string, runId string) (response *dtos.SingularityTaskIdHistory, err error)

func (*Client) GetTaskHistoryForRequestWithMetadata

func (client *Client) GetTaskHistoryForRequestWithMetadata(requestId string, deployId string, runId string, host string, lastTaskStatus string, startedBefore int64, startedAfter int64, updatedBefore int64, updatedAfter int64, orderDirection string, count int32, page int32) (response dtos.SingularityTaskIdHistoryList, err error)

func (*Client) GetTaskHistoryWithMetadata

func (client *Client) GetTaskHistoryWithMetadata(requestId string, deployId string, runId string, host string, lastTaskStatus string, startedBefore int64, startedAfter int64, updatedBefore int64, updatedAfter int64, orderDirection string, count int32, page int32) (response dtos.SingularityTaskIdHistoryList, err error)

func (*Client) GetTaskReconciliationStatistics

func (client *Client) GetTaskReconciliationStatistics() (response *dtos.SingularityTaskReconciliationStatistics, err error)

func (*Client) GetTaskStatistics

func (client *Client) GetTaskStatistics(taskId string) (response *dtos.MesosTaskStatisticsObject, err error)

func (*Client) GetTasksForSlave

func (client *Client) GetTasksForSlave(slaveId string, useWebCache bool) (response dtos.SingularityTaskList, err error)

func (*Client) GetUnderProvisionedRequestIds

func (client *Client) GetUnderProvisionedRequestIds(skipCache bool) (response swaggering.StringList, err error)

func (*Client) GetWebhooksWithQueueSize

func (client *Client) GetWebhooksWithQueueSize() (response dtos.SingularityWebhookSummaryList, err error)

func (*Client) KillTask

func (client *Client) KillTask(taskId string, body *dtos.SingularityKillTaskRequest) (response *dtos.SingularityTaskCleanup, err error)

func (*Client) Pause

func (client *Client) Pause(requestId string, body *dtos.SingularityPauseRequest) (response *dtos.SingularityRequestParent, err error)

func (*Client) PostRequest

func (client *Client) PostRequest(body *dtos.SingularityRequest) (response *dtos.SingularityRequestParent, err error)

func (*Client) Read

func (client *Client) Read(taskId string, path string, grep string, offset int64, length int64) (response *dtos.MesosFileChunkObject, err error)

func (*Client) RunShellCommand

func (client *Client) RunShellCommand(taskId string, body *dtos.SingularityShellCommand) (response *dtos.SingularityTaskShellCommandRequest, err error)

PostTaskMetadata is invalid

func (*Client) SaveRequestGroup

func (client *Client) SaveRequestGroup(body *dtos.SingularityRequestGroup) (response *dtos.SingularityRequestGroup, err error)

func (*Client) Scale

func (client *Client) Scale(requestId string, body *dtos.SingularityScaleRequest) (response *dtos.SingularityRequestParent, err error)

func (*Client) ScheduleImmediately

func (client *Client) ScheduleImmediately(requestId string, body *dtos.SingularityRunNowRequest) (response *dtos.SingularityRequestParent, err error)

func (*Client) SkipHealthchecks

func (client *Client) SkipHealthchecks(requestId string, body *dtos.SingularitySkipHealthchecksRequest) (response *dtos.SingularityRequestParent, err error)

func (*Client) SkipHealthchecksDeprecated

func (client *Client) SkipHealthchecksDeprecated(requestId string, body *dtos.SingularitySkipHealthchecksRequest) (response *dtos.SingularityRequestParent, err error)

func (*Client) Unpause

func (client *Client) Unpause(requestId string, body *dtos.SingularityUnpauseRequest) (response *dtos.SingularityRequestParent, err error)

func (*Client) UpdatePendingDeploy

func (client *Client) UpdatePendingDeploy(body *dtos.SingularityUpdatePendingDeployRequest) (response *dtos.SingularityRequestParent, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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