Skip to content
bugzmanov edited this page Mar 20, 2013 · 18 revisions

All REST API is located in api module and should be changed separately and with backward compatibility.

Without SSO configured Genesis use form-based (for browser usage) authorization and basic (for direct REST usage) authorization without challenge.

REST API Reference

Content

Core domain

Projects Management

Configuration Management

Environments Management

Workflow execution management

Templates management

Databag templates management

Scheduled workflow executions

Supported domain extensions

Credentials management

Databags management

Predefined servers management

Configuration and security

Settings and build information

Users and groups management

System and project roles management

Environment access security

[Template repository configuration(since Genesis 1.3)](https://github.com/griddynamics/OpenGenesis/wiki/REST:-Template-Repository-Configuration-per-project(since-Genesis-1.3\))

Common api

There is a common result object returning for most changing (POST and PUT) operations.

Example of successful response:

{
	"isSuccess": true,
	"isNotFound": false,
	"serviceErrors":{},
    	"variablesErrors":{},
    	"compoundServiceErrors":[],
    	"compoundVariablesErrors":[],
}

Example of errorneous response:

{
	"isSuccess": false,
	"isNotFound": false,
	"serviceErrors" : {"fieldName": "Error message"},
	"variablesErrors" : {"fieldName": "Error message"},
	"compoundServiceErrors" : ["Error message1", "Error message2"],
	"compoundVariableErrors" : ["Error message1", "Error message2"]
}

Fields description:

Field name Type Description
isSuccess Boolean Overall operation result
isNotFound Boolean Object that was requested or involved in operation is not found
serviceErrors Map of field name / error message Dictionary of service errors mapped to field names. Service error means that field value is valid but cannot be used in operation due to more complex requirements
variablesErrors Map of field name / error message Dictionary of service errors mapped to field names or variable errors. This map mostly contains validation errors
compoundServiceErrors Array of error messages List of errors that mostly due to combination of field values (possibly valid by themselves)
compoundVariableErrors Array of error messages List of errors that caused by invalid combination of field values

Hypermedia support

OpenGenesis tries to support hypermedia where it's possible. It means, most of REST GET requests include links array to point user to directions he/she can visit from current point. Structure of link element (links consists of many link) described in table below:

Field Description
href URL that link point to
rel One of following values:
  • `self` - link points to URL requested. These links describes the type of current resources and possible actions user can made on current URL
            <li>`collection` - link points to collection related to a
              current resource.</li>
              
            <li>`logout` - special value</li>
            
            <li>`action` - special value related to environment
            state</li>
            </ul>
       </td>
    </tr>
    <tr>
        <td>
            type
        </td>
        <td>
            Type of resource that link point to. Every type has a
    prefix vnd.griddynamics.genesis. So, for example Project has a
    type `application/vnd.griddynamics.genesis.Project+json`.
        </td>
    </tr>
    <tr>
        <td>
            methods
        </td>
        <td>
            List of HTTP methods allowed for a current user to
    execute on pointed URLs. Sematics is rather traditional:
            <ul>
                <li>`GET` - user can read entity</li>
                <li>`POST` - user can create new entities</li>
                <li>`PUT` - user can update entity</li>
                <li>`DELETE` - user can delete entity</li>
            </ul>
        </td>
    </tr>

Collections links that point to top-level resources may not include full list of methods allowed. In this case user should execute GET for them to look at everything he is allowed to do at this resource.

Clone this wiki locally