===== Validating XML and JSON API schemas =====
NetYCE supports its API's using two methods. The original implementation used strictly XML payloads supporting http 'post' or ip-socket based transactions over port 8888.
As of version 7.0, NetYCE extended its internal JSON API (for the web front-end) to include the API calls of the original implementation. The JSON based interface used port 8080 and also solely supports http 'posts'. It will use JSON formatted payloads by default, but will accept XML formatted requests as well. The responses likewise can be requested to be XML formatted as well.
==== XML ====
=== Validate request ===
The following {{ :general:request.xsd |xsd}} can be used to validate requests:
=== Validate response ===
The following {{ :general:response.xsd |xsd}} can be used to validate responses
==== JSON ====
=== Validating request ===
The following {{ :general:request_schema.json |JSON schema}} can be used to validate requests
"definitions": {
"custom": {
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"type",
"value"
],
"type": "object"
},
"task": {
"properties": {
"response": {
"type": "string"
},
"head": {
"$ref": "#/definitions/head"
},
"request": {
"$ref": "#/definitions/request"
}
},
"required": [
"head",
"request"
],
"type": "object"
},
"requestCHOICE0": {
"properties": {
"action_type": {
"type": "string"
},
"custom": {
"$ref": "#/definitions/custom"
},
"client_type": {
"type": "string"
},
"service_class": {
"type": "string"
},
"service_task": {
"type": "string"
},
"service_type": {
"type": "string"
},
"servername": {
"type": "string"
},
"action": {
"type": "string"
},
"command": {
"type": "string"
},
"detail": {
"type": "string"
},
"nodename": {
"type": "string"
},
"filename": {
"type": "string"
}
},
"type": "object"
},
"host": {
"properties": {
"comment": {
"type": "string"
},
"subnet_addr": {
"type": "string"
},
"host_domain": {
"type": "string"
},
"host_name": {
"type": "string"
},
"record_type": {
"type": "string"
}
},
"required": [
"comment",
"host_domain",
"host_name",
"record_type",
"subnet_addr"
],
"type": "object"
},
"ext_attr": {
"properties": {
"rfc": {
"type": "string"
},
"CI": {
"type": "string"
}
},
"type": "object"
},
"head": {
"properties": {
"passwd": {
"type": "string"
},
"task_name": {
"type": "string"
},
"task_type": {
"type": "string"
},
"userid": {
"type": "string"
},
"error": {
"type": "string"
},
"req_app": {
"type": "string"
},
"req_host": {
"type": "string"
},
"status": {
"type": "string"
}
},
"required": [
"passwd",
"task_name",
"task_type",
"userid"
],
"type": "object"
},
"request": {
"anyOf": [
{
"$ref": "#/definitions/requestCHOICE0"
}
]
}
},
"$ref": "#/definitions/task"
}
=== Validating response ===
The following {{ :general:response_schema.json |JSON schema}} can be used to validate requests
{
"custom": {
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"type",
"value"
],
"type": "object"
},
"task": {
"properties": {
"response": {
"type": "string"
},
"head": {
"$ref": "#/definitions/head"
},
"request": {
"$ref": "#/definitions/request"
}
},
"required": [
"response",
"head",
"request"
],
"type": "object"
},
"requestCHOICE0": {
"properties": {
"action_type": {
"type": "string"
},
"custom": {
"$ref": "#/definitions/custom"
},
"client_type": {
"type": "string"
},
"service_class": {
"type": "string"
},
"service_task": {
"type": "string"
},
"service_type": {
"type": "string"
},
"servername": {
"type": "string"
},
"action": {
"type": "string"
},
"command": {
"type": "string"
},
"detail": {
"type": "string"
},
"nodename": {
"type": "string"
},
"filename": {
"type": "string"
}
},
"type": "object",
"required": [
"custom"
]
},
"host": {
"properties": {
"comment": {
"type": "string"
},
"subnet_addr": {
"type": "string"
},
"host_domain": {
"type": "string"
},
"host_name": {
"type": "string"
},
"record_type": {
"type": "string"
}
},
"required": [
"comment",
"host_domain",
"host_name",
"record_type",
"subnet_addr"
],
"type": "object"
},
"ext_attr": {
"properties": {
"rfc": {
"type": "string"
},
"CI": {
"type": "string"
}
},
"type": "object"
},
"head": {
"properties": {
"passwd": {
"type": "string"
},
"task_name": {
"type": "string"
},
"task_type": {
"type": "string"
},
"userid": {
"type": "string"
},
"error": {
"type": "string"
},
"req_app": {
"type": "string"
},
"req_host": {
"type": "string"
},
"status": {
"type": "string"
}
},
"required": [
"passwd",
"task_name",
"task_type",
"userid"
],
"type": "object"
},
"request": {
"anyOf": [
{
"$ref": "#/definitions/requestCHOICE0"
}
]
}
}