-
Notifications
You must be signed in to change notification settings - Fork 10
REST: Projects related api
Svyatoslav Reyentenko edited this page Feb 5, 2013
·
15 revisions
Path: /rest/projects
Type: GET
Parameters:
Name | Type | Value | Mandatory | Description |
---|---|---|---|---|
sorting | string | name, ~name | no | Sorting by entity field value. By default ordering direction is ascending. Use prefix '~' to produce result in descending order. |
Example results:
{
"items": [
{
"id":1,
"name":"asd",
"description":"asd",
"projectManager":"asd",
"links":[
{
"href":"http://genesis.example.com/rest/projects/1",
"rel" : "self",
"type" : "application/vnd.griddynamics.genesis.Project+json",
"methods": ["get"]
}
]
}
],
"links":[
{
"href": "http://genesis.example.com/rest/projects",
"rel": "self",
"type": "application/vnd.griddynamics.genesis.Project+json",
"methods": [
"get",
"post"
]
}
]
}
Path: /rest/projects/(projectId)
Type: GET
Path variables: projectId - projectId
Example results:
{
"id": 4,
"name": "Users",
"creator": "genesis",
"creationTime": 1359990891653,
"projectManager": "manager",
"isDeleted": false,
"links": [
{
"href": "http://genesis.example.com/rest/projects/4",
"rel": "self",
"type": "application/vnd.griddynamics.genesis.Project+json",
"methods": [
"get",
"put",
"delete"
]
},
{
"href": "http://genesis.example.com/rest/projects/4/settings",
"rel": "collection",
"type": "application/vnd.griddynamics.genesis.SystemSettings+json",
"methods": [
"get"
]
},
{
"href": "http://genesis.example.com/rest/projects/4/envs",
"rel": "collection",
"type": "application/vnd.griddynamics.genesis.Environment+json",
"methods": [
"get",
"post"
]
}
]
}
Path: /rest/projects/(projectId)/settings
Method: GET
Path parameters: projectId - projectId
{
"links" : [
{
"rel" : "collection",
"href" : "http://genesis.example.com/rest/projects/1/databags",
"methods" : [
"get"
],
"type" : "application/vnd.griddynamics.genesis.DataBag+json"
},
{
"rel" : "collection",
"href" : "http://genesis.example.com/rest/projects/1/credentials",
"methods" : [
"get"
],
"type" : "application/vnd.griddynamics.genesis.Credentials+json"
},
{
"rel" : "collection",
"href" : "http://genesis.example.com/rest/projects/1/server-arrays",
"methods" : [
"get"
],
"type" : "application/vnd.griddynamics.genesis.ServerArray+json"
},
{
"rel" : "collection",
"href" : "http://genesis.example.com/rest/projects/1/template/repository",
"methods" : [
"get"
],
"type" : "application/vnd.griddynamics.genesis.TemplateRepo+json"
},
{
"rel" : "collection",
"href" : "http://genesis.example.com/rest/projects/1/configs",
"methods" : [
"get"
],
"type" : "application/vnd.griddynamics.genesis.Configuration+json"
},
{
"rel" : "collection",
"href" : "http://genesis.example.com/rest/projects/1/envs",
"methods" : [
"get",
"post"
],
"type" : "application/vnd.griddynamics.genesis.Environment+json"
},
{
"rel" : "collection",
"href" : "http://genesis.example.com/rest/projects/1/roles",
"methods" : [
"get"
],
"type" : "application/vnd.griddynamics.genesis.ApplicationRole+json"
}
]
}
Path: /rest/projects
Type: POST
Example results:
Error on creation (common result object):
{
"isSuccess": false,
"isNotFound": false,
"variablesErrors" : {"fieldName": "Error message"},
"compoundServiceErrors" : ["Error message 1", "Error message 2"]
}
Successful creation:
{
"isSuccess": true,
"result" : {
"id": 1,
"name" : "asd!",
"description":"asd",
"projectManager": "asd"
}
}
Input data:
{"name":"asd!","description":"asd","projectManager":"asd"}
Request body is a single JSON map contains the following entries:
Entry name | Type | Mandatory | Description |
---|---|---|---|
name | String | Y | Name of the project |
description | String | В | Description of the project |
projectManager | String(for now) | Y | Person responsible for the project |
Path: /rest/projects/(projectId)
Type: DELETE
Example results: None
Path: /rest/projects/(projectId)
Type: PUT
Example results:
Error on update (common result object):
{
"isSuccess": false,
"isNotFound": false,
"variablesErrors" : {"fieldName": "Error message"},
"compoundServiceErrors" : ["Error message 1", "Error message 2"]
}
Successful creation:
{
"isSuccess": true,
"result" : {
"id": 1,
"name" : "asd!",
"description":"asd",
"projectManager": "asd"
}
}
Request body:
Input data:
{"id":4,"name":"asd!","description":"asd","projectManager":"asd"}
Request body consists form a single JSON map contains the following entries:
Entry name | Type | Mandatory | Description |
---|---|---|---|
id | int | Y | Id of the project |
name | String | Y | Name of the project |
description | String | Y | Description of the project |
projectManager | String | Y | Person responsible for the project |