Jump to: navigation, search

MagnetoDB/specs/bulkload-api

< MagnetoDB
Revision as of 09:19, 14 May 2014 by Ikhudoshyn (talk | contribs) (Request Syntax)

[Draft] MagnetoDB Bulk Load workflow and API

Headers

  • User-Agent
  • Content-Type: application/json, text/plain
  • Accept: application/json
  • X-Auth-Token keystone auth token

Common Errors

This section lists the common errors that all actions return. Any action-specific errors will be listed in the topic for the action.

TBD

Operations

HTTP method URL pattern Operation description
POST v1/{project_id}/data/tables/{table_name}/bulk_load Creates a new bulk load job
POST v1/{project_id}/data/tables/{table_name}/bulk_load/{job_id} Uploads chunk of data
GET v1/{project_id}/data/tables/{table_name}/bulk_load/{job_id}/status Gets status of the bulk load job
GET v1/{project_id}/data/tables/{table_name}/bulk_load/jobs Gets list of bulk load job ids
DELETE v1/{project_id}/data/tables/{table_name}/bulk_load/{job_id} Stops the bulk load job

Operation details

Requests and responses should be very similar to the Amazon DynamoDB. But there should be some differences:

  • table_name parameter will be provided via URL
  • GlobalSecondaryIndexes will be added in future
  • API will use different HTTP methods for different operations (POST for create, PUT for update, etc)

Note: operations with items in the table(Getitem, Putitem, Scan, etc) will use POST method.


Create new bulk load job

The CreateTable operation adds a new table. Table names must be unique within each tenant.

URL

POST v1/{project_id}/data/tables/{table_name}/bulk_load

Request Syntax
{
    "attribute_definitions": [
        {
            "attribute_name": "string",
            "attribute_type": "string"
        }
    ]
}
Request Parameters
attribute_definitions
An array of attributes that describe the schema for the upcoming data.
Type: array of AttributeDefinition objects
Required: Yes
Response Syntax
{
   "job_id": "string"
}
Response Elements
job_id
Id of the new created job
Type: string
Errors

TBD


Upload data chunk

URL
Request Syntax

TODO

Request Parameters

TODO

Response Syntax

TODO

Response Elements

TODO

Errors

TODO


Get bulk load job status

Returns information about the table.

URL

GET v1/{project_id}/data/tables/{table_name}

Request Syntax

This operation does not require a request body

Response Syntax

Response Elements
Errors

TBW


Get bulk load jobs list

The DeleteTable operation deletes a table and all of its items.

URL
Request Syntax
Response Syntax

Response Elements
Errors

TBW


Delete bulk load job

URL
Request Syntax

This operation does not require a request body

Request Parameters

Parameters should be provided via GET query string.

Response Syntax
Response Elements
Errors

TBW