Compile and Save NPL

post

/npl/save

Compiles and saves and uploads NPL to the administration server.

Request

There are no request parameters for this operation.

Supported Media Types
Request Body - application/json;charset=utf-8 ()
Root Schema : schema
Type: object
Payload schema to perform an action on a node's NPL.
Show Source
Nested Schema : Action
Match All
Show Source
  • Allowed Values: [ "COMPILE", "SAVE" ]
  • Action to be performed on the rule file, either COMPILE or SAVE.
    Example: Action
Back to Top

Response

Supported Media Types

200 Response

Created
Body ()
Root Schema : NPLResponse
Type: object
Response schema to get the update for action performed on a node's NPL.
Show Source

201 Response

The operation has been completed successfully.
Body ()
Root Schema : NPLResponse
Type: object
Response schema to get the update for action performed on a node's NPL.
Show Source

400 Response

The server cannot process the request due to a client error.
Body ()
Root Schema : Error
Type: object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source

401 Response

The client does not have the correct privileges.
Body ()
Root Schema : Error
Type: object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source

403 Response

The request was not authorized.
Body ()
Root Schema : Error
Type: object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source

405 Response

This method is not allowed.
Body ()
Root Schema : Error
Type: object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source

409 Response

The request cannot be processed due to a conflict with the existing state of the resource.
Body ()
Root Schema : Error
Type: object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source

500 Response

The system has encountered an internal server error.
Body ()
Root Schema : Error
Type: object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
Back to Top

Examples

The following example shows how to compile and save NPL by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL.

The -d option specifies the file to attach as the request body.

curl -X POST 'http://host:port/npl/save' -d @sampleNPLCompineandSave.json

Example of Request Body

The following is an example of the contents of the sampleNPLCompileandSave.json file sent as the request body.

{
  "action": "SAVE",
  "nodeContext": "CartridgeKit#EI#FlatFileEINode",
  "nplContent": "InputRec {\n    String x;\n} in;\nOutputRec {\n    String x;\n} out;\nout.x=in.x;\nwrite(out);\n",
  "ruleFileName": "CC1.npl"
}

Example of Response Body

The following is an example of a response body.
{
  "nodeContext": "CartridgeKit#EI#FlatFileEINode",
  "responseMessage": "Saved and uploaded successfully",
  "ruleFileName": "CC1.npl"
}
Back to Top