controlapi

package
Version: v0.0.0-...-f0983eb Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the Cluster API gRPC server.

func NewServer

func NewServer(store *store.MemoryStore, raft *raft.Node) *Server

NewServer creates a Cluster API server.

func (*Server) CreateNetwork

func (s *Server) CreateNetwork(ctx context.Context, request *api.CreateNetworkRequest) (*api.CreateNetworkResponse, error)

CreateNetwork creates and return a Network based on the provided NetworkSpec. - Returns `InvalidArgument` if the NetworkSpec is malformed. - Returns an error if the creation fails.

func (*Server) CreateService

func (s *Server) CreateService(ctx context.Context, request *api.CreateServiceRequest) (*api.CreateServiceResponse, error)

CreateService creates and return a Service based on the provided ServiceSpec. - Returns `InvalidArgument` if the ServiceSpec is malformed. - Returns `Unimplemented` if the ServiceSpec references unimplemented features. - Returns `AlreadyExists` if the ServiceID conflicts. - Returns an error if the creation fails.

func (*Server) GetCluster

func (s *Server) GetCluster(ctx context.Context, request *api.GetClusterRequest) (*api.GetClusterResponse, error)

GetCluster returns a Cluster given a ClusterID. - Returns `InvalidArgument` if ClusterID is not provided. - Returns `NotFound` if the Cluster is not found.

func (*Server) GetNetwork

func (s *Server) GetNetwork(ctx context.Context, request *api.GetNetworkRequest) (*api.GetNetworkResponse, error)

GetNetwork returns a Network given a NetworkID. - Returns `InvalidArgument` if NetworkID is not provided. - Returns `NotFound` if the Network is not found.

func (*Server) GetNode

func (s *Server) GetNode(ctx context.Context, request *api.GetNodeRequest) (*api.GetNodeResponse, error)

GetNode returns a Node given a NodeID. - Returns `InvalidArgument` if NodeID is not provided. - Returns `NotFound` if the Node is not found.

func (*Server) GetService

func (s *Server) GetService(ctx context.Context, request *api.GetServiceRequest) (*api.GetServiceResponse, error)

GetService returns a Service given a ServiceID. - Returns `InvalidArgument` if ServiceID is not provided. - Returns `NotFound` if the Service is not found.

func (*Server) GetTask

func (s *Server) GetTask(ctx context.Context, request *api.GetTaskRequest) (*api.GetTaskResponse, error)

GetTask returns a Task given a TaskID. - Returns `InvalidArgument` if TaskID is not provided. - Returns `NotFound` if the Task is not found.

func (*Server) ListClusters

func (s *Server) ListClusters(ctx context.Context, request *api.ListClustersRequest) (*api.ListClustersResponse, error)

ListClusters returns a list of all clusters.

func (*Server) ListNetworks

func (s *Server) ListNetworks(ctx context.Context, request *api.ListNetworksRequest) (*api.ListNetworksResponse, error)

ListNetworks returns a list of all networks.

func (*Server) ListNodes

func (s *Server) ListNodes(ctx context.Context, request *api.ListNodesRequest) (*api.ListNodesResponse, error)

ListNodes returns a list of all nodes.

func (*Server) ListServices

func (s *Server) ListServices(ctx context.Context, request *api.ListServicesRequest) (*api.ListServicesResponse, error)

ListServices returns a list of all services.

func (*Server) ListTasks

func (s *Server) ListTasks(ctx context.Context, request *api.ListTasksRequest) (*api.ListTasksResponse, error)

ListTasks returns a list of all tasks.

func (*Server) RemoveNetwork

func (s *Server) RemoveNetwork(ctx context.Context, request *api.RemoveNetworkRequest) (*api.RemoveNetworkResponse, error)

RemoveNetwork removes a Network referenced by NetworkID. - Returns `InvalidArgument` if NetworkID is not provided. - Returns `NotFound` if the Network is not found. - Returns an error if the deletion fails.

func (*Server) RemoveNode

func (s *Server) RemoveNode(ctx context.Context, request *api.RemoveNodeRequest) (*api.RemoveNodeResponse, error)

RemoveNode updates a Node referenced by NodeID with the given NodeSpec. - Returns NotFound if the Node is not found. - Returns FailedPrecondition if the Node has manager role or not shut down. - Returns InvalidArgument if NodeID or NodeVersion is not valid. - Returns an error if the delete fails.

func (*Server) RemoveService

func (s *Server) RemoveService(ctx context.Context, request *api.RemoveServiceRequest) (*api.RemoveServiceResponse, error)

RemoveService removes a Service referenced by ServiceID. - Returns `InvalidArgument` if ServiceID is not provided. - Returns `NotFound` if the Service is not found. - Returns an error if the deletion fails.

func (*Server) RemoveTask

func (s *Server) RemoveTask(ctx context.Context, request *api.RemoveTaskRequest) (*api.RemoveTaskResponse, error)

RemoveTask removes a Task referenced by TaskID. - Returns `InvalidArgument` if TaskID is not provided. - Returns `NotFound` if the Task is not found. - Returns an error if the deletion fails.

func (*Server) UpdateCluster

func (s *Server) UpdateCluster(ctx context.Context, request *api.UpdateClusterRequest) (*api.UpdateClusterResponse, error)

UpdateCluster updates a Cluster referenced by ClusterID with the given ClusterSpec. - Returns `NotFound` if the Cluster is not found. - Returns `InvalidArgument` if the ClusterSpec is malformed. - Returns `Unimplemented` if the ClusterSpec references unimplemented features. - Returns an error if the update fails.

func (*Server) UpdateNode

func (s *Server) UpdateNode(ctx context.Context, request *api.UpdateNodeRequest) (*api.UpdateNodeResponse, error)

UpdateNode updates a Node referenced by NodeID with the given NodeSpec. - Returns `NotFound` if the Node is not found. - Returns `InvalidArgument` if the NodeSpec is malformed. - Returns an error if the update fails.

func (*Server) UpdateService

func (s *Server) UpdateService(ctx context.Context, request *api.UpdateServiceRequest) (*api.UpdateServiceResponse, error)

UpdateService updates a Service referenced by ServiceID with the given ServiceSpec. - Returns `NotFound` if the Service is not found. - Returns `InvalidArgument` if the ServiceSpec is malformed. - Returns `Unimplemented` if the ServiceSpec references unimplemented features. - Returns an error if the update fails.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL