openapi: "3.0.1" info: description: "This is the Traffic Parrot HTTP Management API documentation." version: "5.8.x" title: "Traffic Parrot HTTP Management API" contact: email: "support@trafficparrot.com" externalDocs: description: "Find out more" url: "https://trafficparrot.com/documentation/5.8.x" tags: - name: "localhost:8080/api" description: "Traffic Parrot REST API" externalDocs: description: "Find out more" url: "https://trafficparrot.com/documentation/5.8.x" - name: "localhost:8080/api/http/*" description: "Traffic Parrot HTTP component is based on WireMock 2.10.1" externalDocs: description: "Find out more" url: "http://wiremock.org/docs/api" - name: "localhost:8080/http/management" description: "Traffic Parrot HTTP management commands" externalDocs: description: "Find out more" url: "https://trafficparrot.com/documentation/5.8.x/http.html" - name: "localhost:8080/ibmMq" description: "IBM® WebSphere MQ" externalDocs: description: "Find out more" url: "https://trafficparrot.com/documentation/5.8.x/ibmmq.html" - name: "localhost:8080/jms" description: "Java Message Service" externalDocs: description: "Find out more" url: "https://trafficparrot.com/documentation/5.8.x/jms.html" - name: "localhost:8080/fileMessage" description: "File Messages" externalDocs: description: "Find out more" url: "https://trafficparrot.com/documentation/5.8.x/filemessage.html" paths: /api/scenarios: servers: - url: "http://localhost:8080" get: tags: - "localhost:8080/api" summary: "Get all test scenarios" responses: 200: description: "OK" content: 'application/vnd.trafficparrot.scenarios.v1+json': schema: type: array items: $ref: "#/components/schemas/Scenario" /api/scenarios/{name}: put: tags: - "localhost:8080/api" summary: "Create or update test scenario" parameters: - in: path name: name required: true schema: type: string requestBody: required: true content: 'application/vnd.trafficparrot.scenarios.v1+json': schema: $ref: "#/components/schemas/ScenarioUpdate" responses: 200: description: "OK" content: 'application/vnd.trafficparrot.scenarios.v1+json': schema: $ref: "#/components/schemas/Scenario" /api/state: delete: tags: - "localhost:8080/api" summary: "Delete all state variables across all namespaces" responses: 204: description: "OK" /api/state/global/{name}: get: tags: - "localhost:8080/api" summary: "Get current value of global state that can be used in virtual service responses" responses: 200: description: "OK" content: 'application/vnd.trafficparrot.state.v1+json': schema: $ref: "#/components/schemas/State" 404: description: "No global state with the given name found" put: tags: - "localhost:8080/api" summary: "Create or update global state that can be used in virtual service responses" parameters: - in: path name: name required: true schema: type: string requestBody: required: true content: 'application/vnd.trafficparrot.state.v1+json': schema: $ref: "#/components/schemas/StateUpdate" responses: 200: description: "OK" content: 'application/vnd.trafficparrot.state.v1+json': schema: $ref: "#/components/schemas/State" /api/grpc/requests: delete: tags: - "localhost:8080/api" summary: "Delete all gRPC requests from the journal" responses: 204: description: "OK" /api/grpc/requests/count: post: tags: - "localhost:8080/api" summary: "Count the number of gRPC requests in the journal that match the given pattern" requestBody: required: true content: 'application/vnd.trafficparrot.grpc.requests.count.v1+json': schema: $ref: "#/components/schemas/GrpcRequestPattern" examples: "Count by method, metadata and payload": value: method: "com.example.Service/Method" metadata: example-key: equalTo: "value" payloadJson: equalToJson: "{ \"example\": \"value\"}" responses: 200: description: "OK" content: 'application/vnd.trafficparrot.grpc.requests.count.v1+json': schema: $ref: "#/components/schemas/RequestCount" /api/jms/requests: delete: tags: - "localhost:8080/api" summary: "Delete all JMS requests from the journal" responses: 204: description: "OK" /api/jms/requests/count: post: tags: - "localhost:8080/api" summary: "Count the number of JMS requests in the journal that match the given pattern" requestBody: required: true content: 'application/vnd.trafficparrot.jms.requests.count.v1+json': schema: $ref: "#/components/schemas/MessageRequestPattern" examples: "Count by method, metadata and payload": value: { "destination": { "name": "request-queue", "type": "QUEUE" }, "messageText": { "contains": "example" } } responses: 200: description: "OK" content: 'application/vnd.trafficparrot.grpc.requests.count.v1+json': schema: $ref: "#/components/schemas/RequestCount" /api/http/: servers: - url: "http://localhost:8080" get: tags: - "localhost:8080/api/http/*" summary: "WireMock 2.10.1 compatible API is hosted here with the __admin prefix removed" responses: 200: description: "OK" /http/management/importMappings: servers: - url: "http://localhost:8080" post: tags: - "localhost:8080/http/management" summary: "Import Swagger/RAML/OpenAPI files" requestBody: content: multipart/form-data: schema: properties: files: type: "array" items: type: "string" format: "binary" responses: 200: description: "Successfully imported mapping ids" content: application/json: schema: type: "array" items: type: "string" format: "uuid" example: - "5e72e28a-8f66-4cb1-a920-7c9ee916ac10" - "9dd89493-64b5-4339-a514-a0375f64d205" 400: description: "Unable to import mappings" content: application/json: schema: type: "object" required: - "result" properties: result: type: "string" example: result: "Unable to import mappings from the given file(s). Check the logs for details." /ibmMq/record: servers: - url: "http://localhost:8080" get: tags: - "localhost:8080/ibmMq" summary: "IBM MQ recording status" responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/ApiResponse" examples: "Recording ON": value: status: "ON" "Recording OFF": value: status: "OFF" post: tags: - "localhost:8080/ibmMq" summary: "IBM MQ start and stop recording" description: "The connection ids refer to connections that are defined in [ibm-mq-connections.json](https://trafficparrot.com/documentation/5.8.x/ibmmq.html#define-connections)" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RecordSettings" examples: "Record queue ON": description: "You can choose to start record of queues or topics but not both at the same time." value: action: "START" messageMatcher: "time" queue: recordRequestsFromConnectionId: "docker-connection-id" recordRequestsFromQueue: "VIRTUAL.REQ.QL" forwardRequestsToConnectionId: "real-connection-id" forwardRequestsToQueue: "REAL.REQ.QL" recordResponsesFromConnectionId: "real-connection-id" recordResponsesFromQueue: "REAL.RSP.QL" forwardResponsesToConnectionId: "docker-connection-id" forwardResponsesToQueue: "VIRTUAL.RSP.QL" "Record topic ON": description: "You can choose to start record of queues or topics but not both at the same time" value: action: "START" messageMatcher: "time" topic: recordRequestsFromConnectionId: "real-connection-id" recordRequestsFromTopic: "REAL.TL" recordResponsesFromConnectionId: "real-connection-id" recordResponsesFromTopic: "REAL.TL" "Record OFF": description: "This will stop any recording that was previously in progress" value: action: "STOP" responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/ApiResponse" examples: "Replay ON": value: status: "ON" flash: success: "Started" "Replay OFF": value: status: "OFF" flash: success: "Stopped" /ibmMq/replay: servers: - url: "http://localhost:8080" get: tags: - "localhost:8080/ibmMq" summary: "IBM MQ replay status" responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/ApiResponse" examples: "Replay ON": value: status: "ON" "Replay OFF": value: status: "OFF" post: tags: - "localhost:8080/ibmMq" summary: "IBM MQ start and stop replay using current mappings" description: "The connection ids refer to connections that are defined in [ibm-mq-connections.json](https://trafficparrot.com/documentation/5.8.x/ibmmq.html#define-connections)" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ReplaySettings" examples: "Replay queue ON": description: "You can start replay of just queues" value: action: "START" queue: consumeRequestsFromConnectionId: "docker-connection-id" replayResponsesToConnectionId: "docker-connection-id" "Replay topic ON": description: "You can start replay of just topics" value: action: "START" topic: replayToConnectionId: "docker-connection-id" "Replay both ON": description: "You can start replay of both queues and topics" value: action: "START" queue: consumeRequestsFromConnectionId: "docker-connection-id" replayResponsesToConnectionId: "docker-connection-id" topic: replayToConnectionId: "docker-connection-id" "Replay OFF": description: "This will stop any replay that was previously in progress" value: action: "STOP" responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/ApiResponse" examples: "Replay ON": value: status: "ON" flash: success: "Started" "Replay OFF": value: status: "OFF" flash: success: "Stopped" /jms/record: servers: - url: "http://localhost:8080" get: tags: - "localhost:8080/jms" summary: "JMS record status" responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/ApiResponse" examples: "Recording ON": value: status: "ON" "Recording OFF": value: status: "OFF" post: tags: - "localhost:8080/jms" summary: "JMS start and stop recording" description: "The connection ids refer to connections that are defined in [jms-connections.json](https://trafficparrot.com/documentation/5.8.x/jms.html#define-jms-connections)" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RecordSettings" examples: "Record queue ON": description: "You can choose to start record of queues or topics but not both at the same time" value: action: "START" broker: type: "INTERNAL" internalProvider: "ACTIVE_MQ" internalPort: 1234 messageMatcher: "time" queue: recordRequestsFromConnectionId: "USE-TRAFFIC-PARROT-INTERNAL-BROKER" recordRequestsFromQueue: "VIRTUAL.REQ.QL" forwardRequestsToConnectionId: "real-connection-id" forwardRequestsToQueue: "REAL.REQ.QL" recordResponsesFromConnectionId: "real-connection-id" recordResponsesFromQueue: "REAL.RSP.QL" forwardResponsesToConnectionId: "USE-TRAFFIC-PARROT-INTERNAL-BROKER" forwardResponsesToQueue: "VIRTUAL.RSP.QL" "Record topic ON": description: "You can choose to start record of queues or topics but not both at the same time" value: action: "START" broker: type: "EXTERNAL" messageMatcher: "time" topic: recordRequestsFromConnectionId: "real-connection-id" recordRequestsFromTopic: "REAL.TL" recordResponsesFromConnectionId: "real-connection-id" recordResponsesFromTopic: "REAL.TL" "Record OFF": description: "This will stop any recording that was previously in progress" value: action: "STOP" responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/ApiResponse" examples: "Replay ON": value: status: "ON" flash: success: "Started" "Replay OFF": value: status: "OFF" flash: success: "Stopped" /jms/replay: servers: - url: "http://localhost:8080" get: tags: - "localhost:8080/jms" summary: "JMS replay status" responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/ApiResponse" examples: "Replay ON": value: status: "ON" "Replay OFF": value: status: "OFF" post: tags: - "localhost:8080/jms" summary: "JMS start and stop replay using current mappings" description: "The connection ids refer to connections that are defined in [jms-connections.json](https://trafficparrot.com/documentation/5.8.x/jms.html#define-jms-connections)" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ReplaySettings" examples: "Replay queue ON": description: "You can start replay of just queues" value: action: "START" broker: type: "INTERNAL" internalProvider: "ACTIVE_MQ" internalPort: 1234 queue: consumeRequestsFromConnectionId: "USE-TRAFFIC-PARROT-INTERNAL-BROKER" replayResponsesToConnectionId: "USE-TRAFFIC-PARROT-INTERNAL-BROKER" "Replay topic ON": description: "You can start replay of just topics" value: action: "START" broker: type: "INTERNAL" internalProvider: "ACTIVE_MQ" internalPort: 1234 topic: replayToConnectionId: " USE-TRAFFIC-PARROT-INTERNAL-BROKER" "Replay both ON": description: "You can choose to start replay of queues or topics or both" value: action: "START" broker: type: "INTERNAL" internalProvider: "ACTIVE_MQ" internalPort: 1234 queue: consumeRequestsFromConnectionId: "USE-TRAFFIC-PARROT-INTERNAL-BROKER" replayResponsesToConnectionId: "USE-TRAFFIC-PARROT-INTERNAL-BROKER" topic: replayToConnectionId: "USE-TRAFFIC-PARROT-INTERNAL-BROKER" "Replay OFF": description: "This will stop any replay that was previously in progress" value: action: "STOP" responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/ApiResponse" examples: "Replay ON": value: status: "ON" flash: success: "Started" "Replay OFF": value: status: "OFF" flash: success: "Stopped" /fileMessage/record: servers: - url: "http://localhost:8080" get: tags: - "localhost:8080/fileMessage" summary: "File Message record status" responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/ApiResponse" examples: "Recording ON": value: status: "ON" "Recording OFF": value: status: "OFF" post: tags: - "localhost:8080/fileMessage" summary: "File Message start and stop recording" description: "The root directory ids refer to directories that are defined in [root-directories.json](https://trafficparrot.com/documentation/5.8.x/filemessage.html#define-root-directories). The sub directories are relative to the defined root directories." requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/FileMessageRecordSettings" examples: "Record ON": description: "Turn on recording the configured directories" value: action: "START" directories: recordRequestsFromRootDirectoryId: "virtual-root" recordRequestsFromSubDirectory: "request-sub-directory" forwardRequestsToRootDirectoryId: "real-root" forwardRequestsToSubDirectory: "request-sub-directory" recordResponsesFromRootDirectoryId: "real-root" recordResponsesFromSubDirectory: "response-sub-directory" forwardResponsesToRootDirectoryId: "virtual-root" forwardResponsesToSubDirectory: "response-sub-directory" "Record OFF": description: "This will stop any recording that was previously in progress" value: action: "STOP" responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/ApiResponse" examples: "Replay ON": value: status: "ON" flash: success: "Started" "Replay OFF": value: status: "OFF" flash: success: "Stopped" /fileMessage/replay: servers: - url: "http://localhost:8080" get: tags: - "localhost:8080/fileMessage" summary: "File Message replay status" responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/ApiResponse" examples: "Replay ON": value: status: "ON" "Replay OFF": value: status: "OFF" post: tags: - "localhost:8080/fileMessage" summary: "File Message start and stop replay using current mappings" description: "The root directory ids refer to directories that are defined in [root-directories.json](https://trafficparrot.com/documentation/5.8.x/filemessage.html#define-root-directories)" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/FileMessageReplaySettings" examples: "Replay ON": description: "You can start replay of existing mappings using this" value: action: "START" directories: consumeRequestsFromRootDirectoryId: "virtual-root" replayResponsesToRootDirectoryId: "virtual-root" "Replay OFF": description: "This will stop any replay that was previously in progress" value: action: "STOP" responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/ApiResponse" examples: "Replay ON": value: status: "ON" flash: success: "Started" "Replay OFF": value: status: "OFF" flash: success: "Stopped" components: schemas: GrpcRequestPattern: type: "object" properties: method: type: "string" description: "The fully qualified gRPC method e.g. com.example.Service/Method" metadata: type: "object" description: "Metadata patterns to match against in the : { \"predicate\": \"value\" } form" payloadJson: type: "object" description: "Request payload JSON representation to match against in the { \"predicate\": \"value\" } form" MessageRequestPattern: type: "object" properties: destination: $ref: "#/components/schemas/GrpcRequestPattern" messageText: type: "object" description: "Message text to match against in the { \"predicate\": \"value\" } form" Destination: type: "object" properties: name: type: "string" description: "The name of the queue or topic" type: type: "string" enum: - "QUEUE" - "TOPIC" description: "The destination is a queue or topic" RequestCount: type: "object" required: - "count" - "requestJournalDisabled" properties: count: type: "integer" minimum: 0 requestJournalDisabled: type: "boolean" default: false State: type: "object" required: - "namespace" - "name" - "value" example: namespace: "global" name: "name" value: 12345 properties: namespace: type: "string" name: type: "string" value: oneOf: - type: "string" - type: "integer" - type: "number" - type: "boolean" StateUpdate: type: "object" required: - "value" example: value: 12345 properties: value: oneOf: - type: "string" - type: "integer" - type: "number" - type: "boolean" Scenario: type: "object" required: - "name" - "enabled" properties: name: type: "string" enabled: type: "boolean" ScenarioUpdate: required: - "enabled" type: "object" properties: enabled: type: "boolean" ApiResponse: type: "object" properties: status: type: "string" enum: - "ON" - "OFF" - "UNKNOWN" flash: type: "object" properties: error: type: "string" success: type: "string" RecordSettings: type: "object" required: - "action" properties: action: $ref: "#/components/schemas/ActionSettings" broker: $ref: "#/components/schemas/BrokerSettings" messageMatcher: type: "string" enum: - "time" - "correlationId" queue: $ref: "#/components/schemas/QueueRecordSettings" QueueRecordSettings: type: "object" required: - "recordRequestsFromConnectionId" - "recordRequestsFromQueue" - "forwardRequestsToConnectionId" - "forwardRequestsToQueue" - "recordResponsesFromConnectionId" - "recordResponsesFromQueue" - "forwardResponsesToConnectionId" - "forwardResponsesToQueue" properties: recordRequestsFromConnectionId: type: "string" recordRequestsFromQueue: type: "string" forwardRequestsToConnectionId: type: "string" forwardRequestsToQueue: type: "string" recordResponsesFromConnectionId: type: "string" recordResponsesFromQueue: type: "string" forwardResponsesToConnectionId: type: "string" forwardResponsesToQueue: type: "string" ReplaySettings: type: "object" required: - "action" properties: action: $ref: "#/components/schemas/ActionSettings" broker: $ref: "#/components/schemas/BrokerSettings" queue: $ref: "#/components/schemas/QueueReplaySettings" topic: $ref: "#/components/schemas/TopicReplaySettings" QueueReplaySettings: type: "object" required: - "consumeRequestsFromConnectionId" - "replayResponsesToConnectionId" properties: consumeRequestsFromConnectionId: type: "string" replayResponsesToConnectionId: type: "string" TopicReplaySettings: type: "object" required: - "replayToConnectionId" properties: replayToConnectionId: type: "string" FileMessageRecordSettings: type: "object" required: - "action" properties: action: $ref: "#/components/schemas/ActionSettings" directories: $ref: "#/components/schemas/RecordDirectorySettings" RecordDirectorySettings: type: "object" required: - "recordRequestsFromRootDirectoryId" - "recordRequestsFromSubDirectory" - "forwardRequestsToRootDirectoryId" - "forwardRequestsToSubDirectory" - "recordResponsesFromRootDirectoryId" - "recordResponsesFromSubDirectory" - "forwardResponsesToRootDirectoryId" - "forwardResponsesToSubDirectory" properties: recordRequestsFromRootDirectoryId: type: "string" recordRequestsFromSubDirectory: type: "string" forwardRequestsToRootDirectoryId: type: "string" forwardRequestsToSubDirectory: type: "string" recordResponsesFromRootDirectoryId: type: "string" recordResponsesFromSubDirectory: type: "string" forwardResponsesToRootDirectoryId: type: "string" forwardResponsesToSubDirectory: type: "string" FileMessageReplaySettings: type: "object" required: - "action" properties: action: $ref: "#/components/schemas/ActionSettings" directories: $ref: "#/components/schemas/ReplayDirectorySettings" ReplayDirectorySettings: type: "object" required: - "consumeRequestsFromRootDirectoryId" - "replayResponsesToRootDirectoryId" properties: consumeRequestsFromRootDirectoryId: type: "string" replayResponsesToRootDirectoryId: type: "string" ActionSettings: type: "string" enum: - "START" - "STOP" BrokerSettings: type: "object" required: - "type" properties: type: type: "string" enum: - "INTERNAL" - "EXTERNAL" internalProvider: type: "string" enum: - "ACTIVE_MQ" internalPort: type: "integer" format: "int32"