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:
object
The payload schema to perform an action on a node's NPL.
Show Source
-
Action(required):
Action
-
nodeContext(required): string
The context of the node.Example:
nodeContext
-
nplContent(required): string
The NPL content.Example:
NPL Content
-
ruleFileName(required): string
The rule file name.Example:
ruleFileName
Nested Schema : Action
Match All
The action to be performed on the rule file, either COMPILE, SAVE, or both.
Show Source
-
string
Allowed Values:
[ "COMPILE", "SAVE" ]
-
The action to be performed on the rule file, either COMPILE, SAVE, or both.Example:
Action
Response
Supported Media Types
- application/json
200 Response
The request has been created.
Root Schema : NPLResponse
Type:
object
The response schema to get the update for an action performed on a node's NPL.
Show Source
-
nodeContext(required): string
The context of the node.Example:
nodeContext
-
Response(required): string
The response message for action performed on the NPL.Example:
Response
-
ruleFileName(required): string
The name of the rule file.Example:
ruleFileName
201 Response
The operation has been completed successfully.
Root Schema : NPLResponse
Type:
object
The response schema to get the update for an action performed on a node's NPL.
Show Source
-
nodeContext(required): string
The context of the node.Example:
nodeContext
-
Response(required): string
The response message for action performed on the NPL.Example:
Response
-
ruleFileName(required): string
The 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
The 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)
The URI of the documentation describing the error.
-
status: string
The HTTP error code describing 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
The 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)
The URI of the documentation describing the error.
-
status: string
The HTTP error code describing 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
The 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)
The URI of the documentation describing the error.
-
status: string
The HTTP error code describing 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
The 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)
The URI of the documentation describing the error.
-
status: string
The HTTP error code describing 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
The 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)
The URI of the documentation describing the error.
-
status: string
The HTTP error code describing 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
The 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)
The URI of the documentation describing the error.
-
status: string
The HTTP error code describing the error.
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"
}