endpoint

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

nolint: dupl

nolint: dupl

nolint: dupl

nolint: dupl

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) endpoint.Middleware

LoggingMiddleware returns an endpoint middleware that logs the duration of each invocation, and the resulting error, if any. This is a transport-domain logging

func MakeHealthzEndpoint

func MakeHealthzEndpoint(s service.Service) endpoint.Endpoint

MakeHealthzEndpoint returns an endpoint via the passed service

func MakeInfoEndpoint

func MakeInfoEndpoint(s service.Service) endpoint.Endpoint

MakeInfoEndpoint returns an endpoint via the passed service

func MakeOpenAPIEndpoint added in v0.4.0

func MakeOpenAPIEndpoint(s service.Service) endpoint.Endpoint

MakeOpenAPIEndpoint returns an endpoint via the passed service

func MakeReadyzEndpoint

func MakeReadyzEndpoint(s service.Service) endpoint.Endpoint

MakeReadyzEndpoint returns an endpoint via the passed service

func MakeRolesListEndpoint

func MakeRolesListEndpoint(s service.Service) endpoint.Endpoint

MakeRolesListEndpoint returns an endpoint via the passed service

func MakeTaskInfoEndpoint

func MakeTaskInfoEndpoint(s service.Service) endpoint.Endpoint

MakeTaskInfoEndpoint returns an endpoint via the passed service

func MakeVMAddRoleEndpoint

func MakeVMAddRoleEndpoint(s service.Service) endpoint.Endpoint

MakeVMAddRoleEndpoint returns an endpoint via the passed service

func MakeVMDeleteEndpoint added in v0.3.0

func MakeVMDeleteEndpoint(s service.Service) endpoint.Endpoint

MakeVMDeleteEndpoint deletes a Virtual Machine

func MakeVMDeployEndpoint

func MakeVMDeployEndpoint(s service.Service, logger log.Logger) endpoint.Endpoint

MakeVMDeployEndpoint returns an endpoint via the passed service

func MakeVMFindEndpoint

func MakeVMFindEndpoint(s service.Service) endpoint.Endpoint

MakeVMFindEndpoint returns an endpoint via the passed service

func MakeVMInfoEndpoint

func MakeVMInfoEndpoint(s service.Service) endpoint.Endpoint

MakeVMInfoEndpoint returns an endpoint via the passed service

func MakeVMListEndpoint

func MakeVMListEndpoint(s service.Service) endpoint.Endpoint

MakeVMListEndpoint returns an endpoint via the passed service

func MakeVMRestoreFromSnapshotEndpoint

func MakeVMRestoreFromSnapshotEndpoint(s service.Service) endpoint.Endpoint

MakeVMRestoreFromSnapshotEndpoint creates VM snapshot

func MakeVMRolesListEndpoint

func MakeVMRolesListEndpoint(s service.Service) endpoint.Endpoint

MakeVMRolesListEndpoint returns an endpoint via the passed service

func MakeVMSnapshotCreateEndpoint

func MakeVMSnapshotCreateEndpoint(s service.Service) endpoint.Endpoint

MakeVMSnapshotCreateEndpoint creates VM snapshot

func MakeVMSnapshotDeleteEndpoint

func MakeVMSnapshotDeleteEndpoint(s service.Service) endpoint.Endpoint

MakeVMSnapshotDeleteEndpoint returns an endpoint via the passed service

func MakeVMSnapshotsListEndpoint

func MakeVMSnapshotsListEndpoint(s service.Service) endpoint.Endpoint

MakeVMSnapshotsListEndpoint returns an endpoint via the passed service

Types

type ComputerResources

type ComputerResources struct {
	Path string `json:"path"`
	Type string `json:"type"`
}

type Datastores

type Datastores struct {
	Type  string
	Names []string
}

type Endpoints

type Endpoints struct {
	InfoEndpoint endpoint.Endpoint

	HealthzEndpoint endpoint.Endpoint
	ReadyzEndpoint  endpoint.Endpoint

	VMListEndpoint   endpoint.Endpoint
	VMInfoEndpoint   endpoint.Endpoint
	VMDeleteEndpoint endpoint.Endpoint
	VMFindEndpoint   endpoint.Endpoint

	VMDeployEndpoint endpoint.Endpoint

	VMSnapshotsListEndpoint       endpoint.Endpoint
	VMSnapshotCreateEndpoint      endpoint.Endpoint
	VMSnapshotDeleteEndpoint      endpoint.Endpoint
	VMRestoreFromSnapshotEndpoint endpoint.Endpoint

	VMRolesListEndpoint endpoint.Endpoint
	VMAddRoleEndpoint   endpoint.Endpoint

	RoleListEndpoint endpoint.Endpoint

	TaskInfoEndpoint endpoint.Endpoint

	OpenAPIEndpoint endpoint.Endpoint
}

