jobs

package
v0.0.0-...-0490640 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package jobs is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var Query_OrderType_name = map[int32]string{
	0: "ASC",
	1: "DESC",
}
View Source
var Query_OrderType_value = map[string]int32{
	"ASC":  0,
	"DESC": 1,
}

Functions

func RegisterJobsServiceHandler

func RegisterJobsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterJobsServiceHandler registers the http handlers for service JobsService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterJobsServiceHandlerClient

func RegisterJobsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client JobsServiceClient) error

RegisterJobsServiceHandlerClient registers the http handlers for service JobsService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "JobsServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "JobsServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "JobsServiceClient" to call the correct interceptors.

func RegisterJobsServiceHandlerFromEndpoint

func RegisterJobsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterJobsServiceHandlerFromEndpoint is same as RegisterJobsServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterJobsServiceServer

func RegisterJobsServiceServer(s *grpc.Server, srv JobsServiceServer)

Types

type Id

type Id struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Id) Descriptor

func (*Id) Descriptor() ([]byte, []int)

func (*Id) GetId

func (m *Id) GetId() string

func (*Id) ProtoMessage

func (*Id) ProtoMessage()

func (*Id) Reset

func (m *Id) Reset()

func (*Id) String

func (m *Id) String() string

func (*Id) XXX_DiscardUnknown

func (m *Id) XXX_DiscardUnknown()

func (*Id) XXX_Marshal

func (m *Id) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Id) XXX_Merge

func (dst *Id) XXX_Merge(src proto.Message)

func (*Id) XXX_Size

func (m *Id) XXX_Size() int

func (*Id) XXX_Unmarshal

func (m *Id) XXX_Unmarshal(b []byte) error

type Job

type Job struct {
	Id                   string               `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name                 string               `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Type                 string               `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	Timeout              int32                `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"`
	Tags                 []*common.Kv         `protobuf:"bytes,20,rep,name=tags,proto3" json:"tags,omitempty"`
	StartTime            *timestamp.Timestamp `protobuf:"bytes,21,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	EndTime              *timestamp.Timestamp `protobuf:"bytes,22,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
	Status               string               `protobuf:"bytes,23,opt,name=status,proto3" json:"status,omitempty"`
	Retries              int32                `protobuf:"varint,26,opt,name=retries,proto3" json:"retries,omitempty"`
	RetriesLeft          int32                `protobuf:"varint,27,opt,name=retries_left,json=retriesLeft,proto3" json:"retries_left,omitempty"`
	Results              []*ResultsRow        `protobuf:"bytes,28,rep,name=results,proto3" json:"results,omitempty"`
	Nodes                []string             `protobuf:"bytes,100,rep,name=nodes,proto3" json:"nodes,omitempty"`
	Profiles             []string             `protobuf:"bytes,101,rep,name=profiles,proto3" json:"profiles,omitempty"`
	NodeCount            int32                `protobuf:"varint,102,opt,name=node_count,json=nodeCount,proto3" json:"node_count,omitempty"`
	ProfileCount         int32                `protobuf:"varint,103,opt,name=profile_count,json=profileCount,proto3" json:"profile_count,omitempty"`
	NodeSelectors        []*ManagerFilter     `protobuf:"bytes,104,rep,name=node_selectors,json=nodeSelectors,proto3" json:"node_selectors,omitempty"`
	ScheduledTime        *timestamp.Timestamp `protobuf:"bytes,105,opt,name=scheduled_time,json=scheduledTime,proto3" json:"scheduled_time,omitempty"`
	Recurrence           string               `protobuf:"bytes,106,opt,name=recurrence,proto3" json:"recurrence,omitempty"`
	ParentId             string               `protobuf:"bytes,107,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
	JobCount             int32                `protobuf:"varint,108,opt,name=job_count,json=jobCount,proto3" json:"job_count,omitempty"`
	Deleted              bool                 `protobuf:"varint,109,opt,name=deleted,proto3" json:"deleted,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*Job) Descriptor

func (*Job) Descriptor() ([]byte, []int)

func (*Job) GetDeleted

func (m *Job) GetDeleted() bool

func (*Job) GetEndTime

func (m *Job) GetEndTime() *timestamp.Timestamp

func (*Job) GetId

func (m *Job) GetId() string

func (*Job) GetJobCount

func (m *Job) GetJobCount() int32

func (*Job) GetName

func (m *Job) GetName() string

func (*Job) GetNodeCount

func (m *Job) GetNodeCount() int32

func (*Job) GetNodeSelectors

func (m *Job) GetNodeSelectors() []*ManagerFilter

func (*Job) GetNodes

func (m *Job) GetNodes() []string

func (*Job) GetParentId

func (m *Job) GetParentId() string

func (*Job) GetProfileCount

func (m *Job) GetProfileCount() int32

func (*Job) GetProfiles

func (m *Job) GetProfiles() []string

func (*Job) GetRecurrence

func (m *Job) GetRecurrence() string

func (*Job) GetResults

func (m *Job) GetResults() []*ResultsRow

func (*Job) GetRetries

func (m *Job) GetRetries() int32

func (*Job) GetRetriesLeft

func (m *Job) GetRetriesLeft() int32

func (*Job) GetScheduledTime

func (m *Job) GetScheduledTime() *timestamp.Timestamp

func (*Job) GetStartTime

func (m *Job) GetStartTime() *timestamp.Timestamp

func (*Job) GetStatus

func (m *Job) GetStatus() string

func (*Job) GetTags

func (m *Job) GetTags() []*common.Kv

func (*Job) GetTimeout

func (m *Job) GetTimeout() int32

func (*Job) GetType

func (m *Job) GetType() string

func (*Job) ProtoMessage

func (*Job) ProtoMessage()

func (*Job) Reset

func (m *Job) Reset()

func (*Job) String

func (m *Job) String() string

func (*Job) XXX_DiscardUnknown

func (m *Job) XXX_DiscardUnknown()

func (*Job) XXX_Marshal

func (m *Job) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Job) XXX_Merge

