Python
from openlayer import Openlayer
client = Openlayer()
response = client.projects.tests.update(
"3fa85f64-5717-4562-b3fc-2c963f66afa6",
payloads=[
{
"id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
"name": "No duplicate rows",
"thresholds": [
{
"insight_name": "duplicateRowCount",
"measurement": "duplicateRowCount",
"operator": "<=",
"value": 5,
}
],
}
],
)
print(response.task_result_id)import Openlayer from 'openlayer';
const client = new Openlayer();
const response = await client.projects.tests.update('3fa85f64-5717-4562-b3fc-2c963f66afa6', {
payloads: [
{
id: '9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d',
name: 'No duplicate rows',
archived: false,
},
],
});
console.log(response);
package main
import (
"context"
"fmt"
"github.com/openlayer-ai/openlayer-go"
)
client := openlayer.NewClient()
task, err := client.Projects.Tests.Update(
context.TODO(),
"3fa85f64-5717-4562-b3fc-2c963f66afa6",
openlayer.ProjectTestUpdateParams{
Payloads: openlayer.F([]openlayer.ProjectTestUpdateParamsPayload{{
ID: openlayer.F("9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d"),
Name: openlayer.F("No duplicate rows (strict)"),
Archived: openlayer.F(false),
}}),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", task.TaskResultID)
import com.openlayer.api.client.OpenlayerClient;
import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
import com.openlayer.api.models.projects.tests.TestUpdateParams;
import com.openlayer.api.models.projects.tests.TestUpdateResponse;
OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();
TestUpdateParams params = TestUpdateParams.builder()
.projectId("3fa85f64-5717-4562-b3fc-2c963f66afa6")
.addPayload(TestUpdateParams.Payload.builder()
.id("9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d")
.name("No duplicate rows")
.archived(false)
.build())
.build();
TestUpdateResponse response = client.projects().tests().update(params);
require "openlayer"
openlayer = Openlayer::Client.new(api_key: ENV["OPENLAYER_API_KEY"])
response = openlayer.projects.tests.update(
"3fa85f64-5717-4562-b3fc-2c963f66afa6",
payloads: [{id: "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d", name: "No duplicate rows", archived: false}]
)
puts(response)
curl --request PUT \
--url https://api.openlayer.com/v1/projects/3fa85f64-5717-4562-b3fc-2c963f66afa6/tests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"payloads": [
{
"id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
"name": "No PII in responses",
"archived": false
}
]
}'
{
"taskResultUrl": "<string>",
"taskResultId": "<string>"
}{
"code": 123,
"error": "<string>"
}Tests
Update tests
Update tests in a project.
Python
from openlayer import Openlayer
client = Openlayer()
response = client.projects.tests.update(
"3fa85f64-5717-4562-b3fc-2c963f66afa6",
payloads=[
{
"id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
"name": "No duplicate rows",
"thresholds": [
{
"insight_name": "duplicateRowCount",
"measurement": "duplicateRowCount",
"operator": "<=",
"value": 5,
}
],
}
],
)
print(response.task_result_id)import Openlayer from 'openlayer';
const client = new Openlayer();
const response = await client.projects.tests.update('3fa85f64-5717-4562-b3fc-2c963f66afa6', {
payloads: [
{
id: '9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d',
name: 'No duplicate rows',
archived: false,
},
],
});
console.log(response);
package main
import (
"context"
"fmt"
"github.com/openlayer-ai/openlayer-go"
)
client := openlayer.NewClient()
task, err := client.Projects.Tests.Update(
context.TODO(),
"3fa85f64-5717-4562-b3fc-2c963f66afa6",
openlayer.ProjectTestUpdateParams{
Payloads: openlayer.F([]openlayer.ProjectTestUpdateParamsPayload{{
ID: openlayer.F("9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d"),
Name: openlayer.F("No duplicate rows (strict)"),
Archived: openlayer.F(false),
}}),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", task.TaskResultID)
import com.openlayer.api.client.OpenlayerClient;
import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
import com.openlayer.api.models.projects.tests.TestUpdateParams;
import com.openlayer.api.models.projects.tests.TestUpdateResponse;
OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();
TestUpdateParams params = TestUpdateParams.builder()
.projectId("3fa85f64-5717-4562-b3fc-2c963f66afa6")
.addPayload(TestUpdateParams.Payload.builder()
.id("9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d")
.name("No duplicate rows")
.archived(false)
.build())
.build();
TestUpdateResponse response = client.projects().tests().update(params);
require "openlayer"
openlayer = Openlayer::Client.new(api_key: ENV["OPENLAYER_API_KEY"])
response = openlayer.projects.tests.update(
"3fa85f64-5717-4562-b3fc-2c963f66afa6",
payloads: [{id: "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d", name: "No duplicate rows", archived: false}]
)
puts(response)
curl --request PUT \
--url https://api.openlayer.com/v1/projects/3fa85f64-5717-4562-b3fc-2c963f66afa6/tests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"payloads": [
{
"id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
"name": "No PII in responses",
"archived": false
}
]
}'
{
"taskResultUrl": "<string>",
"taskResultId": "<string>"
}{
"code": 123,
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your workspace API key. See Find your API key for more information.
Path Parameters
The project id.
Body
application/json
Show child attributes
Show child attributes
Was this page helpful?