Resources

Replace a mock's rules

Replaces the rules a mock_http resource answers with, in order, while the run is active. The first rule whose match holds decides the response; no match answers 404 with code no_mock_rule. The change is recorded on the timeline as mock.rules.updated. Needs rig.run.

put/v1/runs/{runId}/resources/{resourceId}/mock

Request

  • Base URL: https://api.ironfang.com/rig
  • URL: https://api.ironfang.com/rig/v1/runs/{runId}/resources/{resourceId}/mock
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Request body

Example request

{
  "rules": [
    {
      "match": {
        "method": "POST",
        "path": "/v1/ship/{id}"
      },
      "respond": {
        "status": 201
      },
      "sequence": [
        {
          "status": 201
        }
      ]
    }
  ]
}

Response

The resource with its new rules

Changes

No recorded changes to this operation across all 1 revision of this API.