Create and deploy a virtual service
Before you start
Section titled “Before you start”You need a PDC to deploy to: either a shared system PDC (always available, zero setup) or a self-hosted PDC you’ve connected with an Outpost agent. You can create a virtual service and define its transactions without a PDC, but you cannot deploy until you choose one.
Create a virtual service
Section titled “Create a virtual service”- Open Virtual services in the left navigation, and click New virtual service.
- Give it a name and select or create the transaction group that becomes its home group (transactions you build on the fly land there by default; see Compose & transaction groups).
- Save. MaxoPerf creates the virtual service in a stopped, undeployed state. No workload runs yet, and it has no live endpoint.
Create it from a REST API request
Section titled “Create it from a REST API request”curl -X POST https://app.maxoperf.com/v1/virtual-services \ -H "Authorization: Bearer mpak_example_key" \ -H "X-Account-Id: acn-1234567890" \ -H "Content-Type: application/json" \ -d '{ "workspaceId": "ws_01J...", "serviceId": "vssvc_01J...", "name": "payments-sandbox-mock", "placement": { "privateDatacenterId": "pdc-1163a00001" }, "noMatch": { "policy": "notFound" }, "idleShutdownMinutes": 30 }'placement.privateDatacenterId is required. Every virtual service runs as its own pod on the
private datacenter you pick, so a service created without a usable datacenter could never deploy.
If you omit it, or name a datacenter your account cannot use, the API returns
400 VS_CONFIG_INCOMPLETE and creates nothing. List the ids you can use with
GET /v1/private-datacenters.
The 201 response includes state:"draft", the placement you chose, and a reserved (not-yet-live) hostname/endpointUrl on the generated *.vs.maxoperf.com domain.
Define transactions
Section titled “Define transactions”Open the virtual service’s Transactions tab to add the request/response pairs it should answer. Each transaction matches on method + path (with parameter placeholders) and returns a templated response: status code, headers, and a body built from the request or from data variables. See Compose & transaction groups for how transactions, groups, and composition fit together on a single virtual service.
Pick a private datacenter and deploy
Section titled “Pick a private datacenter and deploy”Open the Deployment tab.
-
Under Configuration, open the Private datacenter selector. The selector groups PDCs into Shared (MaxoPerf) (the system catalog, no setup required) and Self-hosted (PDCs your workspace has connected). Pick one.
-
Set the no-match policy. It decides what the virtual service does with a request that matches none of its transactions:
Policy Behavior 404 Not Found(default)Returns a plain 404. Respond with a fixed status Returns a status code and body template you choose. Proxy to a real origin Forwards the request to a real origin URL. Mock the transactions you care about and pass everything else through unchanged. Reject the connection Drops the connection instead of returning an HTTP response. -
Save the configuration.
-
Click Deploy. The virtual service moves to
deployingwhile MaxoPerf provisions a dedicated runtime pod on the selected PDC and wires its route. This starts a real workload, so it takes a few moments the first time. When it is ready, the status changes torunningand the endpoint at the top of the page goes live.
Deploy and stop from the REST API
Section titled “Deploy and stop from the REST API”curl -X POST https://app.maxoperf.com/v1/virtual-services/<id>/deploy \ -H "Authorization: Bearer mpak_example_key" -H "X-Account-Id: acn-1234567890"
curl -X POST https://app.maxoperf.com/v1/virtual-services/<id>/stop \ -H "Authorization: Bearer mpak_example_key" -H "X-Account-Id: acn-1234567890"Both return { "id": "...", "state": "running" | "stopped" } right away. The transition itself is asynchronous. Poll GET /v1/virtual-services/<id> (or watch the console) for the final running/stopped/error state.
Idle-shutdown
Section titled “Idle-shutdown”Set Idle-shutdown (minutes) on the virtual service’s Settings tab. It is the number of minutes without traffic before MaxoPerf stops the workload and frees its PDC resources. The default is 30 minutes. Set it to 0 to turn idle-shutdown off, and the deployed virtual service runs with no time limit. There is no separate lifetime cap. A deployed virtual service runs until it goes idle, you stop it by hand, or you redeploy it later.
Custom domain (optional)
Section titled “Custom domain (optional)”By default a virtual service is reachable at its generated *.vs.maxoperf.com hostname. To front it with your own domain:
- On the Deployment tab, upload a custom TLS certificate for your domain (MaxoPerf encrypts the private key at rest, and the API never returns it).
- Set Custom domain on the Settings tab to your hostname.
To clear the custom domain, set it back to empty. The virtual service falls back to its generated hostname.
Next steps
Section titled “Next steps”- Compose & transaction groups: build reusable groups and compose a virtual service from multiple sources.
- Private datacenters: connect a self-hosted PDC.
- Virtual services overview: the full model and when to use it.