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
- application/json;charset=utf-8
Root Schema : schema
Type:
objectThe payload schema used to perform an action on a node's NPL.
Show Source
-
action(required): string
action
The action to be performed on the rule file, such as COMPILE or SAVE.
-
nodeContext(required): string
Minimum Length:
1The context of the node on which the action is performed.Example:nodeContext -
nplContent(required): string
Minimum Length:
1NPL contentExample:The NPL content to be processed. -
ruleFileName(required): string
The name of the rule file associated with the action.Example:
ruleFileName
Nested Schema : action
The action to be performed on the rule file, such as COMPILE or SAVE.
Match All
The action to be performed on the rule file, such as COMPILE or SAVE.
Show Source
-
string
Allowed Values:
[ "COMPILE", "SAVE" ]
Example:
actionResponse
Supported Media Types
- application/json
200 Response
The request has been created.
Root Schema : NPLResponse
Type:
objectThe response schema that provides the result of an action perfored on a node's NPL. NPL
Show Source
-
nodeContext(required): string
The context of the node associated with the action.Example:
nodeContext -
Response(required): string
The response message describing the outcome of the action.Example:
Response -
ruleFileName(required): string
The name of the rule file on which the action was performed.Example:
ruleFileName
201 Response
The operation has been completed successfully.
Root Schema : NPLResponse
Type:
objectThe response schema that provides the result of an action perfored on a node's NPL. NPL
Show Source
-
nodeContext(required): string
The context of the node associated with the action.Example:
nodeContext -
Response(required): string
The response message describing the outcome of the action.Example:
Response -
ruleFileName(required): string
The name of the rule file on which the action was performed.Example:
ruleFileName
400 Response
The server cannot process the request due to a client error.
Root Schema : Error
Type:
objectUsed 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
The application relevant details defined in the API or a common list.
-
message: string
The details and corrective actions for the error shown to the client user.
-
reason(required): string
The reason for the error, which is shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error
-
status: string
HTTP Error code extension
401 Response
The client does not have the correct privileges.
Root Schema : Error
Type:
objectUsed 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
The application relevant details defined in the API or a common list.
-
message: string
The details and corrective actions for the error shown to the client user.
-
reason(required): string
The reason for the error, which is shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error
-
status: string
HTTP Error code extension
403 Response
The request was not authorized.
Root Schema : Error
Type:
objectUsed 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
The application relevant details defined in the API or a common list.
-
message: string
The details and corrective actions for the error shown to the client user.
-
reason(required): string
The reason for the error, which is shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error
-
status: string
HTTP Error code extension
405 Response
This method is not allowed.
Root Schema : Error
Type:
objectUsed 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
The application relevant details defined in the API or a common list.
-
message: string
The details and corrective actions for the error shown to the client user.
-
reason(required): string
The reason for the error, which is shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error
-
status: string
HTTP Error code extension
409 Response
The request cannot be processed due to a conflict with the existing state of the resource.
Root Schema : Error
Type:
objectUsed 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
The application relevant details defined in the API or a common list.
-
message: string
The details and corrective actions for the error shown to the client user.
-
reason(required): string
The reason for the error, which is shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error
-
status: string
HTTP Error code extension
500 Response
The system has encountered an internal server error.
Root Schema : Error
Type:
objectUsed 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
The application relevant details defined in the API or a common list.
-
message: string
The details and corrective actions for the error shown to the client user.
-
reason(required): string
The reason for the error, which is shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error
-
status: string
HTTP Error code extension
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"
}