client

package
v0.0.0-...-f72604a Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTaskPath

func CreateTaskPath() string

CreateTaskPath computes a request path to the create action of task.

func DeleteTaskPath

func DeleteTaskPath(id string) string

DeleteTaskPath computes a request path to the delete action of task.

func InspectTaskPath

func InspectTaskPath(id string) string

InspectTaskPath computes a request path to the inspect action of task.

func ListDatabindPath

func ListDatabindPath() string

ListDatabindPath computes a request path to the list action of databind.

func PingMonitoringPath

func PingMonitoringPath() string

PingMonitoringPath computes a request path to the ping action of monitoring.

func StatusSwarmPath

func StatusSwarmPath() string

StatusSwarmPath computes a request path to the status action of swarm.

func UploadDatabindPath

func UploadDatabindPath() string

UploadDatabindPath computes a request path to the upload action of databind.

Types

type AtqDatabindUpload

type AtqDatabindUpload struct {
	// Upload ID
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
}

User upload files response (default view)

Identifier: application/atq.databind.upload+json; view=default

type AtqDatabindUploadCollection

type AtqDatabindUploadCollection []*AtqDatabindUpload

AtqDatabindUploadCollection is the media type for an array of AtqDatabindUpload (default view)

Identifier: application/atq.databind.upload+json; type=collection; view=default

type AtqDatabindUploadError

type AtqDatabindUploadError struct {
	// Error message if errored
	Error *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
}

User upload files response (error view)

Identifier: application/atq.databind.upload+json; view=error

type AtqDatabindUploadErrorCollection

type AtqDatabindUploadErrorCollection []*AtqDatabindUploadError

AtqDatabindUploadCollection is the media type for an array of AtqDatabindUpload (error view)

Identifier: application/atq.databind.upload+json; type=collection; view=error

type AtqService

type AtqService struct {
	// ATQ Service internal alias
	Alias *string `form:"alias,omitempty" json:"alias,omitempty" xml:"alias,omitempty"`
	// ATQ FileID if exists
	FileID *string `form:"fileId,omitempty" json:"fileId,omitempty" xml:"fileId,omitempty"`
	// Docker Service internal identifier
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
}

Created Relevant Service Information (default view)

Identifier: application/atq.service+json; view=default

type AtqServiceFull

type AtqServiceFull struct {
	// ATQ Service internal alias
	Alias *string `form:"alias,omitempty" json:"alias,omitempty" xml:"alias,omitempty"`
	// Arguments passed to the containers
	Args []string `form:"args,omitempty" json:"args,omitempty" xml:"args,omitempty"`
	// ATQ FileID if exists
	FileID *string `form:"fileId,omitempty" json:"fileId,omitempty" xml:"fileId,omitempty"`
	// Docker Service internal identifier
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Docker Image Name
	Image *string `form:"image,omitempty" json:"image,omitempty" xml:"image,omitempty"`
	// Amount of Replicas
	Replicas *int `form:"replicas,omitempty" json:"replicas,omitempty" xml:"replicas,omitempty"`
	// Interactive Shell
	Tty *bool `form:"tty,omitempty" json:"tty,omitempty" xml:"tty,omitempty"`
}

Created Relevant Service Information (full view)

Identifier: application/atq.service+json; view=full

type AtqServiceMinimal

type AtqServiceMinimal struct {
	// Docker Service internal identifier
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
}

Created Relevant Service Information (minimal view)

Identifier: application/atq.service+json; view=minimal

type AtqSwarm

type AtqSwarm struct {
	JoinTokens *JoinTokens `form:"joinTokens,omitempty" json:"joinTokens,omitempty" xml:"joinTokens,omitempty"`
}

Swarm Details (default view)

Identifier: application/atq.swarm+json; view=default

type AtqSwarmError

type AtqSwarmError struct {
	// Swarm Error Message
	Error *string `form:"error,omitempty" json:"error,omitempty" xml:"error,omitempty"`
}

Swarm Details (error view)

Identifier: application/atq.swarm+json; view=error

type AtqTask

type AtqTask struct {
	// Task ID
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Status of the Task
	Status *string `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"`
}

Task description (default view)

Identifier: application/atq.task+json; view=default

func (*AtqTask) Validate

func (mt *AtqTask) Validate() (err error)

Validate validates the AtqTask media type instance.

type AtqTaskFull

