Skip to content

Plugin Method Input Samples

Mark Feit edited this page Feb 14, 2024 · 5 revisions

Notes:

  • The enumerate methods of all plugin types take no input and are not listed below.
  • The use of "#": "..." as comments is not standard JSON but

Test Plugins

cli-to-spec

This method can usually also be invoked directly on the command line without input.

[ "arg1", "arg2", ... ]

participants

{
    "#": "Test spec for plugin's test type",
    "param-1": "value-1",
    "param-2": "value-2"
}

result-format

This method takes an optional command-line argument, the MIME type for the output (text/plain or text/html).

{
    "#": "Result for plugin's test type",
    "param-1": "value-1",
    "param-2": "value-2"
}

spec-format

This method takes an optional command-line argument, the MIME type for the output (text/plain or text/html).

{
    "#": "Test spec for plugin's test type",
    "param-1": "value-1",
    "param-2": "value-2"
}

spec-is-valid

{
    "#": "Test spec for plugin's test type",
    "param-1": "value-1",
    "param-2": "value-2"
}

spec-to-cli

{
    "#": "Test spec for plugin's test type",
    "param-1": "value-1",
    "param-2": "value-2"
}

Tool Plugins

can-run

{
    "type": "test-type",
    "spec": {
        "#": "Test spec for test-type",
        "param-1": "value-1",
        "param-2": "value-2"
    }
}

duration

{
    "type": "test-type",
    "spec": {
        "#": "Test spec for test to be run",
        "param-1": "value-1",
        "param-2": "value-2"
    }
}

merged-results

{
    "test": {
        "type": "test-type",
        "spec": {
            "#": "Test spec for test-type",
            "param-1": "value-1",
            "param-2": "value-2"
        }
    },
    "results": [
        {
            "#": "Partial result from participant 0"
        },
        {
            "#": "Partial result from participant 0"
        }
    ]
}

participant-data

{
    "participant": 0,
    "test": {
        "type": "test-type",
        "spec": {
            "#": "Test spec for test to be run",
            "param-1": "value-1",
            "param-2": "value-2"
        }
    }
}

run

{
    "task-uuid": "0cfd2f3c-a686-420b-aaea-c6c46481caa3",
    "participant": 0,
    "participant-data": [
      {
          "#": "Data from first (0) participant"
      },
      {
          "#": "Data from second (1) participant"
      }
    ],
    "test": {
        "type": "test-type",
        "spec": {
            "#": "Test spec for test to be run",
            "param-1": "value-1",
            "param-2": "value-2"
        }
    },
    "schedule": {
      "#": "Any date in the past should make the plugin start immediately."
      "start": "2023-01-01T00:00:00Z",
      "duration": "PT30S"
    }
}

Archiver Plugins

archive

{
    "task-href": "https://...",
    "run-href": "https://...",
    "attempts": 0,
    "last-attempt": "2023-01-01T00:00:00Z",
    "result": {
        "id": "0cfd2f3c-a686-420b-aaea-c6c46481caa3",
        "schedule": {
          "start": "2023-01-01T00:00:00Z",
          "duration": "PT30S"
        },
        "test": {
            "type": "test-type",
            "spec": {
                "#": "Test spec for test that was run",
                "param-1": "value-1",
                "param-2": "value-2"
            }
        },
        "tool": {
            "name": "defrobulator",
            "version": "1.0"
        },
        "run": {
            "#": "Detailed data about the run"
        },
        "task": {
            "#": "Detailed data about the task"
        },
        "participants": [
            "ps.example.net",
            "ps.example.edu"
        ],
        "result": {
            "#": "Result of this run"
        },
        "reference": {
            "#": "Free-form JSON data provided with the task"
        }
    },
    "data": {
        "#": "Type-specific data for plugin's archiver",
        "param-1": "value-1",
        "param-2": "value-2"
    }
}

data-is-valid

{
    "#": "Type-specific data for plugin's archiver",
    "param-1": "value-1",
    "param-2": "value-2"
}

Context Plugins

change

{
    "data": {
        "#": "Type-specific data for plugin's context",
        "param-1": "value-1",
        "param-2": "value-2"
    },

    "#": "Program to execute after context change",
    "exec": "/foo/bar/baz"
}

data-is-valid

{
    "#": "Type-specific data for context",
    "param-1": "value-1",
    "param-2": "value-2"
}