{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "request": {
        "type": "object",
        "properties": {
            "action_logs": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "node_aid": {
                            "type": "string"
                        },
                        "external_id": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "node_aid",
                        "external_id"
                    ]
                }
            }
        },
        "additionalProperties": false
    },
    "response": {
        "oneOf": [
            {
                "type": "object",
                "properties": {
                    "status": {
                        "enum": [
                            "ok"
                        ]
                    },
                    "message": {
                        "type": "string"
                    },
                    "exec_time": {
                        "type": "number"
                    },
                    "action_logs": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "node_aid": {
                                    "type": "string"
                                },
                                "external_id": {
                                    "type": "integer"
                                },
                                "status": {
                                    "enum": [
                                        "added",
                                        "existed",
                                        "failed"
                                    ]
                                }
                            },
                            "required": [
                                "node_aid",
                                "external_id",
                                "status"
                            ],
                            "additionalProperties": false
                        }
                    }
                },
                "required": [
                    "status",
                    "action_logs"
                ],
                "additionalProperties": false
            },
            {
                "type": "object",
                "properties": {
                    "status": {
                        "enum": [
                            "error"
                        ]
                    },
                    "exec_time": {
                        "type": "number"
                    },
                    "message": {
                        "type": "string"
                    }
                },
                "required": [
                    "status",
                    "message"
                ],
                "additionalProperties": false
            }
        ]
    },
    "properties": {
        "request": {
            "$ref": "#/request"
        },
        "response": {
            "$ref": "#/response"
        }
    },
    "required": [
        "request",
        "response"
    ]
}