Endpoints collects all of the endpoints that compose the Service.

func New

func New(s service.Service, logger log.Logger) Endpoints

New returns an Endpoints struct where each endpoint invokes the corresponding method on the provided service.

type Failer

type Failer interface {
	Failed() error
}

Failer is an interface that should be implemented by response types. Response encoders can check if responses are Failer, and if so they've failed, and if so encode them using a separate write path based on the error.

type InfoResponse

type InfoResponse struct {
	BuildTime string `json:"build_time"`
	Commit    string `json:"commit"`
}

InfoResponse is the Service build information

type OpenAPIResponse added in v0.4.0

type OpenAPIResponse struct {
	Spec []byte
	Err  error `json:"error,omitempty"`
}

OpenAPIResponse serves OpenAPI specification

func (OpenAPIResponse) Failed added in v0.4.0

func (r OpenAPIResponse) Failed() error

Failed implements Failer

type RoleListRequest

type RoleListRequest struct{}

RoleListRequest collects the request parameters for the RoleList method

type RoleListResponse

type RoleListResponse struct {
	Roles []types.Role `json:"roles"`
	Err   error        `json:"error,omitempty"`
}

RoleListResponse collects the response values for the RoleList method

func (RoleListResponse) Failed

func (r RoleListResponse) Failed() error

Failed implements Failer

type TaskInfoRequest

type TaskInfoRequest struct {
	TaskID string
}

TaskInfoRequest collects the request parameters for the TaskInfo method

type TaskInfoResponse

type TaskInfoResponse struct {
	Err    error `json:"error,omitempty"`
	Status map[string]interface{}
}

TaskInfoResponse collects the response values for the TaskInfo method

func (TaskInfoResponse) Failed

func (r TaskInfoResponse) Failed() error

Failed implements Failer

type VMAddRoleRequest

type VMAddRoleRequest struct {
	UUID       string
	Datacenter string `json:"datacenter"`
	Principal  string `json:"principal"`
	RoleID     int32  `json:"role_id"`
}

VMAddRoleRequest collects the request parameters for the VMAddRole method

type VMAddRoleResponse

type VMAddRoleResponse struct {
	Err error `json:"error,omitempty"`
}

VMAddRoleResponse collects the response values for the VMAddRole method

func (VMAddRoleResponse) Failed

func (r VMAddRoleResponse) Failed() error

Failed implements Failer

type VMDeleteRequest added in v0.3.0

type VMDeleteRequest struct {
	UUID       string
	Datacenter string `json:"datacenter,omitempty"`
}

VMDeleteRequest collects the request parameters for the VMDelete method

type VMDeleteResponse added in v0.3.0

type VMDeleteResponse struct {
	Err error `json:"error,omitempty"`
}

VMDeleteResponse collects the response values for the VMDelete method

func (VMDeleteResponse) Failed added in v0.3.0

func (r VMDeleteResponse) Failed() error

Failed implements Failer

type VMDeployRequest

type VMDeployRequest struct {
	Name              string            `json:"name"`
	OVAURL            string            `json:"ova_url"`
	Datacenter        string            `json:"datacenter,omitempty"`
	Folder            string            `json:"folder,omitempty"`
	Annotation        string            `json:"annotation"`
	Networks          map[string]string `json:"networks,omitempty"`
	Datastores        `json:"datastores"`
	ComputerResources `json:"computer_resources"`
}

VMDeployRequest collects the request parameters for the VMDeploy method

func (*VMDeployRequest) String

func (r *VMDeployRequest) String() string

type VMDeployResponse

type VMDeployResponse struct {
	JID string `json:"task_id,omitempty"`
	Err error  `json:"error,omitempty"`
}

VMDeployResponse fields

func (VMDeployResponse) Failed

func (r VMDeployResponse) Failed() error

Failed implements Failer

type VMFindRequest

type VMFindRequest struct {
	Path       string
	Datacenter string
}

VMFindRequest collects the request parameters for the VMFind method

type VMFindResponse

type VMFindResponse struct {
	*types.VMFound
	Err error `json:"error,omitempty"`
}

