Skip to content

module.exec

Note

This document has been machine translated.

Execute the methods provided by the module.

Parameters

  • module: string -- module name.
  • method: string -- Name of the method to execute.
  • input: object -- Dataset or model store to pass as input to the methods of module. It is specified in JSON Object format. The internal structure is defined for each method of the module. If this item is omitted, an empty JSON Object ({}) is returned.
  • output: object -- A dataset or model store that stores the results of executing methods of the module. It is specified in JSON Object format. The internal structure is defined for each method of the module. If this item is omitted, an empty JSON Object ({}) is returned.
  • params: object -- Parameters given to methods of module. They are specified in JSON Object format. The internal structure is defined for each method of the module. If this item is omitted, an empty JSON Object ({}) is returned.

Return Values

Returns true if the module has been successfully executed.

Execution example

Request Data

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "module.exec",
  "params": {
    "module": "mnist-module",
    "method": "train",
    "input": {
      "train_dataset": {
        "data_ddc": "ddc:mnist_train"
      }
    },
    "output": {
      "trained_model": {
        "model_store_ddc": "ddc:mnist_models"
      }
    },
    "params": {
    }
  }
}

Request Execution

curl -H "Content-type: application/json" \
     -H "APIKey: 9c6f4574-89d1-4e3c-8af7-2549dc217fcf" \
     -H "Secret: aef8caingiej1ieNieJ3Phool4maeGohcies" \
     -X POST -d "@request.json" \
     https://localhost/api/v2/module/jsonrpc

Response

{
  "result": true,
  "id": 1,
  "jsonrpc": "2.0"
}