Parameters
This chapter focuses on services for the parameters.
Get parameter
A GET
to /parameters/{id}
returns the parameter with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the parameter |
HTTP request
GET /api/rest/latest/parameters/47 HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Length: 440
Content-Type: application/json;charset=UTF-8
{
"_type" : "parameter",
"id" : 47,
"name" : "sampleParameter",
"description" : "<p>My parameter</p>",
"test_case" : {
"_type" : "test-case",
"id" : 102,
"name" : "sample test case",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/102"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/parameters/47"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the id of the parameter |
|
|
the type of the entity |
|
|
the name of the parameter |
|
|
the description of the parameter |
|
|
the test case this parameter belongs to |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to this parameter |
Create parameter
A POST
to /parameters
creates a new parameter.
HTTP request
POST /api/rest/latest/parameters HTTP/1.1
Accept: application/json
Content-Length: 164
Content-Type: application/json
Host: localhost:8080
{
"_type" : "parameter",
"name" : "sampleParameter",
"description" : "<p>My parameter</p> ",
"test_case" : {
"_type" : "test-case",
"id" : 102
}
}
HTTP response
HTTP/1.1 201 Created
Content-Length: 522
Content-Type: application/json;charset=UTF-8
{
"_type" : "parameter",
"id" : 47,
"name" : "sampleParameter",
"description" : "<p>My parameter</p>",
"test_case" : {
"_type" : "test-case",
"id" : 102,
"name" : "sample test case",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/102"
}
}
},
"_links" : {
"self" : [ {
"href" : "http://localhost:8080/api/rest/latest/parameters/47"
}, {
"href" : "http://localhost:8080/api/rest/latest/parameters/47"
} ]
}
}
Modify parameter
A Patch
to /parameters/{id}
modifies the parameter with the given id. You can modify name and/or description.
Path parameters
Parameter | Description |
---|---|
|
the id of the parameter |
HTTP request
PATCH /api/rest/latest/parameters/47 HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: localhost:8080
Content-Length: 113
{
"_type" : "parameter",
"name" : "Update-sampleParameter",
"description" : "<p>Update My parameter</p> "
}
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 536
{
"_type" : "parameter",
"id" : 47,
"name" : "Update-sampleParameter",
"description" : "<p>Update My parameter</p>",
"test_case" : {
"_type" : "test-case",
"id" : 102,
"name" : "sample test case",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/102"
}
}
},
"_links" : {
"self" : [ {
"href" : "http://localhost:8080/api/rest/latest/parameters/47"
}, {
"href" : "http://localhost:8080/api/rest/latest/parameters/47"
} ]
}
}
Delete parameter
A DELETE
to /parameters/{id}
deletes one parameter with the given id.
Path parameters
Parameter | Description |
---|---|
|
the list of id of the parameter |
HTTP request
DELETE /api/rest/latest/parameters/169 HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: localhost:8080