1
0
Fork 0

more splits

This commit is contained in:
Frank Celler 2015-01-21 22:55:17 +01:00
parent 6e456dd334
commit dd6ac8155e
4 changed files with 15 additions and 52 deletions

View File

@ -33,8 +33,6 @@ var arangodb = require("org/arangodb");
var actions = require("org/arangodb/actions");
var cluster = require("org/arangodb/cluster");
var API = "_api/collection";
// -----------------------------------------------------------------------------
// --SECTION-- private functions
// -----------------------------------------------------------------------------
@ -336,7 +334,7 @@ function post_api_collection (req, res) {
}
var headers = {
location: databasePrefix(req, "/" + API + "/" + result.name)
location: databasePrefix(req, "/_api/collection/" + result.name)
};
actions.resultOk(req, res, actions.HTTP_OK, result, headers);
@ -904,7 +902,7 @@ function get_api_collection (req, res) {
if (req.suffix.length === 1) {
result = collectionRepresentation(collection, false, false, false);
headers = {
location : databasePrefix(req, "/" + API + "/" + collection.name())
location : databasePrefix(req, "/_api/collection/" + collection.name())
};
actions.resultOk(req, res, actions.HTTP_OK, result, headers);
return;
@ -949,7 +947,7 @@ function get_api_collection (req, res) {
else if (sub === "figures") {
result = collectionRepresentation(collection, true, true, true);
headers = {
location : databasePrefix(req, "/" + API + "/" + collection.name() + "/figures")
location : databasePrefix(req, "/_api/collection/" + collection.name() + "/figures")
};
actions.resultOk(req, res, actions.HTTP_OK, result, headers);
}
@ -961,7 +959,7 @@ function get_api_collection (req, res) {
else if (sub === "count") {
result = collectionRepresentation(collection, true, true, false);
headers = {
location : databasePrefix(req, "/" + API + "/" + collection.name() + "/count")
location : databasePrefix(req, "/_api/collection/" + collection.name() + "/count")
};
actions.resultOk(req, res, actions.HTTP_OK, result, headers);
}
@ -973,7 +971,7 @@ function get_api_collection (req, res) {
else if (sub === "properties") {
result = collectionRepresentation(collection, true, false, false);
headers = {
location : databasePrefix(req, "/" + API + "/" + collection.name() + "/properties")
location : databasePrefix(req, "/_api/collection/" + collection.name() + "/properties")
};
actions.resultOk(req, res, actions.HTTP_OK, result, headers);
}
@ -996,7 +994,7 @@ function get_api_collection (req, res) {
}
else {
actions.resultBad(req, res, arangodb.ERROR_HTTP_BAD_PARAMETER,
"expect GET /" + API + "/<collection-name>/<method>");
"expect GET /_api/collection/<collection-name>/<method>");
}
}
@ -1465,7 +1463,7 @@ function put_api_collection_rotate (req, res, collection) {
function put_api_collection (req, res) {
if (req.suffix.length !== 2) {
actions.resultBad(req, res, arangodb.ERROR_HTTP_BAD_PARAMETER,
"expected PUT /" + API + "/<collection-name>/<action>");
"expected PUT /_api/collection/<collection-name>/<action>");
return;
}
@ -1572,7 +1570,7 @@ function put_api_collection (req, res) {
function delete_api_collection (req, res) {
if (req.suffix.length !== 1) {
actions.resultBad(req, res, arangodb.ERROR_HTTP_BAD_PARAMETER,
"expected DELETE /" + API + "/<collection-name>");
"expected DELETE /_api/collection/<collection-name>");
}
else {
var name = decodeURIComponent(req.suffix[0]);
@ -1603,7 +1601,7 @@ function delete_api_collection (req, res) {
////////////////////////////////////////////////////////////////////////////////
actions.defineHttp({
url : API,
url : "_api/collection",
callback : function (req, res) {
try {
@ -1635,5 +1633,5 @@ actions.defineHttp({
// Local Variables:
// mode: outline-minor
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @page\\|// --SECTION--\\|/// @\\}"
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @page\\|/// @startDocuBlock\\|// --SECTION--\\|/// @\\}"
// End:

View File

@ -1,5 +1,5 @@
/*jshint strict: false */
/*global require, module */
/*global require */
////////////////////////////////////////////////////////////////////////////////
/// @brief foxx administration actions
@ -29,11 +29,6 @@
/// @author Copyright 2012, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
var internal = require("internal");
var fs = require("fs");
var arangodb = require("org/arangodb");
var actions = require("org/arangodb/actions");
var foxxManager = require("org/arangodb/foxx/manager");
@ -163,5 +158,5 @@ actions.defineHttp({
// Local Variables:
// mode: outline-minor
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @page\\|// --SECTION--\\|/// @\\}"
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @page\\|/// @startDocuBlock\\|// --SECTION--\\|/// @\\}"
// End:

View File

@ -38,12 +38,6 @@ var users = require("org/arangodb/users");
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @brief fetches a user
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @COMMENT{######################################################################}
/// @anchor HttpUserDocument
/// @startDocuBlock JSF_api_user_fetch
///
/// @RESTHEADER{GET /_api/user/{user}, Fetch User}
@ -103,12 +97,6 @@ function get_api_user (req, res) {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief creates a new user
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @COMMENT{######################################################################}
/// @anchor HttpUserSave
/// @startDocuBlock JSF_api_user_create
///
/// @RESTHEADER{POST /_api/user, Create User}
@ -200,10 +188,6 @@ function post_api_user (req, res) {
actions.resultOk(req, res, actions.HTTP_CREATED, doc);
}
////////////////////////////////////////////////////////////////////////////////
/// @brief replaces an existing user
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_api_user_replace
///
@ -288,12 +272,6 @@ function put_api_user (req, res) {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief partially updates an existing user
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @COMMENT{######################################################################}
/// @anchor HttpUserUpdate
/// @startDocuBlock JSF_api_user_update
///
/// @RESTHEADER{PATCH /_api/user/{user}, Update User}
@ -378,10 +356,6 @@ function patch_api_user (req, res) {
}
}
////////////////////////////////////////////////////////////////////////////////
/// @brief removes an existing user
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_api_user_delete
///
@ -445,7 +419,7 @@ function delete_api_user (req, res) {
}
// -----------------------------------------------------------------------------
// --SECTION-- actions
// --SECTION-- public functions
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
@ -494,5 +468,5 @@ actions.defineHttp({
// Local Variables:
// mode: outline-minor
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @page\\|// --SECTION--\\|/// @\\}"
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @page\\|/// @startDocuBlock\\|// --SECTION--\\|/// @\\}"
// End:

View File

@ -1,5 +1,5 @@
/*jshint strict: false */
/*global require, ArangoServerState */
/*global require */
////////////////////////////////////////////////////////////////////////////////
/// @brief administration actions
@ -29,14 +29,10 @@
/// @author Copyright 2012, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
var arangodb = require("org/arangodb");
var actions = require("org/arangodb/actions");
var internal = require("internal");
var console = require("console");
var users = require("org/arangodb/users");
var targetDatabaseVersion = require("org/arangodb/database-version").CURRENT_VERSION;
// -----------------------------------------------------------------------------
// --SECTION-- public functions
// -----------------------------------------------------------------------------