Compile and Save NPL

post

/v1/npl/save

Compiles or saves the NPL file 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
The payload schema to perform an action on a node's NPL.
Show Source
Nested Schema : Action
Match All
The action to be performed on the rule file, either COMPILE, SAVE, or both.
Show Source
  • Allowed Values: [ "COMPILE", "SAVE" ]
  • The action to be performed on the rule file, either COMPILE, SAVE, or both.
    Example: Action
Back to Top

Response

Supported Media Types

200 Response

The request has been created.
Body ()
Root Schema : NPLResponse
Type: object
The response schema to get the update for an action performed on a node's NPL.
Show Source

201 Response

The operation has been completed successfully.
Body ()
Root Schema : NPLResponse
Type: object
The response schema to get the update for an 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 save an NPL file to the Administration Server 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://hostname:port/npl' -d @sampleNPLCompileandSave.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 {\nString x;\n} in;\nOutputRec {\nString x;\n} out;\nout.x=in.x;\nwrite(out);\n",
  "ruleFileName": "CC1.npl"
}

Example of Response Body

If successful, the response code 200 is returned along with the following response body.
{
  "nodeContext": "CartridgeKit#EI#FlatFileEINode",
  "responseMessage": "Saved and uploaded successfully",
  "ruleFileName": "CC1.npl"
}
Back to Top