type AtqTaskFull struct {
	// Manual delay between starting Master and Worker services
	Delay *int `form:"delay,omitempty" json:"delay,omitempty" xml:"delay,omitempty"`
	// Task ID
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Master Service definition
	Master *AtqService `form:"master,omitempty" json:"master,omitempty" xml:"master,omitempty"`
	// Status of the Task
	Status      *string      `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"`
	WaitCommand *WaitCommand `form:"waitCommand,omitempty" json:"waitCommand,omitempty" xml:"waitCommand,omitempty"`
	// Worker Service definition
	Worker *AtqService `form:"worker,omitempty" json:"worker,omitempty" xml:"worker,omitempty"`
}

Task description (full view)

Identifier: application/atq.task+json; view=full

func (*AtqTaskFull) Validate

func (mt *AtqTaskFull) Validate() (err error)

Validate validates the AtqTaskFull media type instance.

type Client

type Client struct {
	*goaclient.Client
	Encoder *goa.HTTPEncoder
	Decoder *goa.HTTPDecoder
}

Client is the ATQ - Director service client.

func New

func New(c goaclient.Doer) *Client

New instantiates the client.

func (*Client) CreateTask

func (c *Client) CreateTask(ctx context.Context, path string, payload *TaskPayload) (*http.Response, error)

Creates a new Task in the Swarm according with the config provided in the JSON body

func (*Client) DecodeAtqDatabindUpload

func (c *Client) DecodeAtqDatabindUpload(resp *http.Response) (*AtqDatabindUpload, error)

DecodeAtqDatabindUpload decodes the AtqDatabindUpload instance encoded in resp body.

func (*Client) DecodeAtqDatabindUploadCollection

func (c *Client) DecodeAtqDatabindUploadCollection(resp *http.Response) (AtqDatabindUploadCollection, error)

DecodeAtqDatabindUploadCollection decodes the AtqDatabindUploadCollection instance encoded in resp body.

func (*Client) DecodeAtqDatabindUploadError

func (c *Client) DecodeAtqDatabindUploadError(resp *http.Response) (*AtqDatabindUploadError, error)

DecodeAtqDatabindUploadError decodes the AtqDatabindUploadError instance encoded in resp body.

func (*Client) DecodeAtqDatabindUploadErrorCollection

func (c *Client) DecodeAtqDatabindUploadErrorCollection(resp *http.Response) (AtqDatabindUploadErrorCollection, error)

DecodeAtqDatabindUploadErrorCollection decodes the AtqDatabindUploadErrorCollection instance encoded in resp body.

func (*Client) DecodeAtqService

func (c *Client) DecodeAtqService(resp *http.Response) (*AtqService, error)

DecodeAtqService decodes the AtqService instance encoded in resp body.

func (*Client) DecodeAtqServiceFull

func (c *Client) DecodeAtqServiceFull(resp *http.Response) (*AtqServiceFull, error)

DecodeAtqServiceFull decodes the AtqServiceFull instance encoded in resp body.

func (*Client) DecodeAtqServiceMinimal

func (c *Client) DecodeAtqServiceMinimal(resp *http.Response) (*AtqServiceMinimal, error)

DecodeAtqServiceMinimal decodes the AtqServiceMinimal instance encoded in resp body.

func (*Client) DecodeAtqSwarm

func (c *Client) DecodeAtqSwarm(resp *http.Response) (*AtqSwarm, error)

DecodeAtqSwarm decodes the AtqSwarm instance encoded in resp body.

func (*Client) DecodeAtqSwarmError

func (c *Client) DecodeAtqSwarmError(resp *http.Response) (*AtqSwarmError, error)

DecodeAtqSwarmError decodes the AtqSwarmError instance encoded in resp body.

func (*Client) DecodeAtqTask

func (c *Client) DecodeAtqTask(resp *http.Response) (*AtqTask, error)

DecodeAtqTask decodes the AtqTask instance encoded in resp body.

func (*Client) DecodeAtqTaskFull

func (c *Client) DecodeAtqTaskFull(resp *http.Response) (*AtqTaskFull, error)

DecodeAtqTaskFull decodes the AtqTaskFull instance encoded in resp body.

func (*Client) DeleteTask

func (c *Client) DeleteTask(ctx context.Context, path string) (*http.Response, error)

Deletes the Task specified and its components

func (*Client) InspectTask

func (c *Client) InspectTask(ctx context.Context, path string) (*http.Response, error)

Get Task's details

func (*Client) ListDatabind

func (c *Client) ListDatabind(ctx context.Context, path string) (*http.Response, error)

List of uploaded and available files

func (*Client) NewCreateTaskRequest

func (c *Client) NewCreateTaskRequest(ctx context.Context, path string, payload *TaskPayload) (*http.Request, error)

NewCreateTaskRequest create the request corresponding to the create action endpoint of the task resource.

func (*Client) NewDeleteTaskRequest