func (dst *Job) XXX_Merge(src proto.Message)

func (*Job) XXX_Size

func (m *Job) XXX_Size() int

func (*Job) XXX_Unmarshal

func (m *Job) XXX_Unmarshal(b []byte) error

type Jobs

type Jobs struct {
	Jobs                 []*Job   `protobuf:"bytes,1,rep,name=jobs,proto3" json:"jobs,omitempty"`
	Total                int32    `protobuf:"varint,20,opt,name=total,proto3" json:"total,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Jobs) Descriptor

func (*Jobs) Descriptor() ([]byte, []int)

func (*Jobs) GetJobs

func (m *Jobs) GetJobs() []*Job

func (*Jobs) GetTotal

func (m *Jobs) GetTotal() int32

func (*Jobs) ProtoMessage

func (*Jobs) ProtoMessage()

func (*Jobs) Reset

func (m *Jobs) Reset()

func (*Jobs) String

func (m *Jobs) String() string

func (*Jobs) XXX_DiscardUnknown

func (m *Jobs) XXX_DiscardUnknown()

func (*Jobs) XXX_Marshal

func (m *Jobs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Jobs) XXX_Merge

func (dst *Jobs) XXX_Merge(src proto.Message)

func (*Jobs) XXX_Size

func (m *Jobs) XXX_Size() int

func (*Jobs) XXX_Unmarshal

func (m *Jobs) XXX_Unmarshal(b []byte) error

type JobsServiceClient

type JobsServiceClient interface {
	Create(ctx context.Context, in *Job, opts ...grpc.CallOption) (*Id, error)
	Read(ctx context.Context, in *Id, opts ...grpc.CallOption) (*Job, error)
	Update(ctx context.Context, in *Job, opts ...grpc.CallOption) (*empty.Empty, error)
	Delete(ctx context.Context, in *Id, opts ...grpc.CallOption) (*empty.Empty, error)
	List(ctx context.Context, in *Query, opts ...grpc.CallOption) (*Jobs, error)
	Rerun(ctx context.Context, in *Id, opts ...grpc.CallOption) (*RerunResponse, error)
}

JobsServiceClient is the client API for JobsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewJobsServiceClient

func NewJobsServiceClient(cc *grpc.ClientConn) JobsServiceClient

type JobsServiceServer

type JobsServiceServer interface {
	Create(context.Context, *Job) (*Id, error)
	Read(context.Context, *Id) (*Job, error)
	Update(context.Context, *Job) (*empty.Empty, error)
	Delete(context.Context, *Id) (*empty.Empty, error)
	List(context.Context, *Query) (*Jobs, error)
	Rerun(context.Context, *Id) (*RerunResponse, error)
}

JobsServiceServer is the server API for JobsService service.

type JobsServiceServerMock

type JobsServiceServerMock struct {
	CreateFunc func(context.Context, *Job) (*Id, error)
	ReadFunc   func(context.Context, *Id) (*Job, error)
	UpdateFunc func(context.Context, *Job) (*empty.Empty, error)
	DeleteFunc func(context.Context, *Id) (*empty.Empty, error)
	ListFunc   func(context.Context, *Query) (*Jobs, error)
	RerunFunc  func(context.Context, *Id) (*RerunResponse, error)
	// contains filtered or unexported fields
}

JobsServiceServerMock is the mock-what-you-want struct that stubs all not-overridden methods with "not implemented" returns

func NewJobsServiceServerMock

func NewJobsServiceServerMock() *JobsServiceServerMock

NewJobsServiceServerMock gives you a fresh instance of JobsServiceServerMock.

func NewJobsServiceServerMockWithoutValidation

func NewJobsServiceServerMockWithoutValidation() *JobsServiceServerMock

NewJobsServiceServerMockWithoutValidation gives you a fresh instance of JobsServiceServerMock which does not attempt to validate requests before passing them to their respective '*Func'.

func (*JobsServiceServerMock) Create

func (m *JobsServiceServerMock) Create(ctx context.Context, req *Job) (*Id, error)

func (*JobsServiceServerMock) Delete

func (m *JobsServiceServerMock) Delete(ctx context.Context, req *Id) (*empty.Empty, error)

func (*JobsServiceServerMock) List

func (m *JobsServiceServerMock) List(ctx context.Context, req *Query) (*Jobs, error)

func (*JobsServiceServerMock) Read

func (m *JobsServiceServerMock) Read(ctx context.Context, req *Id) (*Job, error)

func (*JobsServiceServerMock) Rerun

func (m *JobsServiceServerMock) Rerun(ctx context.Context, req *Id) (*RerunResponse, error)

func (*JobsServiceServerMock) Reset

func (m *JobsServiceServerMock) Reset()

Reset resets all overridden functions

func (*JobsServiceServerMock) Update

func (m *JobsServiceServerMock) Update(ctx context.Context, req *Job) (*empty.Empty, error)

type ManagerFilter

type ManagerFilter struct {
	ManagerId            string           `protobuf:"bytes,1,opt,name=manager_id,json=managerId,proto3" json:"manager_id,omitempty"`
	Filters              []*common.Filter `protobuf:"bytes,2,rep,name=filters,proto3" json:"filters,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*ManagerFilter) Descriptor

func (*ManagerFilter) Descriptor() ([]byte, []int)

func (*ManagerFilter) GetFilters

func (m *ManagerFilter) GetFilters() []*common.Filter

func (*ManagerFilter) GetManagerId

func (m *ManagerFilter) GetManagerId() string

func (*ManagerFilter) ProtoMessage

func (*ManagerFilter) ProtoMessage()

func (*ManagerFilter) Reset

func (m *ManagerFilter) Reset()

func (*ManagerFilter) String

func (m *ManagerFilter) String() string

func (*ManagerFilter) XXX_DiscardUnknown

func (m *ManagerFilter) XXX_DiscardUnknown()

func (*ManagerFilter) XXX_Marshal

func (m *ManagerFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ManagerFilter) XXX_Merge

func (dst *ManagerFilter) XXX_Merge(src proto.Message)

func (*ManagerFilter) XXX_Size

func (m *ManagerFilter) XXX_Size() int

func (*ManagerFilter) XXX_Unmarshal

func (m *ManagerFilter) XXX_Unmarshal(b []byte) error

type Query

type Query struct {
	Filters              []*common.Filter `protobuf:"bytes,20,rep,name=filters,proto3" json:"filters,omitempty"`
	Order                Query_OrderType  `` /* 131-byte string literal not displayed */
	Sort                 string           `protobuf:"bytes,22,opt,name=sort,proto3" json:"sort,omitempty"`
	Page                 int32            `protobuf:"varint,23,opt,name=page,proto3" json:"page,omitempty"`
	PerPage              int32            `protobuf:"varint,24,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*Query) Descriptor

func (*Query) Descriptor() ([]byte, []int)

func (*Query) GetFilters

func (m *Query) GetFilters() []*common.Filter

func (*Query) GetOrder

func (m *Query) GetOrder() Query_OrderType

func (*Query) GetPage

func (m *Query) GetPage() int32

func (*Query) GetPerPage

func (m *Query) GetPerPage() int32

func (*Query) GetSort

func (m *Query) GetSort() string

func (*Query) ProtoMessage

func (*Query) ProtoMessage()

func (*Query) Reset

func (m *Query) Reset()

func (*Query) String

func (m *Query) String() string

func (*Query) XXX_DiscardUnknown

func (m *Query) XXX_DiscardUnknown()

func (*Query) XXX_Marshal

func (m *Query) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Query) XXX_Merge

func (dst *Query) XXX_Merge(src proto.Message)

func (*Query) XXX_Size

func (m *Query) XXX_Size() int

func (*Query) XXX_Unmarshal

func (m *Query) XXX_Unmarshal(b []byte) error

type Query_OrderType

type Query_OrderType int32
const (
	Query_ASC  Query_OrderType = 0
	Query_DESC Query_OrderType = 1
)

func (Query_OrderType) EnumDescriptor

func (Query_OrderType) EnumDescriptor() ([]byte, []int)

func (Query_OrderType) String

func (x Query_OrderType) String() string

type RerunResponse

type RerunResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RerunResponse) Descriptor

func (*RerunResponse) Descriptor() ([]byte, []int)

func (*RerunResponse) ProtoMessage

func (*RerunResponse) ProtoMessage()

func (*RerunResponse) Reset

func (m *RerunResponse) Reset()

func (*RerunResponse) String

func (m *RerunResponse) String() string

func (*RerunResponse) XXX_DiscardUnknown

func (m *RerunResponse) XXX_DiscardUnknown()

func (*RerunResponse) XXX_Marshal

func (m *RerunResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RerunResponse) XXX_Merge

func (dst *RerunResponse) XXX_Merge(src proto.Message)

func (*RerunResponse) XXX_Size

func (m *RerunResponse) XXX_Size() int

func (*RerunResponse) XXX_Unmarshal

func (m *RerunResponse) XXX_Unmarshal(b []byte) error

type ResultsRow

type ResultsRow struct {
	NodeId               string               `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
	ReportId             string               `protobuf:"bytes,2,opt,name=report_id,json=reportId,proto3" json:"report_id,omitempty"`
	Status               string               `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
	Result               string               `protobuf:"bytes,4,opt,name=result,proto3" json:"result,omitempty"`
	JobId                string               `protobuf:"bytes,5,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"`
	StartTime            *timestamp.Timestamp `protobuf:"bytes,20,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	EndTime              *timestamp.Timestamp `protobuf:"bytes,21,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*ResultsRow) Descriptor

func (*ResultsRow) Descriptor() ([]byte, []int)

func (*ResultsRow) GetEndTime

func (m *ResultsRow) GetEndTime() *timestamp.Timestamp

func (*ResultsRow) GetJobId

func (m *ResultsRow) GetJobId() string

func (*ResultsRow) GetNodeId

func (m *ResultsRow) GetNodeId() string

func (*ResultsRow) GetReportId

func (m *ResultsRow) GetReportId() string

func (*ResultsRow) GetResult

func (m *ResultsRow) GetResult() string

func (*ResultsRow) GetStartTime

func (m *ResultsRow) GetStartTime() *timestamp.Timestamp

func (*ResultsRow) GetStatus

func (m *ResultsRow) GetStatus() string

func (*ResultsRow) ProtoMessage

func (*ResultsRow) ProtoMessage()

func (*ResultsRow) Reset

func (m *ResultsRow) Reset()

func (*ResultsRow) String

func (m *ResultsRow) String() string

func (*ResultsRow) XXX_DiscardUnknown

func (m *ResultsRow) XXX_DiscardUnknown()

func (*ResultsRow) XXX_Marshal

func (m *ResultsRow) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ResultsRow) XXX_Merge

func (dst *ResultsRow) XXX_Merge(src proto.Message)

func (*ResultsRow) XXX_Size

func (m *ResultsRow) XXX_Size() int

func (*ResultsRow) XXX_Unmarshal

func (m *ResultsRow) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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