Synthetics Port tests latest
API for creating, updating, retrieving, and deleting Port tests in Splunk Synthetic Monitoring.
Requirements
- You must have an organization access token with the API permission or a session token to use the API.
- You have to have the Splunk Observability Cloud admin or power role to use the
POST /tests/port/try_now
,POST /tests/port/validate
,PUT /tests/port/{id}/validate
,POST /tests/port
,PUT /tests/port/{id}
, andDELETE /tests/port/{id}
operations. - You have to thave the Splunk Observability Cloud admin, power, or read_only role to use the
GET /tests/port/{id}
operation.
API Base URL
Endpoint URL
Headers
Name | Description |
---|---|
Content-Type Required | string Format of the request body. Always |
X-SF-TOKEN Required | string Authentication token. |
Code Examples
curl -X POST "https://api.{REALM}.signalfx.com/v2/synthetics/tests/port" \
-H "Content-Type: application/json" \
-H "X-SF-TOKEN: <value>" \
-d '{
"test": {
"active": true,
"automaticRetries": 1,
"customProperties": [
Request Body
Properties of a new Port test.
Note: You can't create properties for fields that are marked read-only.
Name | Description |
---|---|
test | object |
Request Examples
{ test: { active: true, automaticRetries: 1, customProperties: [ { key: "Env", value: "production" } ], frequency: 5, host: "splunk.com", locationIds: [ "aws-us-east-1" ], name: "My Port Test", port: 0, protocol: "tcp", schedulingStrategy: "round_robin" }}
Response Body
Successful creation of a test.
Name | Description |
---|---|
test | object |
Response Examples
{ test: { active: true, automaticRetries: 1, createdAt: "2022-09-14T14:35:37.801Z", createdBy: "abcdefgh1234", customProperties: [ { key: "Env", value: "production" } ], frequency: 5, host: "splunk.com", id: 1, lastRunAt: "2022-09-14T14:36:45.156Z", lastRunStatus: "success", locationIds: [ "aws-us-east-1" ], name: "My Port Test", port: 443, protocol: "tcp", schedulingStrategy: "round_robin", type: "http", updatedAt: "2022-09-14T14:35:38.099Z", updatedBy: "abcdefgh1234" }}
Create a port test to use try now on to verify if your test passes. Run results aren't stored.
Requirements
- You must have an organization access token with the API permission or a session token to use the API.
- You need the Splunk Observability Cloud admin or power role.
Headers
Name | Description |
---|---|
Content-Type Required | string Format of the request body. Always |
X-SF-TOKEN Required | string Authentication token. |
Query Parameters
Name | Description |
---|---|
locationId Required | string Example: aws-us-east-1 The ID of the location to run your test from. |
Code Examples
curl -X POST "https://api.{REALM}.signalfx.com/v2/synthetics/tests/port/try_now" \
-H "Content-Type: application/json" \
-H "X-SF-TOKEN: <value>" \
-d '{
"test": {
"active": true,
"automaticRetries": 1,
"customProperties": [
Request Body
Properties of a Port test.
Note: You can't create properties for fields that are marked read-only.
Name | Description |
---|---|
test | object |
Request Examples
{ test: { active: true, automaticRetries: 1, customProperties: [ { key: "Env", value: "production" } ], frequency: 5, host: "splunk.com", locationIds: [ "aws-us-east-1" ], name: "My Port Test", port: 0, protocol: "tcp", schedulingStrategy: "round_robin" }}
Response Body
Successful POST
Name | Description |
---|---|
runId | string <uuid> Example: 1c4d52be-e7e1-4611-97f9-73c6ddfbeed9 The UUID of the generated run |
testId | string <uuid> Example: b8354c68-3fe8-4192-81b2-a4f7cb40e18b The UUID of the try now test |
Response Examples
{ runId: "1c4d52be-e7e1-4611-97f9-73c6ddfbeed9", testId: "b8354c68-3fe8-4192-81b2-a4f7cb40e18b"}
Headers
Name | Description |
---|---|
Content-Type Required | string Format of the request body. Always |
X-SF-TOKEN Required | string Authentication token. |
Code Examples
curl -X POST "https://api.{REALM}.signalfx.com/v2/synthetics/tests/port/validate" \
-H "Content-Type: application/json" \
-H "X-SF-TOKEN: <value>" \
-d '{
"test": {
"active": true,
"automaticRetries": 1,
"customProperties": [
Request Body
Properties of an port test.
Note: You can't create properties for fields that are marked read-only.
Name | Description |
---|---|
test | object |
Request Examples
{ test: { active: true, automaticRetries: 1, customProperties: [ { key: "Env", value: "production" } ], frequency: 5, host: "splunk.com", locationIds: [ "aws-us-east-1" ], name: "My Port Test", port: 0, protocol: "tcp", schedulingStrategy: "round_robin" }}
Response Body
Successful POST
Name | Description |
---|---|
details | object Details of why Port test is invalid. The If the test is valid, this |
message | string Example: Port Test is not valid. |
valid | boolean |
Response Examples
{ details: { frequency: [ "must be greater than or equal to 1" ] }, message: "Port Test is not valid.", valid: false}
Retrieves a single Port test.
Requirements
- You must have an organization access token with the API permission or a session token to use the API.
- You need the Splunk Observability Cloud admin, power, or read_only role.
Headers
Name | Description |
---|---|
X-SF-TOKEN Required | string Authentication token. |
Path Parameters
Name | Description |
---|---|
id Required | string The ID of a Port to retrieve. |
Code Examples
curl -X GET "https://api.{REALM}.signalfx.com/v2/synthetics/tests/port/{id}" \
-H "Content-Type: application/json" \
-H "X-SF-TOKEN: <value>"
Response Body
Successful retrieval of a Port test.
Name | Description |
---|---|
active | boolean Example: true |
automaticRetries | integer Default: 0 Example: 1 Automatically retry if the run fails |
createdAt | string Example: 2022-09-14T14:35:37.801Z Timestamp of when the test was last updated, in UTC. This field is read-only, and the system always sets the value. |
createdBy | string Example: abcdefgh1234 Member ID of who created the test. This field is read-only, and the system always sets the value. |
customProperties | array[object] An array of custom properties. The section Custom Properties Criteria lists the requirements for custom property names and values. |
frequency | integer <int32> Example: 5 How often to run your test. |
host | string Example: splunk.com |
id | integer <int32> Example: 1 |
lastRunAt | string Example: 2022-09-14T14:36:45.156Z Timestamp of when the test was last run, in UTC. This field is read-only, and the system always sets the value. |
lastRunStatus | string Example: success Status of the last test run. |
locationIds | array[string] Example:
An array of location IDs where the test runs. |
name | string Example: My Port Test |
port | integer <int32> Example: 443 |
protocol | string Example: tcp |
schedulingStrategy | string Example: round_robin Type of scheduling strategy. This can only be:
|
type | string Example: http |
updatedAt | string Example: 2022-09-14T14:35:38.099Z Timestamp of when the test was last updated, in UTC. This field is read-only, and the system always sets the value. |
updatedBy | string Example: abcdefgh1234 Member ID of who last updated the test. This field is read-only, and the system always sets the value. |
Response Examples
{ active: true, automaticRetries: 1, createdAt: "2022-09-14T14:35:37.801Z", createdBy: "abcdefgh1234", customProperties: [ { key: "Env", value: "production" } ], frequency: 5, host: "splunk.com", id: 1, lastRunAt: "2022-09-14T14:36:45.156Z", lastRunStatus: "success", locationIds: [ "aws-us-east-1" ], name: "My Port Test", port: 443, protocol: "tcp", schedulingStrategy: "round_robin", type: "http", updatedAt: "2022-09-14T14:35:38.099Z", updatedBy: "abcdefgh1234"}
Update an existing Port test.
Requirements
- You must have an organization access token with the API permission or a session token to use the API.
- You need the Splunk Observability Cloud admin or power role.
Headers
Name | Description |
---|---|
Content-Type Required | string Format of the request body. Always |
X-SF-TOKEN Required | string Authentication token. |
Path Parameters
Name | Description |
---|---|
id Required | integer Example: 1 The ID of the Port test you want to validate. |
Code Examples
curl -X PUT "https://api.{REALM}.signalfx.com/v2/synthetics/tests/port/{id}" \
-H "Content-Type: application/json" \
-H "X-SF-TOKEN: <value>" \
-d '{
"test": {
"active": true,
"automaticRetries": 1,
"customProperties": [
Request Body
Properties of a Port test.
Note: You can't create properties for fields that are marked read-only.
Name | Description |
---|---|
test | object |
Request Examples
{ test: { active: true, automaticRetries: 1, customProperties: [ { key: "Env", value: "production" } ], frequency: 5, host: "splunk.com", locationIds: [ "aws-us-east-1" ], name: "My Port Test", port: 0, protocol: "tcp", schedulingStrategy: "round_robin" }}
Response Body
The response body will be blank
Response Examples
{ code: "not_found", details: {}, message: "Can't find test."}
Headers
Name | Description |
---|---|
X-SF-TOKEN Required | string Authentication token. |
Path Parameters
Name | Description |
---|---|
id Required | string The ID of a test. |
Code Examples
curl -X DELETE "https://api.{REALM}.signalfx.com/v2/synthetics/tests/port/{id}" \
-H "Content-Type: application/json" \
-H "X-SF-TOKEN: <value>"
Response Body
Successful deletion of a test.
Validate an port test. This can also be a PATCH
operation.
Requirements
- You must have an organization access token with the API permission or a session token to use the API.
- You need the Splunk Observability Cloud admin or power role.
Headers
Name | Description |
---|---|
Content-Type Required | string Format of the request body. Always |
X-SF-TOKEN Required | string Authentication token. |
Path Parameters
Name | Description |
---|---|
id Required | integer Example: 1 The ID of the Port test you want to validate. |
Code Examples
curl -X PUT "https://api.{REALM}.signalfx.com/v2/synthetics/tests/port/{id}/validate" \
-H "Content-Type: application/json" \
-H "X-SF-TOKEN: <value>" \
-d '{
"test": {
"active": true,
"automaticRetries": 1,
"customProperties": [
Request Body
Properties of an Port test.
Note: You can't create properties for fields that are marked read-only.
Name | Description |
---|---|
test | object |
Request Examples
{ test: { active: true, automaticRetries: 1, customProperties: [ { key: "Env", value: "production" } ], frequency: 5, host: "splunk.com", locationIds: [ "aws-us-east-1" ], name: "My Port Test", port: 0, protocol: "tcp", schedulingStrategy: "round_robin" }}
Response Body
Successful validation request of a test
Name | Description |
---|---|
details | object Details of why Port test is invalid. The If the test is valid, this |
message | string Example: Port Test is not valid. |
valid | boolean |
Response Examples
{ details: { frequency: [ "must be greater than or equal to 1" ] }, message: "Port Test is not valid.", valid: false}