staccato/doc/source/api.rst
John Bresnahan 90bdc94ece more doc
2013-05-29 21:18:32 -10:00

2.4 KiB

Stacatto REST API

This document describes the current v1 Stacatto REST API

Data Types

States

  • STATE_NEW
  • STATE_RUNNING
  • STATE_CANCELING
  • STATE_CANCELED
  • STATE_ERRORING
  • STATE_ERROR
  • STATE_COMPLETE
  • STATE_DELETED

****************** * id : UUID

  • source_url : string

    The URL of the source of the data to be transferred.

  • destination_url : string

    The URL of the destination where the source URL will be copied.

  • state : State

    The current state of the transfer.

  • progress : integer

    The number of bytes safely transferred to the destination storage system thus far.

  • start_offset

    The offset into the source data set from which the transfer will begin.

  • end_offset : integer

    The offset into the source data set at which the transfer will end.

  • destination_options : JSON document

    A JSON document that is defined by the transfer service protocol plugin in use. That plugin is determined by the scheme portion of the destination URL.

  • source_options : JSON document

    A JSON document that is defined by the transfer service protocol plugin in use. That plugin is determined by the scheme portion of the source URL.

Example:

{"start_offset": 0, 
 "id": "590edf8c-1b2b-44d0-af6a-d9190753b6eb", 
 "state": "STATE_NEW", 
 "progress": 0, 
 "end_offset": -1,
 "source_url": "file:///bin/bash",
 "destination_options": {},
 "destination_url": "file:///tmp/ooo",
 "source_options": {}}

List All Transfers

GET /v1/transfers

Options: * limit * next...

Response

  • code: 200
  • A list of xfer document types

Request a Transfer

POST /v1/transfers

Required Parameters

  • source_url <string url>
  • destination_url <string url>

Optional

  • source_options <json doc>
  • destination_options <json doc>
  • start_offset <int>
  • end_offset <int>

Response

  • code: 201
  • xfer document type

Check Transfer Status

GET /v1/transfers/{transfer id}

Response

  • code: 200
  • xfer document type

Cancel A Transfer

POST /v1/transfers/{transfer id}/action

Required Parameters: - xferaction: cancel

"Content-Type: application/json"

Response

  • code: 202 (if async)

    204 (if sync)

Delete A Transfer

DELETE /v1/transfers/{transfer id}

Response

  • code: 202 (if async)

    204 (if sync)