Operations on virtual services.
Use this when a user needs to create or select a virtual service.
Actions:
- read: Read a virtual service. Get the information of a virtual service.
args(dict): Dictionary with the following required parameters:
workspace_id (int): Mandatory. The id of the workspace to list virtual services from.
id (int): Mandatory. The id of the virtual service to get information.
- list: List all virtual services.
args(dict): Dictionary with the following required parameters:
workspace_id (int): Mandatory. The id of the workspace to list transactions from.
serviceId (int): Optional. The id of the service to list virtual services from. Without this it will list all virtual services in the workspace.
limit (int, default=10, valid=[1 to 50]): The number of virtual services to list.
offset (int, default=0): Number of virtual services to skip.
- create: Create a new virtual service.
args(VirtualService): A virtual service object with the following fields:
workspace_id (int): Mandatory. The id of the workspace.
name (str): Mandatory. The name of the virtual service.
serviceId (int): Mandatory. The id of the service to create the virtual service in.
harborId (str): Mandatory. The location harbor id. ALWAYS call virtual_services_location list first to get the correct harborId for the requested location.
shipId (str): Mandatory. The location ship id. ALWAYS call virtual_services_location list first to get the correct shipId for the requested location.
endpointPreference (str): Mandatory. Use 'HTTP' or 'HTTPS' as specified by the user.
noMatchingRequestPreference (str): Mandatory. If not specified use 'return404'.
- update: Update an existing new virtual service.
args(VirtualService): A virtual service object with the following fields:
workspace_id (int): Mandatory. The id of the workspace.
vs_id (int): Mandatory. The id of the virtual service.
name (str): Optional. The name of the virtual service.
serviceId (int): Optional. The id of the service to create the virtual service in.
harborId (str): Optional. The location harbor id. Use virtual_services_location list to find the correct value.
shipId (str): Optional. The location ship id. Use virtual_services_location list to find the correct value.
endpointPreference (str): Optional. 'HTTP' or 'HTTPS' as specified by the user.
noMatchingRequestPreference (str): Optional. If not specified use 'return404'.
- deploy: Deploy a virtual service. Deploys the virtual service to the specified harbor and ship.
Action result contains tracking id to track the deployment. Use tracking tool to track the deployment.
Deployment is finished, when tracking status is 'FINISHED'. If deployment fails, tracking status is 'FAILED'.
After tracking status is 'FINISHED' or 'FAILED' you can read the virtual service to get the endpoint and return to user.
args(dict): Dictionary with the following required parameters:
workspace_id (int): Mandatory. The id of the workspace the virtual service belongs to.
id (int): Mandatory. The id of the virtual service to deploy.
- stop: Stop a virtual service. Stops the virtual service.
Action result contains tracking id to track the stop action. Use tracking tool to track the stop action.
Stop action is finished, when tracking status is 'FINISHED'. If stop action fails, tracking status is 'FAILED'.
args(dict): Dictionary with the following required parameters:
workspace_id (int): Mandatory. The id of the workspace the virtual service belongs to.
id (int): Mandatory. The id of the virtual service to stop.
- configure: Configures a virtual service. Only available if Virtual service is running.
Updates transactions loaded into the virtual service.
Action result contains tracking id to track the update action. Use tracking tool to track the update action.
Update action is finished, when tracking status is 'FINISHED'. If update action fails, tracking status is 'FAILED'.
args(VirtualService): A virtual service object with the following fields:
workspace_id (int): Mandatory. The id of the virtual service.
id (int): Mandatory. The id of the virtual service to update.
- assign_transactions: Assigns the transactions to the virtual service. Transactions should belong to the same service as the virtual service.
args(dict): Dictionary with the following required parameters:
workspace_id (int): Mandatory. The id of the workspace the virtual service belongs to.
id (int): Mandatory. The id of the virtual service to assign the transaction to.
transaction_ids (list[int]): Mandatory. The ids of the transactions to assign to the virtual service.
- unassign_transactions: Unassigns the transactions from the virtual service.
args(dict): Dictionary with the following required parameters:
workspace_id (int): Mandatory. The id of the workspace the virtual service belongs to.
id (int): Mandatory. The id of the virtual service to assign the transaction to.
transaction_ids (list[int]): Mandatory. The ids of the transactions to unassign from the virtual service.
- assign_configuration: Assigns the configuration to the virtual service. To unassign configuration, assign configuration with id None.
args(dict): Dictionary with the following required parameters:
workspace_id (int): Mandatory. The id of the workspace the virtual service belongs to.
id (int): Mandatory. The id of the virtual service to assign the transaction to.
configuration_id (list[int]): Mandatory. The id of the configuration to assign to the virtual service.
- set_proxy: Sets proxy server configuration for the virtual service.
args(dict): Dictionary with the following required parameters:
workspace_id (int): Mandatory. The id of the workspace the virtual service belongs to.
id (int): Mandatory. The id of the virtual service to set proxy.
proxyUrl (str): Mandatory. Proxy server address.
nonProxyHosts (str): Optional. Non-proxy hosts, | separated.
username (str): Optional. Proxy server username.
password (str): Optional. Proxy server password.
certificate_id (int): Optional. The id of the proxy certificate asset if required.
- unset_proxy: Removes proxy server configuration from the virtual service.
args(dict): Dictionary with the following required parameters:
workspace_id (int): Mandatory. The id of the workspace the virtual service belongs to.
id (int): Mandatory. The id of the virtual service to remove proxy.
- apply_template: Applies virtual service template settings to the virtual service.
Result contains tracking id to track the update action. Use tracking tool to track the update action.
args(dict): Dictionary with the following required parameters:
workspace_id (int): Mandatory. The id of the workspace the virtual service belongs to.
id (int): Mandatory. The id of the virtual service to remove proxy.
template_id (int): Mandatory. The id of the virtual service template.
- assign_keystore: Assign Keystore asset to the Virtual Service.
args(dict):
id (int): Mandatory. The id of the Virtual Service.
asset_id (int): Mandatory. The id of the keystore asset to assign.
alias (str): Mandatory. The certificate alias to use.
workspace_id (int): Mandatory. The id of the workspace.
- assign_keystore_truststore: Assign Keystore asset to the Virtual Service. Asset will be used as both Keystore and Truststore.
Use this action for 2way ssl setup.
args(dict):
id (int): Mandatory. The id of the Virtual Service.
asset_id (int): Mandatory. The id of the certificate asset to assign.
alias (str): Mandatory. The certificate alias to use.
workspace_id (int): Mandatory. The id of the workspace.
VirtualService Schema (including full MockServiceTransaction):
{'$defs': {'AssignedAsset': {'properties': {'assetId': {'description': 'The identifier of the asset', 'title': 'Assetid', 'type': 'integer'}, 'assetUsageType': {'description': 'The usage type of the asset', 'title': 'Assetusagetype', 'type': 'string'}, 'alias': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None, 'description': 'The asset certificate alias', 'title': 'Alias'}}, 'required': ['assetId', 'assetUsageType'], 'title': 'AssignedAsset', 'type': 'object'}, 'BrokerConfiguration': {'additionalProperties': True, 'properties': {'hostname': {'anyOf': [{'type': 'string'}, {'type': 'integer'}, {'type': 'null'}], 'default': None, 'description': 'Broker hostname', 'title': 'Hostname'}, 'port': {'anyOf': [{'type': 'string'}, {'type': 'integer'}, {'type': 'null'}], 'default': None, 'description': "Broker port (string). Use 'host:port,host:port' for Kafka multi-broker lists.", 'title': 'Port'}, 'channel': {'anyOf': [{'type': 'string'}, {'type': 'integer'}, {'type': 'null'}], 'default': None, 'description': 'IBM MQ channel name, e.g. SYSTEM.DEF.SVRCONN', 'title': 'Channel'}, 'queueManager': {'anyOf': [{'type': 'string'}, {'type': 'integer'}, {'type': 'null'}], 'default': None, 'description': 'IBM MQ queue manager name', 'title': 'Queuemanager'}, 'username': {'anyOf': [{'type': 'string'}, {'type': 'integer'}, {'type': 'null'}], 'default': None, 'description': 'Broker username', 'title': 'Username'}, 'password': {'anyOf': [{'type': 'string'}, {'type': 'integer'}, {'type': 'null'}], 'default': None, 'description': 'Broker password', 'title': 'Password'}, 'sslAuthentication': {'anyOf': [{'type': 'boolean'}, {'type': 'null'}], 'default': None, 'description': 'Enable SSL/TLS authentication', 'title': 'Sslauthentication'}, 'sslCipherSuite': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None, 'description': 'SSL cipher suite (IBM MQ only), e.g. TLS_RSA_WITH_AES_256_CBC_SHA256', 'title': 'Sslciphersuite'}, 'embeddedBroker': {'anyOf': [{'type': 'boolean'}, {'type': 'null'}], 'default': None, 'description': 'Start an embedded broker — ACTIVE_MQ_CLASSIC and ARTEMIS only', 'title': 'Embeddedbroker'}, 'autoOffsetReset': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None, 'description': 'Kafka offset reset strategy: earliest, latest, or none', 'title': 'Autooffsetreset'}, 'numPartitions': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'default': None, 'description': 'Kafka number of partitions (default 1)', 'title': 'Numpartitions'}, 'queues': {'anyOf': [{'items': {'$ref': '#/$defs/BrokerQueue'}, 'type': 'array'}, {'type': 'null'}], 'default': [], 'description': 'List of queues', 'title': 'Queues'}, 'topics': {'anyOf': [{'items': {'$ref': '#/$defs/BrokerTopic'}, 'type': 'array'}, {'type': 'null'}], 'default': [], 'description': 'List of topics', 'title': 'Topics'}, 'subscriptions': {'anyOf': [{'items': {'$ref': '#/$defs/BrokerSubscription'}, 'type': 'array'}, {'type': 'null'}], 'default': [], 'description': 'List of subscriptions', 'title': 'Subscriptions'}, 'flowConfigurations': {'anyOf': [{'items': {'$ref': '#/$defs/FlowConfiguration'}, 'type': 'array'}, {'type': 'null'}], 'default': [], 'description': 'Broker-level flow routing configurations', 'title': 'Flowconfigurations'}}, 'title': 'BrokerConfiguration', 'type': 'object'}, 'BrokerQueue': {'properties': {'name': {'description': 'Queue name', 'title': 'Name', 'type': 'string'}}, 'required': ['name'], 'title': 'BrokerQueue', 'type': 'object'}, 'BrokerSubscription': {'properties': {'name': {'description': 'Subscription name', 'title': 'Name', 'type': 'string'}}, 'required': ['name'], 'title': 'BrokerSubscription', 'type': 'object'}, 'BrokerTopic': {'properties': {'name': {'description': 'Topic name', 'title': 'Name', 'type': 'string'}, 'isDurable': {'anyOf': [{'type': 'boolean'}, {'type': 'null'}], 'default': None, 'description': 'Whether the subscription is durable', 'title': 'Isdurable'}, 'durableSubscriptionName': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None, 'description': 'Durable subscription name — required when isDurable=True', 'title': 'Durablesubscriptionname'}}, 'required': ['name'], 'title': 'BrokerTopic', 'type': 'object'}, 'Endpoint': {'properties': {'endpoint': {'description': 'Endpoint URL', 'title': 'Endpoint', 'type': 'string'}}, 'required': ['endpoint'], 'title': 'Endpoint', 'type': 'object'}, 'FlowConfiguration': {'properties': {'name': {'description': 'Flow configuration name', 'title': 'Name', 'type': 'string'}, 'transactionMapping': {'$ref': '#/$defs/FlowTransactionMapping', 'description': 'Source-to-destination routing for this flow'}}, 'required': ['name', 'transactionMapping'], 'title': 'FlowConfiguration', 'type': 'object'}, 'FlowTransactionMapping': {'properties': {'sourceName': {'description': 'Source queue/topic/subscription name', 'title': 'Sourcename', 'type': 'string'}, 'sourceType': {'description': 'Source type: QUEUE, TOPIC, or SUBSCRIPTION', 'title': 'Sourcetype', 'type': 'string'}, 'destinations': {'default': [], 'description': 'Destination list', 'items': {'$ref': '#/$defs/MessagingDestination'}, 'title': 'Destinations', 'type': 'array'}}, 'required': ['sourceName', 'sourceType'], 'title': 'FlowTransactionMapping', 'type': 'object'}, 'MessagingDestination': {'properties': {'destinationName': {'description': 'Destination name', 'title': 'Destinationname', 'type': 'string'}, 'destinationType': {'description': 'Destination type: QUEUE, TOPIC, or SUBSCRIPTION', 'title': 'Destinationtype', 'type': 'string'}}, 'required': ['destinationName', 'destinationType'], 'title': 'MessagingDestination', 'type': 'object'}, 'MockServiceRecording': {'properties': {'recordingId': {'description': 'ID of the recording to include in this virtual service', 'title': 'Recordingid', 'type': 'integer'}, 'runtimeConfig': {'anyOf': [{'$ref': '#/$defs/ReplayConfig'}, {'type': 'null'}], 'default': None, 'description': 'Replay configuration for this recording'}}, 'required': ['recordingId'], 'title': 'MockServiceRecording', 'type': 'object'}, 'MockServiceTransaction': {'properties': {'txnId': {'description': 'Transaction id.', 'title': 'Txnid', 'type': 'integer'}, 'priority': {'default': 10, 'description': 'Transaction Priority. If not specified, defaults to 10.', 'title': 'Priority', 'type': 'integer'}, 'destinations': {'anyOf': [{'items': {'$ref': '#/$defs/MessagingDestination'}, 'type': 'array'}, {'type': 'null'}], 'default': [], 'description': 'List of messaging destinations.', 'title': 'Destinations'}}, 'required': ['txnId'], 'title': 'MockServiceTransaction', 'type': 'object'}, 'ProxyConfiguration': {'additionalProperties': True, 'properties': {'proxyUrl': {'description': 'Proxy url', 'title': 'Proxyurl', 'type': 'string'}, 'nonProxyHosts': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None, 'description': 'Non proxy hosts, | separated', 'title': 'Nonproxyhosts'}, 'username': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'description': 'Proxy username', 'title': 'Username'}, 'password': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'description': 'Proxy password', 'title': 'Password'}, 'certificateId': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'default': None, 'description': 'Certificate asset identifier', 'title': 'Certificateid'}}, 'required': ['proxyUrl', 'username', 'password'], 'title': 'ProxyConfiguration', 'type': 'object'}, 'RecorderConfig': {'additionalProperties': True, 'properties': {'maxMessagesCount': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'default': None, 'description': 'Maximum number of messages to capture per recording session', 'title': 'Maxmessagescount'}, 'maxMessagesPerSecondCount': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'default': None, 'description': 'Rate limit for capturing messages per second', 'title': 'Maxmessagespersecondcount'}, 'mappings': {'anyOf': [{'items': {'$ref': '#/$defs/RecorderMapping'}, 'type': 'array'}, {'type': 'null'}], 'default': [], 'description': 'Inbound/outbound destination mappings for recording', 'title': 'Mappings'}}, 'title': 'RecorderConfig', 'type': 'object'}, 'RecorderMapping': {'properties': {'inboundDestination': {'description': 'Source destination to record from', 'title': 'Inbounddestination', 'type': 'string'}, 'outboundDestination': {'description': 'Destination to replay captured messages to', 'title': 'Outbounddestination', 'type': 'string'}, 'originType': {'description': 'Origin type: QUEUE, TOPIC, or SUBSCRIPTION', 'title': 'Origintype', 'type': 'string'}}, 'required': ['inboundDestination', 'outboundDestination', 'originType'], 'title': 'RecorderMapping', 'type': 'object'}, 'ReplayConfig': {'additionalProperties': True, 'properties': {'replayCount': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'default': 1, 'description': 'Number of times to replay the recording', 'title': 'Replaycount'}, 'delayBetweenReplays': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'default': 0, 'description': 'Delay in ms between replays', 'title': 'Delaybetweenreplays'}, 'initialDelay': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'default': 0, 'description': 'Initial delay in ms before the first replay', 'title': 'Initialdelay'}}, 'title': 'ReplayConfig', 'type': 'object'}, 'ResponseDelay': {'additionalProperties': True, 'properties': {'type': {'default': 'FIXED', 'description': 'Delay type: FIXED, LOGNORMAL, or UNIFORM', 'title': 'Type', 'type': 'string'}, 'fixedDelay': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'default': None, 'description': 'Fixed delay in ms (FIXED type)', 'title': 'Fixeddelay'}, 'median': {'anyOf': [{'type': 'number'}, {'type': 'null'}], 'default': None, 'description': 'Median for LOGNORMAL distribution', 'title': 'Median'}, 'sigma': {'anyOf': [{'type': 'number'}, {'type': 'null'}], 'default': None, 'description': 'Sigma for LOGNORMAL distribution', 'title': 'Sigma'}, 'lower': {'anyOf': [{'type': 'number'}, {'type': 'null'}], 'default': None, 'description': 'Lower bound for UNIFORM distribution', 'title': 'Lower'}, 'upper': {'anyOf': [{'type': 'number'}, {'type': 'null'}], 'default': None, 'description': 'Upper bound for UNIFORM distribution', 'title': 'Upper'}}, 'title': 'ResponseDelay', 'type': 'object'}}, 'properties': {'id': {'description': 'The unique identifier of the virtual service', 'title': 'Id', 'type': 'integer'}, 'name': {'description': 'The name of the virtual service', 'title': 'Name', 'type': 'string'}, 'status': {'default': '', 'description': 'The status of the virtual service', 'title': 'Status', 'type': 'string'}, 'serviceId': {'description': 'The unique identifier of the service where the virtual service belongs', 'title': 'Serviceid', 'type': 'integer'}, 'type': {'description': "Type of the virtual service. Possible values are 'TRANSACTIONAL' and 'MESSAGING'. Transactional virtual services are used for simulating user interactions with web applications, while messaging virtual services are used for simulating message-based interactions.", 'title': 'Type', 'type': 'string'}, 'harborId': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None, 'description': 'Location harbor identifier', 'title': 'Harborid'}, 'shipId': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None, 'description': 'Location ship identifier', 'title': 'Shipid'}, 'configurationId': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'default': None, 'description': 'Configuration identifier', 'title': 'Configurationid'}, 'noMatchingRequestPreference': {'description': "For transactional virtual services, defines the behavior when no matching request is found. Possible values are 'return404' and 'bypasslive'.", 'title': 'Nomatchingrequestpreference', 'type': 'string'}, 'endpointPreference': {'description': "For transactional virtual services, defines endpoint schema. Possible values are 'HTTP' and 'HTTPS'.", 'title': 'Endpointpreference', 'type': 'string'}, 'replicas': {'default': 1, 'description': 'The number of replicas for the virtual service. Always set to 1.', 'title': 'Replicas', 'type': 'integer'}, 'mockServiceTransactions': {'anyOf': [{'items': {'$ref': '#/$defs/MockServiceTransaction'}, 'type': 'array'}, {'type': 'null'}], 'default': [], 'description': 'List of transaction definitions associated with the virtual service', 'title': 'Mockservicetransactions'}, 'mockServiceRecordings': {'anyOf': [{'items': {'$ref': '#/$defs/MockServiceRecording'}, 'type': 'array'}, {'type': 'null'}], 'default': [], 'description': 'List of recording references associated with the virtual service', 'title': 'Mockservicerecordings'}, 'endpoints': {'anyOf': [{'items': {'$ref': '#/$defs/Endpoint'}, 'type': 'array'}, {'type': 'null'}], 'default': [], 'description': 'List of virtual service endpoints. Available after deployment only.', 'title': 'Endpoints'}, 'httpRunnerEnabled': {'default': True, 'description': "Http runner enabled flag, must be enabled for virtual services with 'TRANSACTIONAL' type.", 'title': 'Httprunnerenabled', 'type': 'boolean'}, 'messagingRunnerEnabled': {'anyOf': [{'type': 'boolean'}, {'type': 'null'}], 'default': None, 'description': "Messaging runner enabled flag for 'MESSAGING' type virtual services.", 'title': 'Messagingrunnerenabled'}, 'messagingProtocol': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None, 'description': 'Messaging broker protocol. One of: IBM_MQ9_JMS, IBM_MQ9_NATIVE, ACTIVE_MQ_CLASSIC, ACTIVE_MQ_ARTEMIS, KAFKA.', 'title': 'Messagingprotocol'}, 'priorityMode': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None, 'description': 'Transaction selection mode: DEFAULT or UNIQUE_PRIORITY.', 'title': 'Prioritymode'}, 'responseDelay': {'anyOf': [{'$ref': '#/$defs/ResponseDelay'}, {'type': 'null'}], 'default': None, 'description': 'Global response delay applied to all transactions in this virtual service.'}, 'recorderConfig': {'anyOf': [{'$ref': '#/$defs/RecorderConfig'}, {'type': 'null'}], 'default': None, 'description': 'Configuration for recording live broker traffic.'}, 'classPathJars': {'anyOf': [{'additionalProperties': True, 'type': 'object'}, {'type': 'null'}], 'default': None, 'description': 'Custom broker JAR paths, e.g. {"paths": ["string"]}.', 'title': 'Classpathjars'}, 'proxy': {'anyOf': [{'$ref': '#/$defs/ProxyConfiguration'}, {'type': 'null'}], 'default': None, 'description': 'Proxy configuration for the virtual service'}, 'brokerConfig': {'anyOf': [{'$ref': '#/$defs/BrokerConfiguration'}, {'type': 'null'}], 'default': None, 'description': 'Messaging broker connection configuration'}, 'assets': {'anyOf': [{'items': {'$ref': '#/$defs/AssignedAsset'}, 'type': 'array'}, {'type': 'null'}], 'default': None, 'description': 'List of assets', 'title': 'Assets'}}, 'required': ['id', 'name', 'serviceId', 'type', 'noMatchingRequestPreference', 'endpointPreference'], 'title': 'VirtualService', 'type': 'object'}
Virtual service deploy/stop/update/delete actions result schema:
{'properties': {'tracking_id': {'description': 'Action tracking id', 'title': 'Tracking Id', 'type': 'string'}}, 'required': ['tracking_id'], 'title': 'ActionResult', 'type': 'object'}