jr

package
v0.8.2-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

README

Job Runner API

TODO: Fill this out

Running the Code

  1. Update the import path of your jobs in spincycle/job/external/factory
  2. In the root spincycle directory, run go get ./...
  3. Run the JR web server: go run spincycle/job-runner/main.go
  4. Send commands to the web server:
# POST a new chain
curl -H "Content-Type: application/json" -X POST -d '<CHAIN_PAYLOAD>' localhost:9999/api/v1/job-chains

# PUT a chain that is running to start it
curl -X PUT localhost:9999/api/v1/job-chains/<REQUEST_ID_OF_THE_CHAIN>/start

# PUT a chain that is running to stop it
curl -X PUT localhost:9999/api/v1/job-chains/<REQUEST_ID_OF_THE_CHAIN>/stop

# GET the status of a running chain
curl localhost:9999/api/v1/job-chains/<REQUEST_ID_OF_THE_CHAIN>/status

TODOs

  • When a traverser finishes, it should POST back to the Request Manager API the final status of the chain.
  • Make basic things configurable (ex: port for http server).
  • Simplify http routing stuff.

Documentation

Overview

Package client provides an HTTP client for interacting with the Job Runner (JR) API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// NewJobChain takes a job chain, and sends it to the JR to be run immediately.
	NewJobChain(proto.JobChain) error
	// ResumeJobChain takes a suspended job chain and sends it to the JR to be resumed.
	ResumeJobChain(proto.SuspendedJobChain) error
	// StopRequest stops the job chain that corresponds to a given request Id.
	StopRequest(string) error
	// RequestStatus gets the status of the job chain that corresponds to a given request Id.
	RequestStatus(string) (proto.JobChainStatus, error)

	// SysStatRunning reports all running jobs.
	SysStatRunning() ([]proto.JobStatus, error)
}

A Client is an HTTP client used for interacting with the JR API.

func NewClient

func NewClient(c *http.Client, baseUrl string) Client

NewClient takes an http.Client and base API URL and creates a Client.

Directories

Path Synopsis
Package api provides controllers for each api endpoint.
Package api provides controllers for each api endpoint.
Package chain implements a job chain.
Package chain implements a job chain.
Package runner implements running a job.
Package runner implements running a job.
Package server bootstraps the Job Runner.
Package server bootstraps the Job Runner.
Package status provides system-wide status.
Package status provides system-wide status.

Jump to

Keyboard shortcuts

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