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
- application/json;charset=utf-8
Root Schema : schema
Type:
object
Payload schema to perform an action on a node's NPL.
Show Source
-
Action(required):
Action
-
nodeContext(required): string
Context of the nodeExample:
nodeContext
-
nplContent(required): string
NPL contentExample:
NPL Content
-
ruleFileName(required): string
Rule file nameExample:
ruleFileName
Nested Schema : Action
Match All
Show Source
-
string
Allowed Values:
[ "COMPILE", "SAVE" ]
-
Action to be performed on the rule file, either COMPILE or SAVE.Example:
Action
Response
Supported Media Types
- application/json
200 Response
Created
Root Schema : NPLResponse
Type:
object
Response schema to get the update for action performed on a node's NPL.
Show Source
-
nodeContext(required): string
Context of the node.Example:
nodeContext
-
Response(required): string
Response message for action performed on the NPL.Example:
Response
-
ruleFileName(required): string
Name of the rule file.Example:
ruleFileName
201 Response
The operation has been completed successfully.
Root Schema : NPLResponse
Type:
object
Response schema to get the update for action performed on a node's NPL.
Show Source
-
nodeContext(required): string
Context of the node.Example:
nodeContext
-
Response(required): string
Response message for action performed on the NPL.Example:
Response
-
ruleFileName(required): string
Name of the rule file.Example:
ruleFileName
400 Response
The server cannot process the request due to a client error.
Root Schema : Error
Type:
object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
-
@type: string
Defines the sub-class entity when sub-classing.
-
cause: string
Cause of the exception
-
code(required): string
Application relevant details defined in the API or a common list.
-
message: string
Details and corrective actions related to the error which is shown to a client user.
-
reason(required): string
The reason for the error, shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error Code describiing the error.
401 Response
The client does not have the correct privileges.
Root Schema : Error
Type:
object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
-
@type: string
Defines the sub-class entity when sub-classing.
-
cause: string
Cause of the exception
-
code(required): string
Application relevant details defined in the API or a common list.
-
message: string
Details and corrective actions related to the error which is shown to a client user.
-
reason(required): string
The reason for the error, shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error Code describiing the error.
403 Response
The request was not authorized.
Root Schema : Error
Type:
object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
-
@type: string
Defines the sub-class entity when sub-classing.
-
cause: string
Cause of the exception
-
code(required): string
Application relevant details defined in the API or a common list.
-
message: string
Details and corrective actions related to the error which is shown to a client user.
-
reason(required): string
The reason for the error, shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error Code describiing the error.
405 Response
This method is not allowed.
Root Schema : Error
Type:
object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
-
@type: string
Defines the sub-class entity when sub-classing.
-
cause: string
Cause of the exception
-
code(required): string
Application relevant details defined in the API or a common list.
-
message: string
Details and corrective actions related to the error which is shown to a client user.
-
reason(required): string
The reason for the error, shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error Code describiing the error.
409 Response
The request cannot be processed due to a conflict with the existing state of the resource.
Root Schema : Error
Type:
object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
-
@type: string
Defines the sub-class entity when sub-classing.
-
cause: string
Cause of the exception
-
code(required): string
Application relevant details defined in the API or a common list.
-
message: string
Details and corrective actions related to the error which is shown to a client user.
-
reason(required): string
The reason for the error, shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error Code describiing the error.
500 Response
The system has encountered an internal server error.
Root Schema : Error
Type:
object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
-
@type: string
Defines the sub-class entity when sub-classing.
-
cause: string
Cause of the exception
-
code(required): string
Application relevant details defined in the API or a common list.
-
message: string
Details and corrective actions related to the error which is shown to a client user.
-
reason(required): string
The reason for the error, shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error Code describiing the error.
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"
}