VMFindResponse collects the response values for the VMFind method

func (VMFindResponse) Failed

func (r VMFindResponse) Failed() error

Failed implements Failer

type VMInfoRequest

type VMInfoRequest struct {
	UUID       string
	Datacenter string
}

VMInfoRequest collects the request parameters for the VMInfo method

type VMInfoResponse

type VMInfoResponse struct {
	Summary *types.VMSummary `json:"summary,omitempty"`
	Err     error            `json:"error,omitempty"`
}

VMInfoResponse collects the response values for the VMInfo method

func (VMInfoResponse) Failed

func (r VMInfoResponse) Failed() error

Failed implements Failer

type VMListRequest

type VMListRequest struct {
	Datacenter   string
	Folder       string
	ResourcePool string
}

VMListRequest collects the request parameters for the VMList method

type VMListResponse

type VMListResponse struct {
	VMList map[string]string `json:"vm_list,omitempty"`
	Err    error             `json:"error,omitempty"`
}

VMListResponse collects the response values for the VMList method

func (VMListResponse) Failed

func (r VMListResponse) Failed() error

Failed implements Failer

type VMRestoreFromSnapshotRequest

type VMRestoreFromSnapshotRequest struct {
	UUID       string
	Datacenter string `json:"datacenter"`
	SnapshotID int32  `json:"snapshot_id"`
	PowerOn    bool   `json:"power_on"`
}

VMRestoreFromSnapshotRequest collects the request parameters for the VMRestoreFromSnapshot method

type VMRolesListRequest

type VMRolesListRequest struct {
	UUID       string
	Datacenter string
}

VMRolesListRequest collects the request parameters for the VMRolesList method

type VMRolesListResponse

type VMRolesListResponse struct {
	VMRolesList []types.Role `json:"roles"`
	Err         error        `json:"error,omitempty"`
}

VMRolesListResponse collects the response values for the VMRolesList method

func (VMRolesListResponse) Failed

func (r VMRolesListResponse) Failed() error

Failed implements Failer

type VMSRestoreFromSnapshotResponse

type VMSRestoreFromSnapshotResponse struct {
	Err error `json:"error,omitempty"`
}

VMSRestoreFromSnapshotResponse collects the response values for the VMRestoreFromSnapshot method

func (VMSRestoreFromSnapshotResponse) Failed

Failed implements Failer

type VMSnapshotCreateRequest

type VMSnapshotCreateRequest struct {
	UUID        string
	Datacenter  string `json:"datacenter"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Memory      bool   `json:"memory"`
	Quiesce     bool   `json:"quiesce"`
}

VMSnapshotCreateRequest collects the request parameters for the VMSnapshotCreate method

type VMSnapshotCreateResponse

type VMSnapshotCreateResponse struct {
	SnapshotID int32 `json:"snapshot_id,omitempty"`
	Err        error `json:"error,omitempty"`
}

VMSnapshotCreateResponse collects the response values for the VMSnapshotCreate method

func (VMSnapshotCreateResponse) Failed

func (r VMSnapshotCreateResponse) Failed() error

Failed implements Failer

type VMSnapshotDeleteRequest

type VMSnapshotDeleteRequest struct {
	UUID       string
	SnapshotID int32  `json:"snapshot_id"`
	Datacenter string `json:"datacenter,omitempty"`
}

VMSnapshotDeleteRequest collects the request parameters for the VMSnapshotDelete method

type VMSnapshotDeleteResponse

type VMSnapshotDeleteResponse struct {
	Err error `json:"error,omitempty"`
}

VMSnapshotDeleteResponse collects the response values for the VMSnapshotDelete method

func (VMSnapshotDeleteResponse) Failed

func (r VMSnapshotDeleteResponse) Failed() error

Failed implements Failer

type VMSnapshotsListRequest

type VMSnapshotsListRequest struct {
	UUID       string
	Datacenter string
}

VMSnapshotsListRequest collects the request parameters for the VMSnapshotsList method

type VMSnapshotsListResponse

type VMSnapshotsListResponse struct {
	VMSnapshotsList []types.Snapshot `json:"snapshots"`
	Err             error            `json:"error,omitempty"`
}

VMSnapshotsListResponse collects the response values for the VMSnapshotsList method

func (VMSnapshotsListResponse) Failed

func (r VMSnapshotsListResponse) Failed() error

Failed implements Failer

Jump to

Keyboard shortcuts

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