-
Notifications
You must be signed in to change notification settings - Fork 10
REST: Environment configuration related API
Note: Terminology in this section can be changes in the future
Configuration is a container for environment specific properties. In a turn, any new created instance must refer to existing configuration. Project always has at least one configuration.
Path: /rest/projects/(projectId)/configs
Type: GET
Path parameters
Parameter | Type | Description |
---|---|---|
projectId | Number | project id of the project configuration belong to |
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":"Default",
"projectId":1,
"description":"",
"items":{},
"links" : [
{
"rel" : "self",
"href" : "http://genesis.example.com/rest/projects/1/configs/1",
"methods" : [
"get",
"put",
"delete"
],
"type" : "application/vnd.griddynamics.genesis.Configuration+json"
}
]
}
],
"links" : [
{
"rel" : "self",
"href" : "http://localhost:8081/rest/projects/1/configs",
"methods" : [
"get",
"post"
],
"type" : "application/vnd.griddynamics.genesis.Configuration+json"
}
]
}
Path: /rest/projects/(projectId)/configs/(configId)
Type: GET
Path parameters:
Parameter | Type | Description |
---|---|---|
projectId | Number | project id of the project configuration belong to |
configId | Number | configuration id |
Example results:
{
"id":1,
"name":"Default",
"projectId":1,
"description":"",
"items":{"foo":"bar"},
"links" : [
{
"rel" : "collection",
"href" : "http://genesis.example.com/rest/projects/1/configs/1/access",
"methods" : [
"get",
"put"
],
"type" : "application/vnd.griddynamics.genesis.Access+json"
},
{
"rel" : "self",
"href" : "http://genesis.example.com/rest/projects/1/configs/1",
"methods" : [
"get",
"put",
"delete"
],
"type" : "application/vnd.griddynamics.genesis.Configuration+json"
}
]
}
##Create configuration
Path: /rest/projects/(projectId)/configs
Type: POST
Path parameters
Parameter | Type | Description |
---|---|---|
projectId | Number | project id of the project configuration belong to |
POST parameters
JSON consisting of:
Parameter | Type | Description |
---|---|---|
name | String | Configuration name (mandatory) |
projectId | Number | identifier of project new configuration belong to (mandatory) |
description | String | Configuration description (optional) |
items | Map[String, String] | Configuration items (optional) |
###Example request
curl http://localhost:8081/rest/projects/1/configs -d '{"name":"Test", "projectId": 1, "description":"Test configuration", "items" : { "foo" : "bar"}}' -H 'Content-type: application/json' -X POST
{"result":
{
"id":1,
"name":"Test",
"projectId":1,
"description":
"Test configuration",
"items":
{"foo":"bar"}
},
"isSuccess":true}
Path: /rest/projects/(projectId)/configs/(configId)
Type: PUT
Path parameters:
Parameter | Type | Description |
---|---|---|
projectId | Integer | Project id |
configId | Integer | Configuration id |
PUT parameters
JSON consisting of:
Parameter | Type | Description |
---|---|---|
name | String | Configuration name (mandatory) |
projectId | Number | identifier of project new configuration belong to (mandatory) |
description | String | Configuration description (optional) |
items | Map[String, String] | Configuration items (optional) |
###Example request
curl http://localhost:8081/rest/projects/1/configs/1 -d '{"name":"Test", "projectId": 1, "description":"Test configuration", "items" : { "foo" : "bar"}}' -H 'Content-type: application/json' -X PUT
{"result":
{
"id":1,
"name":"Test",
"projectId":1,
"description":
"Test configuration",
"items":
{"foo":"bar"}
},
"isSuccess":true}
Path: /rest/projects/(projectId)/configs/(configId)
Type: DELETE
Path parameters:
Parameter | Type | Description |
---|---|---|
projectId | Integer | Project id |
configId | Integer | Configuration id |
curl http://localhost:8081/rest/projects/1/configs/1 -H 'Content-type: application/json' -X DELETE
{
"result":1,
"isSuccess":true
}
It's possible to manage user access to configuration and instances contained in it when environment-level security is on.
Path: /projects/(projectId)/configs/(configId)/access
Type: GET
Path parameters:
Parameter | Type | Description |
---|---|---|
projectId | Integer | Project id |
configId | Integer | Configuration id |
curl http://localhost:8081/rest/projects/1/configs/1/access -H 'Content-type: application/json' -X GET
{
"groups" : [
"test"
],
"users" : [
{
"jobTitle" : "",
"firstName" : "test",
"email" : "test@example.com",
"lastName" : "test",
"username" : "test"
}
],
"links" : [
{
"rel" : "self",
"href" : "http://localhost:8081/rest/projects/1/configs/1/access",
"methods" : [
"get",
"put"
],
"type" : "application/vnd.griddynamics.genesis.Access+json"
}
]
}
Path: /projects/(projectId)/configs/(configId)/access
Type: PUT
Path parameters:
Parameter | Type | Description |
---|---|---|
projectId | Integer | Project id |
configId | Integer | Configuration id |
Parameter | Type | Descrtiption |
---|---|---|
users | Array of strings | User names |
groups | Array of strings | Group names |
curl http://localhost:8081/rest/projects/1/configs/1/access -H 'Content-type: application/json' -X PUT -d '{"users":["user"],"groups":["users"]}'
{
"isSuccess": true,
"result": {
"nonExistentGroups": [
"group"
],
"nonExistentUsers": [
"username"
]
}
}