{ "openapi": "3.0.1", "info": { "title": "Interoperability Test Bed REST API", "description": "REST API for machine-to-machine integration with the Test Bed.", "contact": { "email": "${contactEmail}" }, "version": "${version}" }, "externalDocs": { "description": "Test Bed user guide.", "url": "${userGuideAddress}" }, "servers": [ { "url": "${apiUrl}" } ], "tags": [ { "name": "Test sessions", "description": "Operations on test sessions." }, { "name": "Test suites", "description": "Operations on test suites." } ], "paths": { "/tests/start": { "post": { "tags": [ "Test sessions" ], "summary": "Launch one or more test sessions.", "security": [ { "OrganisationApiKeyAuth": [] } ], "requestBody": { "description": "Information on the test session(s) to start.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionStartRequest" } } }, "required": true }, "responses": { "200": { "description": "Test session(s) successfully created.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionStartResponse" } } } }, "400": { "description": "The received request was invalid.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorInformation" } } } } } } }, "/tests/status": { "post": { "tags": [ "Test sessions" ], "summary": "Query the status, logs and results of one or more test sessions.", "security": [ { "OrganisationApiKeyAuth": [] } ], "requestBody": { "description": "Query parameters and information options for the test sessions to lookup.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionStatusRequest" } } }, "required": true }, "responses": { "200": { "description": "Test sessions' status successfully returned.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionStatusResponse" } } } }, "400": { "description": "The received request was invalid.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorInformation" } } } } } } }, "/tests/stop": { "post": { "tags": [ "Test sessions" ], "summary": "Stop one or more test sessions.", "security": [ { "OrganisationApiKeyAuth": [] } ], "requestBody": { "description": "The test sessions to stop.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionStopRequest" } } }, "required": true }, "responses": { "200": { "description": "Test session(s) successfully stopped.", "content": {} }, "400": { "description": "The received request was invalid.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorInformation" } } } } } } }, "/tests/report/{sessionId}": { "get": { "tags": [ "Test sessions" ], "summary": "Retrieve a test session report in the GITB TRL XML format.", "security": [ { "OrganisationApiKeyAuth": [] } ], "parameters": [ { "description": "The identifier of the test session of which the report is requested.", "in": "path", "name": "sessionId", "schema": { "type": "string" }, "required": true } ], "responses": { "200": { "description": "Report successfully created.", "content": { "application/xml": { "schema": { "$ref": "#/components/schemas/TestCaseOverviewReport" } } } }, "400": { "description": "The received request was invalid.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorInformation" } } } }, "404": { "description": "No test session was not found matching the provided identifier." } } } }, "/testsuite/deploy": { "post": { "tags": [ "Test suites" ], "summary": "Deploy a test suite to a specification.", "security": [ { "CommunityApiKeyAuth": [] } ], "requestBody": { "description": "The test suite archive to deploy and the deployment's parameters.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TestSuiteDeployViaBase64Request" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/TestSuiteDeployViaFileRequest" }, "encoding": { "testSuite": { "contentType": "application/zip" } } } }, "required": true }, "responses": { "200": { "description": "Test suite deployed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TestSuiteDeployResponse" } } } }, "400": { "description": "The received request was invalid.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorInformation" } } } } } } }, "/testsuite/undeploy": { "post": { "tags": [ "Test suites" ], "summary": "Undeploy an existing test suite.", "security": [ { "CommunityApiKeyAuth": [] } ], "requestBody": { "description": "Information on the test suite to be undeployed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TestSuiteUndeployRequest" } } }, "required": true }, "responses": { "200": { "description": "Test suite successfully undeployed.", "content": {} }, "400": { "description": "The received request was invalid.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorInformation" } } } } } } } }, "components": { "schemas": { "SessionStartRequest": { "description": "Information on the test session(s) to start.", "type": "object", "properties": { "system": { "description": "The API KEY identifying the target system.", "type": "string" }, "actor": { "description": "The API KEY identifying the target actor.", "type": "string" }, "forceSequentialExecution": { "description": "Whether the test sessions should be forced to execute sequentially.", "type": "boolean", "default": false }, "testSuite": { "description": "The identifier(s) of the test suites to execute.", "type": "array", "items": { "type": "string" } }, "testCase": { "description": "The identifier(s) of the test cases to execute.", "type": "array", "items": { "type": "string" } }, "inputMapping": { "description": "Inputs to provide to test sessions. These can be applied to all test sessions, or certain test sessions identified by their relevant test case or test suite identifiers.", "type": "array", "items": { "$ref": "#/components/schemas/InputMapping" } } }, "required": [ "system", "actor" ], "additionalProperties": false }, "InputMapping": { "description": "Data relevant to an input provided to create one or more test sessions.", "type": "object", "properties": { "testSuite": { "description": "The identifiers of the test suite for which this input is to be provided.", "type": "array", "items": { "type": "string" } }, "testCase": { "description": "The identifiers of the test case for which this input is to be provided.", "type": "array", "items": { "type": "string" } }, "input": { "$ref": "#/components/schemas/AnyContent" } }, "required": [ "input" ], "additionalProperties": false }, "AnyContent": { "description": "The data and metadata relevant to a given test session input.", "type": "object", "properties": { "name": { "description": "The name of the input through which it is referenced in test cases.", "type": "string" }, "embeddingMethod": { "description": "The way in which the value of the input is to be interpreted (as the actual string value, as a Base64-encoded string or as a remote URI location).", "type": "string", "enum": [ "STRING", "BASE64", "URI" ], "default": "STRING" }, "value": { "description": "The value of the input provided as a string, to be interpreted based on the embeddingMethod input. This may be missing in case of a complex type (list or map).", "type": "string" }, "type": { "description": "The data type of this input.", "type": "string", "enum": [ "string", "number", "boolean", "binary", "object", "schema", "map", "list" ], "default": "string" }, "encoding": { "type": "string" }, "item": { "description": "In case this is a complex data type (list or map) this is the array of child (contained) types.", "type": "array", "items": { "$ref": "#/components/schemas/AnyContent" } } }, "additionalProperties": false }, "SessionStartResponse": { "description": "Information on the created test sessions.", "type": "object", "properties": { "createdSessions": { "description": "Information on the created test session(s).", "type": "array", "items": { "$ref": "#/components/schemas/SessionCreationInformation" } } }, "required": [ "createdSessions" ], "additionalProperties": false }, "SessionStatusRequest": { "type": "object", "description": "Query parameters and information options for the test sessions to lookup.", "additionalProperties": false, "required": [ "session" ], "properties": { "session": { "description": "The session identifier(s) to look up.", "type": "array", "items": { "type": "string" } }, "withLogs": { "description": "Whether or not the log output for each session should be returned.", "type": "boolean", "default": false }, "withReports": { "description": "Whether or not the XML test case report should be returned.", "type": "boolean", "default": false } } }, "SessionStatusResponse": { "description": "Response for the test session status operation.", "type": "object", "properties": { "sessions": { "description": "The list of status information for retrieved test sessions.", "type": "array", "items": { "$ref": "#/components/schemas/SessionStatus" } } }, "required": [ "sessions" ], "additionalProperties": false }, "SessionStopRequest": { "description": "Request to stop one or more test sessions.", "type": "object", "properties": { "session": { "description": "The identifier(s) of the test session(s) to stop.", "type": "array", "items": { "description": "Test session identifier.", "type": "string" } } }, "required": [ "session" ], "additionalProperties": false }, "SessionCreationInformation": { "description": "The metadata for a created test session.", "type": "object", "properties": { "testSuite": { "description": "The identifier of the test session's relevant test suite.", "type": "string" }, "testCase": { "description": "The identifier of the test session's relevant test case.", "type": "string" }, "session": { "description": "The identifier assigned to the test session.", "type": "string" } }, "required": [ "testSuite", "testCase", "session" ], "additionalProperties": false }, "TestSuiteDeployViaFileRequest": { "description": "Information on the test suite to deploy when the call is made as a multipart form submission.", "allOf": [ { "$ref": "#/components/schemas/BaseTestSuiteDeployRequest" }, { "type": "object", "properties": { "testSuite": { "description": "The test suite archive to deploy.", "type": "string", "format": "binary" }, "testCaseWithSpecificationUpdate": { "description": "Test case identifiers for which their definition will be updated.", "type": "array", "items": { "type": "string" } }, "testCaseWithoutSpecificationUpdate": { "description": "Test case identifiers for which their definition will be not updated.", "type": "array", "items": { "type": "string" } }, "testCaseWithTestHistoryReplacement": { "description": "Test case identifiers for which their testing history will be reset.", "type": "array", "items": { "type": "string" } }, "testCaseWithoutTestHistoryReplacement": { "description": "Test case identifiers for which their testing history will be not reset.", "type": "array", "items": { "type": "string" } } }, "required": [ "testSuite" ] } ] }, "TestSuiteDeployViaBase64Request": { "description": "Information on the test suite to deploy when the call is made as JSON.", "allOf": [ { "$ref": "#/components/schemas/BaseTestSuiteDeployRequest" }, { "type": "object", "properties": { "testSuite": { "description": "The test suite archive to deploy provided as a Base64-encoded string.", "type": "string", "format": "base64" }, "testCases": { "description": "Update choices for specific test cases.", "type": "array", "items": { "$ref": "#/components/schemas/TestCaseDeploymentAction" } } }, "required": [ "testSuite" ] } ] }, "BaseTestSuiteDeployRequest": { "description": "Common information on the test suite to deploy.", "type": "object", "properties": { "specification": { "description": "The API KEY identifying the target specification.", "type": "string" }, "ignoreWarnings": { "description": "Whether test suite validation warnings should be ignored.", "type": "boolean", "default": false }, "replaceTestHistory": { "description": "Whether the test history linked to the test suite's test cases should be reset. This is the default setting to consider if no test case specific options are defined.", "type": "boolean", "default": false }, "updateSpecification": { "description": "Whether the specification's metadata should be updated using the provided test suite's content. For test cases' metadata this setting will be considered as the default, if no test case specific options are defined.", "type": "boolean", "default": false } }, "required": [ "specification" ], "additionalProperties": false }, "TestSuiteDeployResponse": { "description": "Response for the test session deploy operation.", "type": "object", "properties": { "completed": { "description": "Whether or not the deployment was completed.", "type": "boolean" }, "errors": { "description": "The list of errors resulting from the test suite's validation.", "type": "array", "items": { "$ref": "#/components/schemas/TestSuiteValidationReportItem" } }, "warnings": { "description": "The list of warnings resulting from the test suite's validation.", "type": "array", "items": { "$ref": "#/components/schemas/TestSuiteValidationReportItem" } }, "messages": { "description": "The list of information messages resulting from the test suite's validation.", "type": "array", "items": { "$ref": "#/components/schemas/TestSuiteValidationReportItem" } } }, "required": [ "completed" ], "additionalProperties": false }, "TestCaseDeploymentAction": { "description": "Deployment choices for a given test case.", "type": "object", "properties": { "identifier": { "description": "The test case identifier.", "type": "string" }, "updateSpecification": { "description": "Whether the metadata for this test case should be updated.", "type": "boolean", "default": false }, "replaceTestHistory": { "description": "Whether the testing history for this test case should be reset.", "type": "boolean", "default": false } } }, "TestSuiteValidationReportItem": { "description": "A test suite validation report finding.", "type": "object", "properties": { "description": { "description": "The finding's description.", "type": "string" }, "location": { "description": "The path of the resource within the test suite that resulted in this finding.", "type": "string" } }, "required": [ "description" ], "additionalProperties": false }, "TestSuiteUndeployRequest": { "description": "Request to undeploy a given test suite.", "type": "object", "properties": { "specification": { "description": "The API key value to uniquely identify the specification from which the test suite will be undeployed from.", "type": "string" }, "testSuite": { "description": "The identifier of the test suite that will be undeployed.", "type": "string" } }, "required": [ "specification", "testSuite" ], "additionalProperties": false }, "ErrorInformation": { "description": "Information on an encountered error.", "type": "object", "properties": { "error_code": { "description": "The code used to identify the type of error encountered.", "type": "string" }, "error_description": { "description": "The description of the error.", "type": "string" }, "error_id": { "description": "An optional error identifier to refer to the specific error in logs.", "type": "string" } }, "required": [ "error_code", "error_description" ], "additionalProperties": false }, "SessionStatus": { "description": "Status information for a test session.", "type": "object", "properties": { "session": { "description": "The session's unique identifier.", "type": "string" }, "result": { "description": "The session's result.", "type": "string", "enum": [ "SUCCESS", "FAILURE", "UNDEFINED" ] }, "startTime": { "description": "The session start time.", "type": "string", "format": "yyyy-MM-ddTHH:mm:ssZ" }, "endTime": { "description": "The session end time (if the session is completed).", "type": "string", "format": "yyyy-MM-ddTHH:mm:ssZ" }, "message": { "description": "The resulting output message of the session.", "type": "string" }, "logs": { "description": "The list of log entries produced by the session.", "type": "array", "items": { "type": "string" } }, "report": { "description": "The test session's XML report.", "type": "string" } }, "required": [ "session", "result", "startTime" ], "additionalProperties": false }, "TestCaseOverviewReport": { "description": "XML test case report for a given test session.", "type": "object", "required": [ "id", "startTime", "result" ], "properties": { "id": { "description": "The relevant test case's identifier.", "type": "string", "xml": { "attribute": true } }, "metadata": { "description": "Metadata about the relevant test case.", "type": "object", "required": [ "name" ], "properties": { "name": { "description": "The test case's name.", "type": "string" }, "description": { "description": "The test case's description.", "type": "string" } } }, "startTime": { "description": "The test session's start time.", "type": "string", "format": "yyyy-MM-ddTHH:mm:ss.SSSZ" }, "endTime": { "description": "The test session's end time.", "type": "string", "format": "yyyy-MM-ddTHH:mm:ss.SSSZ" }, "result": { "description": "The test session's overall result.", "type": "string", "enum": [ "SUCCESS", "FAILURE", "UNDEFINED" ] }, "message": { "description": "The resulting output message of the session.", "type": "string" }, "steps": { "description": "The test step reports.", "type": "array", "items": { "type": "object", "minLength": 0, "properties": { "step": { "description": "The report for a specific step.", "type": "object", "required": [ "id", "report" ], "properties": { "id": { "description": "The test step's identifier'.", "type": "string", "xml": { "attribute": true } }, "report": { "description": "The test step's report.", "type": "object", "properties": { "id": { "description": "The test step's identifier'.", "type": "string", "xml": { "attribute": true } }, "date": { "description": "The test step's completion date.", "type": "string", "format": "yyyy-MM-ddTHH:mm:ss.SSSZ" }, "result": { "description": "The test step's result.", "type": "string", "enum": [ "SUCCESS", "FAILURE", "WARNING", "UNDEFINED" ] }, "reports": { "description": "The test step's report items.", "type": "object", "properties": { "error": { "description": "A step error.", "type": "array", "items": { "oneOf": [ { "$ref": "#/components/schemas/ReportItem" } ] } }, "warning": { "description": "A step warning.", "type": "array", "items": { "oneOf": [ { "$ref": "#/components/schemas/ReportItem" } ] } }, "info": { "description": "A step information message.", "type": "array", "items": { "oneOf": [ { "$ref": "#/components/schemas/ReportItem" } ] } } } } } } } } } } } } }, "ReportItem": { "description": "Details of a specific test step report item.", "type": "object", "properties": { "assertionID": { "description": "The identifier of an assertion linked to the relevant rule.", "type": "string" }, "description": { "description": "The message produced by the relevant rule.", "type": "string" }, "location": { "description": "The location in the processed content relevant to this finding.", "type": "string" }, "test": { "description": "The test that was executed.", "type": "string" }, "type": { "description": "The type of test carried out.", "type": "string" }, "value": { "description": "The detected value that lead to the finding being reported.", "type": "string" } }, "required": [ "description" ] } }, "securitySchemes": { "OrganisationApiKeyAuth": { "description": "The API key to identify a specific organisation.", "type": "apiKey", "in": "header", "name": "ITB_API_KEY" }, "CommunityApiKeyAuth": { "description": "The API key to identify a specific community.", "type": "apiKey", "in": "header", "name": "ITB_API_KEY" } } } }