func (c *Client) NewDeleteTaskRequest(ctx context.Context, path string) (*http.Request, error)

NewDeleteTaskRequest create the request corresponding to the delete action endpoint of the task resource.

func (*Client) NewInspectTaskRequest

func (c *Client) NewInspectTaskRequest(ctx context.Context, path string) (*http.Request, error)

NewInspectTaskRequest create the request corresponding to the inspect action endpoint of the task resource.

func (*Client) NewListDatabindRequest

func (c *Client) NewListDatabindRequest(ctx context.Context, path string) (*http.Request, error)

NewListDatabindRequest create the request corresponding to the list action endpoint of the databind resource.

func (*Client) NewPingMonitoringRequest

func (c *Client) NewPingMonitoringRequest(ctx context.Context, path string) (*http.Request, error)

NewPingMonitoringRequest create the request corresponding to the ping action endpoint of the monitoring resource.

func (*Client) NewStatusSwarmRequest

func (c *Client) NewStatusSwarmRequest(ctx context.Context, path string) (*http.Request, error)

NewStatusSwarmRequest create the request corresponding to the status action endpoint of the swarm resource.

func (*Client) NewUploadDatabindRequest

func (c *Client) NewUploadDatabindRequest(ctx context.Context, path string) (*http.Request, error)

NewUploadDatabindRequest create the request corresponding to the upload action endpoint of the databind resource.

func (*Client) PingMonitoring

func (c *Client) PingMonitoring(ctx context.Context, path string) (*http.Response, error)

Endpoint for pinging and healthcheck purposes

func (*Client) StatusSwarm

func (c *Client) StatusSwarm(ctx context.Context, path string) (*http.Response, error)

Response with the details of the swarm

func (*Client) UploadDatabind

func (c *Client) UploadDatabind(ctx context.Context, path string) (*http.Response, error)

Upload new zipped file for later usage with a Task

type JoinTokens

type JoinTokens struct {
	Manager *string `form:"manager,omitempty" json:"manager,omitempty" xml:"manager,omitempty"`
	Worker  *string `form:"worker,omitempty" json:"worker,omitempty" xml:"worker,omitempty"`
}

Docker Swarm Join Tokens

type ServicePayload

type ServicePayload struct {
	// Service alias, this will identify the Service
	Alias string `form:"alias" json:"alias" xml:"alias"`
	// Arguments to be passed to the container
	Args []string `form:"args,omitempty" json:"args,omitempty" xml:"args,omitempty"`
	// Environment variables list
	Environment []string `form:"environment,omitempty" json:"environment,omitempty" xml:"environment,omitempty"`
	// ID of the Zipped contents that will be mounted and accesible inside the container, PREVIOUSLY UPLOADED
	Fileid *string `form:"fileid,omitempty" json:"fileid,omitempty" xml:"fileid,omitempty"`
	// Docker base image to attach to Service
	Image string `form:"image" json:"image" xml:"image"`
	// Amount of replicas to be deployed. (1 by default)
	Replicas *int `form:"replicas,omitempty" json:"replicas,omitempty" xml:"replicas,omitempty"`
	// Interactive shell requirement
	Tty *bool `form:"tty,omitempty" json:"tty,omitempty" xml:"tty,omitempty"`
}

ServicePayload user type.

func (*ServicePayload) Validate

func (ut *ServicePayload) Validate() (err error)

Validate validates the ServicePayload type instance.

type TaskPayload

type TaskPayload struct {
	Delay  *int            `form:"delay,omitempty" json:"delay,omitempty" xml:"delay,omitempty"`
	Master *ServicePayload `form:"master" json:"master" xml:"master"`
	// Task Name Identifier
	Name        string          `form:"name" json:"name" xml:"name"`
	WaitCommand *WaitCommand    `form:"waitCommand,omitempty" json:"waitCommand,omitempty" xml:"waitCommand,omitempty"`
	Worker      *ServicePayload `form:"worker" json:"worker" xml:"worker"`
}

TaskPayload user type.

func (*TaskPayload) Validate

func (ut *TaskPayload) Validate() (err error)

Validate validates the TaskPayload type instance.

type WaitCommand

type WaitCommand struct {
	// Command to be executed
	Command *string `form:"command,omitempty" json:"command,omitempty" xml:"command,omitempty"`
	// Result expected
	ExpectedResult *string `form:"expectedResult,omitempty" json:"expectedResult,omitempty" xml:"expectedResult,omitempty"`
	// Maximum seconds to wait until succesfull response
	Timeout *int `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
}

Definition of a command to be executed

Jump to

Keyboard shortcuts

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