mirror of
https://github.com/thousandeyes/thousandeyes-sdk-python.git
synced 2026-08-04 08:56:50 +00:00
Sync OAS-driven integration test artifacts (mock manifest, test base, conftest, and per-operation integration tests) across 21 packages for CP-2453 full rollout evaluation. Co-authored-by: Cursor <cursoragent@cursor.com>
500 lines
17 KiB
Python
500 lines
17 KiB
Python
# coding: utf-8
|
|
|
|
"""
|
|
Endpoint Instant Scheduled Tests API
|
|
|
|
You can create and execute a new endpoint instant scheduled test within ThousandEyes using this API. The test parameters are specified in the `POST` data. The following applies to the Endpoint Instant Scheduled Tests API: * To initiate the creation and execution of an instant scheduled test, the user must possess the `Edit endpoint tests` permission. * Upon successful creation of an instant scheduled test, the API responds with an HTTP/201 CREATED status code and return the test definition. * It's important to note that the response does not include the results of the instant scheduled test. To retrieve test results, users can utilize the Endpoint Test Data endpoints. The URLs for these API test data endpoints are provided within the test definition output when an instant scheduled test is created.
|
|
|
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
|
|
Do not edit the class manually.
|
|
""" # noqa: E501
|
|
|
|
|
|
import json
|
|
|
|
from sdk_test_support.mock_server_types import ErrorResponseExpectation, OperationExpectation
|
|
|
|
OPERATION_MANIFEST = {
|
|
|
|
"create_agent_to_server_scheduled_instant_test": OperationExpectation(
|
|
operation_id="create_agent_to_server_scheduled_instant_test",
|
|
method="POST",
|
|
path="/endpoint/tests/scheduled-tests/agent-to-server/instant",
|
|
path_param_examples={
|
|
},
|
|
success_status=201,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"server" : "www.example.com",
|
|
"isSavedEvent" : false,
|
|
"_links" : {
|
|
"testResults" : [ {
|
|
"href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"
|
|
}, {
|
|
"href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"
|
|
} ],
|
|
"self" : {
|
|
"hreflang" : "hreflang",
|
|
"templated" : true,
|
|
"profile" : "profile",
|
|
"name" : "name",
|
|
"href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
|
|
"type" : "type",
|
|
"deprecation" : "deprecation",
|
|
"title" : "title"
|
|
}
|
|
},
|
|
"isPrioritized" : false,
|
|
"networkMeasurements" : true,
|
|
"type" : "agent-to-server",
|
|
"tcpProbeMode" : "auto",
|
|
"labels" : [ {
|
|
"labelId" : "961",
|
|
"name" : "Artem label",
|
|
"isBuiltin" : false
|
|
}, {
|
|
"labelId" : "961",
|
|
"name" : "Artem label",
|
|
"isBuiltin" : false
|
|
} ],
|
|
"protocol" : "icmp",
|
|
"createdDate" : "2022-07-17T22:00:54Z",
|
|
"ipVersion" : "V4_ONLY",
|
|
"port" : 443,
|
|
"isEnabled" : true,
|
|
"modifiedDate" : "2022-07-17T22:00:54Z",
|
|
"interval" : 60,
|
|
"testId" : "281474976710706",
|
|
"aid" : "1234",
|
|
"agentSelectorConfig" : {
|
|
"agentSelectorType" : "all-agents",
|
|
"maxMachines" : 25
|
|
},
|
|
"hasPathTraceInSession" : true,
|
|
"testName" : "Test name"
|
|
}
|
|
|
|
"""),
|
|
|
|
success_content_type="application/json",
|
|
|
|
request_body_example=json.loads("""
|
|
|
|
{
|
|
"server" : "www.example.com",
|
|
"ipVersion" : "V4_ONLY",
|
|
"port" : 443,
|
|
"agentSelectorType" : "all-agents",
|
|
"tagIds" : [ "c6b78e57-81a2-4c5f-a11a-d96c3c664d55", "5aeab5d5-0d34-4d44-a7ac-fb440185295c" ],
|
|
"maxMachines" : 25,
|
|
"serverName" : "www.example.com",
|
|
"endpointAgentLabels" : [ "567", "214" ],
|
|
"agents" : [ "0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1", "66eec0f1-72b4-4755-aa83-3aed61d17f3c" ],
|
|
"testName" : "Test name"
|
|
}
|
|
|
|
"""),
|
|
error_responses={
|
|
|
|
"400": ErrorResponseExpectation(
|
|
status=400,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"errors" : [ {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
}, {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
} ],
|
|
"status" : 0
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"401": ErrorResponseExpectation(
|
|
status=401,
|
|
body=json.loads("""
|
|
{
|
|
"error_description" : "Invalid access token",
|
|
"error" : "invalid_token"
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"403": ErrorResponseExpectation(
|
|
status=403,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"429": ErrorResponseExpectation(
|
|
status=429,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"500": ErrorResponseExpectation(
|
|
status=500,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"502": ErrorResponseExpectation(
|
|
status=502,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"create_http_server_scheduled_instant_test": OperationExpectation(
|
|
operation_id="create_http_server_scheduled_instant_test",
|
|
method="POST",
|
|
path="/endpoint/tests/scheduled-tests/http-server/instant",
|
|
path_param_examples={
|
|
},
|
|
success_status=201,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"server" : "www.example.com",
|
|
"isSavedEvent" : false,
|
|
"sslVersion" : "Auto",
|
|
"useNtlm" : false,
|
|
"_links" : {
|
|
"testResults" : [ {
|
|
"href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"
|
|
}, {
|
|
"href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"
|
|
} ],
|
|
"self" : {
|
|
"hreflang" : "hreflang",
|
|
"templated" : true,
|
|
"profile" : "profile",
|
|
"name" : "name",
|
|
"href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
|
|
"type" : "type",
|
|
"deprecation" : "deprecation",
|
|
"title" : "title"
|
|
}
|
|
},
|
|
"isPrioritized" : false,
|
|
"httpTimeLimit" : 5000,
|
|
"type" : "http-server",
|
|
"protocol" : "icmp",
|
|
"httpVersion" : 2,
|
|
"followRedirects" : true,
|
|
"authType" : "none",
|
|
"testName" : "Test name",
|
|
"verifyCertificate" : true,
|
|
"networkMeasurements" : true,
|
|
"tcpProbeMode" : "auto",
|
|
"url" : "https://example.com:443",
|
|
"labels" : [ {
|
|
"labelId" : "961",
|
|
"name" : "Artem label",
|
|
"isBuiltin" : false
|
|
}, {
|
|
"labelId" : "961",
|
|
"name" : "Artem label",
|
|
"isBuiltin" : false
|
|
} ],
|
|
"createdDate" : "2022-07-17T22:00:54Z",
|
|
"ipVersion" : "V4_ONLY",
|
|
"port" : 443,
|
|
"isEnabled" : true,
|
|
"modifiedDate" : "2022-07-17T22:00:54Z",
|
|
"interval" : 60,
|
|
"testId" : "281474976710706",
|
|
"aid" : "1234",
|
|
"agentSelectorConfig" : {
|
|
"agentSelectorType" : "all-agents",
|
|
"maxMachines" : 25
|
|
},
|
|
"hasPathTraceInSession" : true,
|
|
"httpTargetTime" : 100,
|
|
"username" : "username",
|
|
"sslVersionId" : "0"
|
|
}
|
|
|
|
"""),
|
|
|
|
success_content_type="application/json",
|
|
|
|
request_body_example=json.loads("""
|
|
|
|
{
|
|
"verifyCertificate" : true,
|
|
"hasPing" : true,
|
|
"agentSelectorType" : "all-agents",
|
|
"tagIds" : [ "c6b78e57-81a2-4c5f-a11a-d96c3c664d55", "5aeab5d5-0d34-4d44-a7ac-fb440185295c" ],
|
|
"maxMachines" : 25,
|
|
"httpTimeLimit" : 5000,
|
|
"networkMeasurements" : true,
|
|
"endpointAgentLabels" : [ "567", "214" ],
|
|
"tcpProbeMode" : "auto",
|
|
"url" : "https://example.com:443",
|
|
"agents" : [ "0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1", "66eec0f1-72b4-4755-aa83-3aed61d17f3c" ],
|
|
"protocol" : "icmp",
|
|
"password" : "password",
|
|
"ipVersion" : "V4_ONLY",
|
|
"hasTraceroute" : true,
|
|
"targetResponseTime" : 1000,
|
|
"authType" : "none",
|
|
"hasPathTraceInSession" : true,
|
|
"testName" : "Test name",
|
|
"username" : "username",
|
|
"sslVersionId" : "0"
|
|
}
|
|
|
|
"""),
|
|
error_responses={
|
|
|
|
"400": ErrorResponseExpectation(
|
|
status=400,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"errors" : [ {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
}, {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
} ],
|
|
"status" : 0
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"401": ErrorResponseExpectation(
|
|
status=401,
|
|
body=json.loads("""
|
|
{
|
|
"error_description" : "Invalid access token",
|
|
"error" : "invalid_token"
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"403": ErrorResponseExpectation(
|
|
status=403,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"429": ErrorResponseExpectation(
|
|
status=429,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"500": ErrorResponseExpectation(
|
|
status=500,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"502": ErrorResponseExpectation(
|
|
status=502,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
"run_endpoint_scheduled_instant_test": OperationExpectation(
|
|
operation_id="run_endpoint_scheduled_instant_test",
|
|
method="POST",
|
|
path="/endpoint/tests/scheduled-tests/{testId}/run",
|
|
path_param_examples={
|
|
"testId": '765231567',
|
|
},
|
|
success_status=200,
|
|
success_body=json.loads("""
|
|
|
|
{
|
|
"message" : "Successfully reran the instant scheduled test with testId=765231567"
|
|
}
|
|
|
|
"""),
|
|
|
|
success_content_type="application/json",
|
|
|
|
request_body_example=None,
|
|
error_responses={
|
|
|
|
"400": ErrorResponseExpectation(
|
|
status=400,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"errors" : [ {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
}, {
|
|
"code" : "code",
|
|
"field" : "field",
|
|
"message" : "message"
|
|
} ],
|
|
"status" : 0
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"401": ErrorResponseExpectation(
|
|
status=401,
|
|
body=json.loads("""
|
|
{
|
|
"error_description" : "Invalid access token",
|
|
"error" : "invalid_token"
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"403": ErrorResponseExpectation(
|
|
status=403,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"404": ErrorResponseExpectation(
|
|
status=404,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"429": ErrorResponseExpectation(
|
|
status=429,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"500": ErrorResponseExpectation(
|
|
status=500,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
"502": ErrorResponseExpectation(
|
|
status=502,
|
|
body=json.loads("""
|
|
{
|
|
"instance" : "instance",
|
|
"detail" : "detail",
|
|
"type" : "type",
|
|
"title" : "title",
|
|
"status" : 6
|
|
}"""),
|
|
content_type="application/json",
|
|
),
|
|
|
|
},
|
|
),
|
|
|
|
}
|