Documentation ¶
Index ¶
- Variables
- func Initialize(url string, user string, keyID string, identityPath string)
- type Client
- func (c *Client) AddJobInput(jobID string, input io.Reader) error
- func (c *Client) CreateJob(opts CreateJobOpts) (string, error)
- func (c *Client) Delete(path string) (*http.Response, error)
- func (c *Client) DeleteDirectory(path string) error
- func (c *Client) Do(method, path string, headers http.Header, r io.Reader) (*http.Response, error)
- func (c *Client) EndJobInput(jobID string) error
- func (c *Client) Get(path string, headers http.Header) (*http.Response, error)
- func (c *Client) GetJob(jobID string) (Job, error)
- func (c *Client) GetJobOutput(jobID string) (string, error)
- func (c *Client) GetObject(path string) (io.Reader, error)
- func (c *Client) ListDirectory(path string) ([]Entry, error)
- func (c *Client) NewRequest(method, path string, r io.Reader) (*http.Request, error)
- func (c *Client) Post(path string, headers http.Header, body io.Reader) (*http.Response, error)
- func (c *Client) Put(path string, headers http.Header, r io.Reader) (*http.Response, error)
- func (c *Client) PutDirectory(path string) error
- func (c *Client) PutObject(destination string, contentType string, r io.Reader) error
- func (c *Client) SignRequest(req *http.Request) error
- type CreateJobOpts
- type Entry
- type Job
- type JobStats
- type Phase
Constants ¶
This section is empty.
Variables ¶
var MANTA_URL, MANTA_USER, MANTA_KEY_ID, SDC_IDENTITY string
Functions ¶
Types ¶
type Client ¶
type Client struct { User string KeyId string Key string Url string HTTPTimeout time.Duration // contains filtered or unexported fields }
Client is a Manta client. Client is not safe for concurrent use.
func DefaultClient ¶
func DefaultClient() *Client
DefaultClient returns a Client instance configured from the default Manta environment variables.
func (*Client) AddJobInput ¶
AddJobInput submits input to a job previously created by CreateJob
func (*Client) CreateJob ¶
func (c *Client) CreateJob(opts CreateJobOpts) (string, error)
CreateJob submits a job to Manta and returns the URI for the job.
func (*Client) DeleteDirectory ¶
DeleteDirectory deletes a directory. The directory must be empty. There is no response data from this request. On success an HTTP 204 is returned
func (*Client) EndJobInput ¶
EndJobInput closes input for a job previously created by CreateJob
func (*Client) GetObject ¶
GetObject retrieves an object https://apidocs.joyent.com/manta/api.html#GetObject
func (*Client) ListDirectory ¶
ListDirectory lists the contents of a directory https://apidocs.joyent.com/manta/api.html#ListDirectory
func (*Client) NewRequest ¶
NewRequest is similar to http.NewRequest except it appends path to the API endpoint this client is configured for.
func (*Client) PutDirectory ¶
PutDirectory in the Joyent Manta Storage Service is an idempotent create-or-update operation https://apidocs.joyent.com/manta/api.html#PutDirectory
func (*Client) PutObject ¶
PutObject creates or overwrites an object https://apidocs.joyent.com/manta/api.html#PutObject
type CreateJobOpts ¶
type CreateJobOpts struct { Name string `json:"name,omitempty"` // Job Name (optional) Phases []Phase `json:"phases"` // Tasks to execute as part of this job }
CreateJobOpts represent the option that can be specified when creating a job.
type Entry ¶
type Entry struct { Name string `json:"name"` // Entry name Etag string `json:"etag,omitempty"` // If type is 'object', object UUID Size int `json:"size,omitempty"` // If type is 'object', object size (content-length) Type string `json:"type"` // Entry type, one of 'directory' or 'object' Mtime string `json:"mtime"` // ISO8601 timestamp of the last update Durability int `json:"durability"` }
Entry represents an object stored in Manta, either a file or a directory
type Job ¶
type Job struct { Id string // Job unique identifier Name string `json:"name,omitempty"` // Job Name State string // Job state Cancelled bool // Whether the job has been cancelled or not InputDone bool // Whether the inputs for the job is still open or not Stats JobStats `json:"stats,omitempty"` // Job statistics TimeCreated string // Time the job was created at TimeDone string `json:"timeDone,omitempty"` // Time the job was completed TimeArchiveStarted string `json:"timeArchiveStarted,omitempty"` // Time the job archiving started TimeArchiveDone string `json:"timeArchiveDone,omitempty"` // Time the job archiving completed Phases []Phase `json:"phases"` // Job tasks Options interface{} // Job options }
Job represents the status of a job.
type JobStats ¶
type JobStats struct { Errors int // Number or errors Outputs int // Number of output produced Retries int // Number of retries Tasks int // Total number of task in the job TasksDone int // number of tasks done }
JobStats represents statistics about a job
type Phase ¶
type Phase struct { Type string `json:"type,omitempty"` // Task type, one of 'map' or 'reduce' (optional) Assets []string `json:"assets,omitempty"` // An array of objects to be placed in the compute zones (optional) Exec string `json:"exec"` // The actual shell statement to execute Init string `json:"init"` // Shell statement to execute in each compute zone before any tasks are executed Count int `json:"count,omitempty"` // If type is 'reduce', an optional number of reducers for this phase (default is 1) Memory int `json:"memory,omitempty"` // Amount of DRAM to give to your compute zone (in Mb, optional) Disk int `json:"disk,omitempty"` // Amount of disk space to give to your compute zone (in Gb, optional) }
Phase represents a task to be executed as part of a Job