{
  "openapi": "3.0.1",
  "info": {
    "title": "IIH Semantics REST APIs",
    "version": "2.5.0"
  },
  "paths": {
    "/api/opcua/namespaces/nodeset": {
      "post": {
        "tags": [
          "OpcuaNamespaces"
        ],
        "summary": "This POST \"/api/opcua/namespaces/nodeset\" register namespace defined in a nodeset file\r\n\r\nReceives nodesetFileNamespaceRequest and multipart form-data and stores this namespace into IIH Semantics. Returns RegisterNamespacesResponse with registered namespace URIs and status message.",
        "description": "In case of non OPCUA sources, user can model OPCUA Nodeset file using tools like SiOME and update that file into IIH Semantics Aggregating Server.\r\n            This also requires data source such as MQTT or gRPC Databus. In addition to loading the XML, user can consider modelling and transforming variables in the XML \r\n            using Semantica Mapping and upload the updated XML through this same endpoint. \r\n            Once XML is updated, user can use POST nodes/mappings to deploy the mapping\r\n            \r\n            nodesetFileNamespaceRequest containing namespaceUri and its NodeSet file as a multipart form-data. Below are the details of each parameter-\r\n             - Namespaces: This is required parameter and should contain exact namespace URL as mentioned in the Nodeset file's 'NamespaceUris' element.\r\n                    If there are multiple namespaces in one single file and there are dependencies, for example, namespace B depends on namespace A,\r\n                    then either the namespace should be loaded separately in different calls, or in one call with the loading order of A, B\r\n             - NodeSetFile: This is multipart request so select the appropriate file to be uploaded.\r\n             - Whether to share the namespace with other child at the parent or not, default is false\r\n             - applyMapping: whether to apply the mapping present in the nodeset file. if true, mapping in the file is ignored. if false, then the mapping from the file is used\r\n            default is true (ignore mapping from file)\r\n            POST /api/opcua/namespaces/nodeset\r\n            Sample multi-part input:\r\n              ConnectorType=1\r\n              Namespaces=http://example.ur.robot\r\n              NodeSetFile=@semantica_example.ur.robot.xml;type=text/xml\r\n              \r\n            sample response:\r\n            {\r\n                 \"statusMessage\": \"SUCCESS\",\r\n                 \"namespaces\": [\r\n                     \"http://example.ur.robot\"\r\n                 ],\r\n                 \"error\": null\r\n            }\r\n            \r\n            Note\r\n            Assumptions:\r\n            It is assume that the file has no unnecessary backward references from depedent to depending namespace.\r\n            For example, if DI, Robotics and Kuka are in the consolidated file, then we should not see DI referencing kuka\r\n            via \"organize\", instead we see the backward reference from kuka to DI \"organizedBy\"",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "GenerateGraph",
                  "Namespaces",
                  "NodesetFile"
                ],
                "type": "object",
                "properties": {
                  "NodesetFile": {
                    "type": "string",
                    "description": "The opcua nodeset file",
                    "format": "binary"
                  },
                  "IsSharedInParentDuringSync": {
                    "type": "boolean",
                    "description": "whether to share the namespace with other child at the parent or not, default is false",
                    "default": "false"
                  },
                  "ApplyMapping": {
                    "type": "boolean",
                    "description": "whether to apply the mapping present in the nodeset file. \r\nif true, mapping in the file is ignored.\r\nif false, then the mapping from the file is used\r\ndefault is true (ignore mapping from file)",
                    "default": "true"
                  },
                  "Namespaces": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The source namespace (from online, or from file)\r\nIf multiple namespaces are provided, they should come in the dependency order\r\nFor example, if there are two namespaces available in file\r\nand B(Robotics) depend on A(DI), then the order should be A(DI), B(Robotics)"
                  },
                  "GenerateGraph": {
                    "type": "boolean",
                    "description": "whether to generate graph or not, default is false",
                    "default": "true"
                  }
                }
              },
              "encoding": {
                "NodesetFile": {
                  "style": "form"
                },
                "IsSharedInParentDuringSync": {
                  "style": "form"
                },
                "ApplyMapping": {
                  "style": "form"
                },
                "Namespaces": {
                  "style": "form"
                },
                "GenerateGraph": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns StatusMessage as SUCCESS and the namespaceUrl which was uploaded.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NamespaceUpdateWithMappingResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NamespaceUpdateWithMappingResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NamespaceUpdateWithMappingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad requests: StatusMessage with appropriate message and the namespaceUrl."
          }
        }
      },
      "put": {
        "tags": [
          "OpcuaNamespaces"
        ],
        "summary": "Update Virtual Namespace with the nodeset xml",
        "description": "Example:\r\n\r\nPUT /api/opcua/namespaces/nodeset\r\nnamespaceUri: \"http://example.kuka.robot\"\r\nNodeSetFile: kuka.xml\r\n            \r\nPrecondition:\r\nThe namespace was onboarded to aggregation server",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "NamespaceUri",
                  "NodesetFile"
                ],
                "type": "object",
                "properties": {
                  "NamespaceUri": {
                    "type": "string",
                    "description": "The namespaceUri to do update"
                  },
                  "NodesetFile": {
                    "type": "string",
                    "description": "The opcua nodeset file",
                    "format": "binary"
                  },
                  "ApplyMapping": {
                    "type": "boolean",
                    "description": "whether to apply the mapping present in the nodeset file. \r\nif true, mapping in the file is ignored.\r\nif false, then the mapping from the file is used\r\ndefault is true (ignore mapping from file)",
                    "default": "true"
                  }
                }
              },
              "encoding": {
                "NamespaceUri": {
                  "style": "form"
                },
                "NodesetFile": {
                  "style": "form"
                },
                "ApplyMapping": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns NamespaceUpdateResponse object",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NamespaceUpdateWithMappingResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NamespaceUpdateWithMappingResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NamespaceUpdateWithMappingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request with the reason of failure."
          }
        }
      }
    },
    "/api/opcua/namespaces/server": {
      "post": {
        "tags": [
          "OpcuaNamespaces"
        ],
        "summary": "This API POST \"/api/opcua/namespaces/server\" registers the online opcsource's namespaces with IIHCore\r\nIf a namespace mentioned depend on other namespaces, they will be loaded as well.",
        "description": " Register the namespace from source OPCUA server using this method. \r\n Below is the sample request to be sent over POST\r\n \r\n POST /api/opcua/namespaces/server\r\n {\r\n   \"serverUri\": \"opc.tcp://localhost:48010\",\r\n    \"namespaces\": [\"http://example.kuka.robot\"],\r\n    \"browseAll\": true\r\n}\r\n\r\n Precondition:\r\n Connection is already established by POST /api/opcua/connections",
        "requestBody": {
          "description": "onlineNamespaceRequest object in JSON format.",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/SourceOpcNamespaceRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceOpcNamespaceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceOpcNamespaceRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SourceOpcNamespaceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns namespaces.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterNamespacesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterNamespacesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterNamespacesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request with the reason of failure."
          }
        }
      }
    },
    "/api/opcua/namespaces/nodes/mappings": {
      "put": {
        "tags": [
          "OpcuaNamespaces"
        ],
        "summary": "Put Semantica mapping for virtual namespace Variables. If the Semantica Mapping is available, it will be replaced with new one.",
        "description": "Put Semantica mapping for virtual namespace Variable.\r\n\r\nSample request:\r\n            \r\n    PUT /api/opcua/namespaces/nodes/mappings\r\n    [\r\n        {\r\n            \"VariableId\":\r\n            {\r\n                \"namespaceUri\": \"http://sensor.robot\",\r\n                \"identifierType\": 0,\r\n                \"identifier\": \"6001\"\r\n            },\r\n            \"archive\": true,\r\n            \"semanticaMapping\": {\r\n                \"expression\": \"var1 + var2 + 10\", -> semantica:Expression element inside semantica:Mapping \r\n                \"ruleName\":\"rule_1\",  - > Make attribute on semantica:Expression element named RuleLabel and copy value \r\n                \"variables\" : \r\n                [ \r\n                    { \r\n                        \"sourceType\": \"grpc\", \r\n                        \"appInstanceId\": \"css7pdriver1\", \r\n                        \"connectionName\": \"3_442_1516_2.9_216.157\", \r\n                        \"tagName\": \"S7Tag1\", \r\n                        \"target\": \"var1\", \r\n                        \"tagDataType\": \"DT_INT16\" \r\n                    },  \r\n                    { \r\n                     \"sourceType\": \"iedatabus\", \r\n                        \"appInstanceId\": \"mbtcp1\", \r\n                        \"connectionName\": \"modbus_connection\", \r\n                        \"tagName\": \"IntTag\", \r\n                        \"target\": \"var2\", \r\n                        \"tagDataType\": \"DInt\" \r\n                    } \r\n                ] \r\n            }\r\n        }\r\n    ]\r\n    \r\nidentifierType (int: enum):\r\n    0: Number\r\n    1: String\r\n    2: GUID\r\n    3: Opaque \r\n    \r\nvariable Type (int: enum) \r\n    0:Double,\r\n    1:Boolean,\r\n    2:String,\r\n    3:Object\r\n            \r\nPUT replaces the existing Semantica Mapping with the new one. If this needs to be deleted then use DELETE interface.\r\n    \r\nMeaning of SemanticaValidationResult:\r\n\r\n    error during mapping\r\n    [EnumMember(Value = \"Unexpected\")] Unexpected = -2,\r\n    mapping is not done\r\n    [EnumMember(Value = \"Undefined\")] Undefined = -1,\r\n    fully matched, example: uint32 to uint32, string to string, bool to bool\r\n    [EnumMember(Value = \"Matched\")] Matched = 0,\r\n    Mismatched, example: bool to string, double to bool etc.\r\n    [EnumMember(Value = \"Mismatched\")] Mismatched = 1,\r\n    mismatch between sign and unsign\r\n    [EnumMember(Value = \"SignMismatched\")] SignMismatched = 2,\r\n    mismatch between number of bits, source has less number of bits than destination => ok, give info\r\n    [EnumMember(Value = \"BitMismatchedSourceLessBit\")] BitMismatchedSourceLessBit = 3,\r\n    mismatch between number of bits, source has more number of bits than destination => give warning\r\n    [EnumMember(Value = \"BitMismatchedSourceMoreBit\")] BitMismatchedSourceMoreBit = 4,\r\n    string to LocalizedText -s ok, but only to en-US\r\n    [EnumMember(Value = \"StringToLocalizedText\")] StringToLocalizedText = 5,\r\n    Array definition for source and destination matched\r\n    [EnumMember(Value = \"ArrayMatched\")] ArrayMatched = 10,\r\n    multiple array variables in expression\r\n    [EnumMember(Value = \"MultipleArrayVariablesInExpression\")] MultipleArrayVariablesInExpression = 11,\r\n    array value ranks mismatched\r\n    [EnumMember(Value = \"ArrayValueRanksMismatched\")] ArrayValueRanksMismatched = 12,\r\n    array dimensions mismatched\r\n    [EnumMember(Value = \"ArrayDimensionsMismatched\")] ArrayDimensionsMismatched = 13,\r\n    example: Read/Read, write/write, read => readwrite (opc), write=> readwrite(opc)\r\n    [EnumMember(Value = \"AccessRightMatched\")] AccessRightMatched = 20,\r\n    Connector ReadOnly but OpcVariable WriteOnly\r\n    [EnumMember(Value = \"InvalidAccessRightNone\")] InvalidAccessRightNone = 21,\r\n    Connector ReadOnly but OpcVariable WriteOnly\r\n    [EnumMember(Value = \"SourceReadTargetWrite\")] InvalidAccessRightConfigSourceReadTargetWrite = 22,\r\n    Connector WriteOnly but OpcVariable ReadOnly\r\n    [EnumMember(Value = \"SourceWriteTargetRead\")] InvalidAccessRightConfigSourceWriteTargetRead = 23,\r\n    Connector Read but OpcVariable ReadWrite => hint user to Modify Opc to Read\r\n    [EnumMember(Value = \"SourceReadTargetReadWrite\")] InvalidAccessRightConfigModifyOpcToRead = 24,\r\n    Connector Write but OpcVariable ReadWrite => hint user to Modify Opc to Write\r\n    [EnumMember(Value = \"SourceWriteTargetReaddWrite\")] InvalidAccessRightConfigModifyOpcToWrite = 25,",
        "requestBody": {
          "description": "List of instanceVariableUpdateRequests, \r\n             each instanceVariableUpdateRequest contains Node Id, Store flag and Semantica mapping for that node",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/NodeMappingRequest"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/NodeMappingRequest"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/NodeMappingRequest"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/NodeMappingRequest"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NodeMappingResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NodeMappingResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NodeMappingResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "OpcuaNamespaces"
        ],
        "summary": "Delete Semantica mapping for virtual namespace Variables",
        "description": "Delete Semantica mapping for virtual namespace Variable\r\nSample request:\r\n\r\n    DELETE /api/opcua/nodes/mappings\r\n    [\r\n        {\r\n            \"namespaceUri\": \"http://sensor.robot\",\r\n            \"identifierType\": 0,\r\n            \"identifier\": \"6001\"\r\n        }\r\n    ]\r\n    \r\nidentifierType (int: enum):\r\n    0: Number\r\n    1: String\r\n    2: GUID\r\n    3: Opaque \r\n    \r\nvariable Type (int: enum) \r\n    0:Double,\r\n    1:Boolean,\r\n    2:String,\r\n    3:Object",
        "requestBody": {
          "description": "Node IDs of the OPCUA nodes on which the Semantica mapping should be deleted.",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PdmNodeId"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PdmNodeId"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PdmNodeId"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PdmNodeId"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NodeMappingResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NodeMappingResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NodeMappingResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/opcua/namespaces/nodes/mappings/query": {
      "post": {
        "tags": [
          "OpcuaNamespaces"
        ],
        "summary": "Get Semantica mapping for virtual namespace Variables and Asset variables.",
        "description": "Get Semantica mapping for virtual namespace Variable and Asset variables.\r\nSample request:\r\n            \r\n    POST /api/opcua/nodes/mappings/query\r\n    [\r\n        {\r\n            {\r\n                \"namespaceUri\": \"http://sensor.robot\",\r\n                \"identifierType\": 0,\r\n                \"identifier\": \"6001\"\r\n            },\r\n            {\r\n                \"namespaceUri\": \"http://Siemens.net/IIHAsset\",\r\n                \"identifierType\": 0,\r\n                \"identifier\": \"102\"\r\n            }\r\n         }\r\n    ]\r\n    \r\nidentifierType (int: enum):\r\n    0: Number\r\n    1: String\r\n    2: GUID\r\n    3: Opaque \r\n    \r\nvariable Type (int: enum) \r\n    0:Double,\r\n    1:Boolean,\r\n    2:String,\r\n    3:Object\r\n    \r\nMeaning of SemanticaValidationResult:\r\n\r\n    error during mapping\r\n    [EnumMember(Value = \"Unexpected\")] Unexpected = -2,\r\n    mapping is not done\r\n    [EnumMember(Value = \"Undefined\")] Undefined = -1,\r\n    fully matched, example: uint32 to uint32, string to string, bool to bool\r\n    [EnumMember(Value = \"Matched\")] Matched = 0,\r\n    Mismatched, example: bool to string, double to bool etc.\r\n    [EnumMember(Value = \"Mismatched\")] Mismatched = 1,\r\n    mismatch between sign and unsign\r\n    [EnumMember(Value = \"SignMismatched\")] SignMismatched = 2,\r\n    mismatch between number of bits, source has less number of bits than destination => ok, give info\r\n    [EnumMember(Value = \"BitMismatchedSourceLessBit\")] BitMismatchedSourceLessBit = 3,\r\n    mismatch between number of bits, source has more number of bits than destination => give warning\r\n    [EnumMember(Value = \"BitMismatchedSourceMoreBit\")] BitMismatchedSourceMoreBit = 4,\r\n    string to LocalizedText -s ok, but only to en-US\r\n    [EnumMember(Value = \"StringToLocalizedText\")] StringToLocalizedText = 5,\r\n    Array definition for source and destination matched\r\n    [EnumMember(Value = \"ArrayMatched\")] ArrayMatched = 10,\r\n    multiple array variables in expression\r\n    [EnumMember(Value = \"MultipleArrayVariablesInExpression\")] MultipleArrayVariablesInExpression = 11,\r\n    array value ranks mismatched\r\n    [EnumMember(Value = \"ArrayValueRanksMismatched\")] ArrayValueRanksMismatched = 12,\r\n    array dimensions mismatched\r\n    [EnumMember(Value = \"ArrayDimensionsMismatched\")] ArrayDimensionsMismatched = 13,\r\n    example: Read/Read, write/write, read => readwrite (opc), write=> readwrite(opc)\r\n    [EnumMember(Value = \"AccessRightMatched\")] AccessRightMatched = 20,\r\n    OpcVariable Not Readable and not writable\r\n    [EnumMember(Value = \"InvalidAccessRightNone\")] InvalidAccessRightNone = 21,\r\n    Connector ReadOnly but OpcVariable WriteOnly\r\n    [EnumMember(Value = \"SourceReadTargetWrite\")] InvalidAccessRightConfigSourceReadTargetWrite = 22,\r\n    Connector WriteOnly but OpcVariable ReadOnly\r\n    [EnumMember(Value = \"SourceWriteTargetRead\")] InvalidAccessRightConfigSourceWriteTargetRead = 23,\r\n    Connector Read but OpcVariable ReadWrite => hint user to Modify Opc to Read\r\n    [EnumMember(Value = \"SourceReadTargetReadWrite\")] InvalidAccessRightConfigModifyOpcToRead = 24,\r\n    Connector Write but OpcVariable ReadWrite => hint user to Modify Opc to Write\r\n    [EnumMember(Value = \"SourceWriteTargetReaddWrite\")] InvalidAccessRightConfigModifyOpcToWrite = 25,",
        "requestBody": {
          "description": "List of variableIds, it can be the virtual namespace variable or asset variable",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PdmNodeId"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PdmNodeId"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PdmNodeId"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PdmNodeId"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NodeMappingResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NodeMappingResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NodeMappingResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/opcua/namespaces/graph": {
      "post": {
        "tags": [
          "OpcuaNamespaces"
        ],
        "summary": "Trigger graph generation for namespace uri",
        "description": "Example:\r\n\r\nPOST /api/opcua/namespaces/graph\r\n\"http://example.kuka.robot\"\r\n            \r\nPrecondition:\r\nThe namespace was onboarded to aggregation server",
        "requestBody": {
          "description": "namespace to generate graph",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "string"
              }
            },
            "application/json": {
              "schema": {
                "type": "string"
              }
            },
            "text/json": {
              "schema": {
                "type": "string"
              }
            },
            "application/*+json": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns graph response object",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GraphResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GraphResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GraphResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request with the reason of failure."
          }
        }
      },
      "delete": {
        "tags": [
          "OpcuaNamespaces"
        ],
        "summary": "Delete graph for namespace uri",
        "description": "Example:\r\n\r\nDELETE /api/opcua/namespaces/graph\r\n\"http://example.kuka.robot\"\r\n            \r\nDelete the graph if it was already generated",
        "requestBody": {
          "description": "namespace to delete graph",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "string"
              }
            },
            "application/json": {
              "schema": {
                "type": "string"
              }
            },
            "text/json": {
              "schema": {
                "type": "string"
              }
            },
            "application/*+json": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns Connection object containing current connection.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GraphResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GraphResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GraphResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request with the reason of failure."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BaseError": {
        "type": "object",
        "properties": {
          "errorId": {
            "$ref": "#/components/schemas/NamespaceError"
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GraphResponse": {
        "type": "object",
        "properties": {
          "statusMessage": {
            "type": "string",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/BaseError"
          }
        },
        "additionalProperties": false,
        "description": "response class for POST graph and DELETE graph"
      },
      "KnownTypes": {
        "enum": [
          0,
          1,
          2,
          3,
          -1
        ],
        "type": "integer",
        "format": "int32"
      },
      "NamespaceError": {
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12
        ],
        "type": "integer",
        "format": "int32"
      },
      "NamespaceUpdateWithMappingResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatusItem"
            },
            "description": "this part returns a list of StatusMessageItem\r\nfor the items with problems.\r\nEach StatusMessageItem had id + Code + message to describe the problem",
            "nullable": true
          },
          "results": {
            "type": "array",
            "items": {},
            "description": "The ones that was successfully updated comes here with\r\nid+detail decription object (depending on the request this object maybe different)",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "NodeIdentifierType": {
        "enum": [
          0,
          1,
          2,
          3
        ],
        "type": "integer",
        "format": "int32"
      },
      "NodeMappingRequest": {
        "required": [
          "variableId"
        ],
        "type": "object",
        "properties": {
          "variableId": {
            "$ref": "#/components/schemas/PdmNodeId"
          },
          "cloudSync": {
            "type": "string",
            "description": "String to remember CloudSync information",
            "nullable": true
          },
          "archive": {
            "type": "boolean",
            "description": "Boolean to remember Archive information"
          },
          "semanticaMapping": {
            "$ref": "#/components/schemas/SemanticaMapping"
          }
        },
        "additionalProperties": false,
        "description": "InstanceUpdateRequest defines structure send over to update semantica mapping of virtual namespace"
      },
      "NodeMappingResponse": {
        "type": "object",
        "properties": {
          "variable": {
            "$ref": "#/components/schemas/OpcMappingVariable"
          }
        },
        "additionalProperties": false
      },
      "OpcMappingVariable": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "variableId": {
            "$ref": "#/components/schemas/PDMNodeId"
          },
          "semanticaMapping": {
            "$ref": "#/components/schemas/SemanticaMapping"
          },
          "type": {
            "$ref": "#/components/schemas/KnownTypes"
          },
          "semanticaValidationResult": {
            "$ref": "#/components/schemas/SemanticaValidationResult"
          },
          "validationResults": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SemanticaValidationResultAndMessage"
            },
            "nullable": true
          },
          "validationMessage": {
            "type": "string",
            "nullable": true
          },
          "archive": {
            "type": "boolean"
          },
          "cloudSync": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "type": "string",
            "nullable": true
          },
          "isTriggeredByEssential": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "PDMNodeId": {
        "type": "object",
        "properties": {
          "namespaceUri": {
            "type": "string",
            "nullable": true
          },
          "identifierType": {
            "$ref": "#/components/schemas/NodeIdentifierType"
          },
          "identifier": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PdmNodeId": {
        "required": [
          "identifierType",
          "namespaceUri"
        ],
        "type": "object",
        "properties": {
          "namespaceUri": {
            "minLength": 1,
            "type": "string",
            "description": "NamespaceUri of the PdmNodeId"
          },
          "identifier": {
            "type": "string",
            "description": "The Identifier of the PdmNodeId",
            "nullable": true
          },
          "identifierType": {
            "$ref": "#/components/schemas/NodeIdentifierType"
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": {}
      },
      "RegisterNamespacesResponse": {
        "type": "object",
        "properties": {
          "statusMessage": {
            "type": "string",
            "nullable": true
          },
          "namespaces": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/BaseError"
          }
        },
        "additionalProperties": false
      },
      "SemanticaExpressionVariable": {
        "type": "object",
        "properties": {
          "sourceType": {
            "type": "string",
            "nullable": true
          },
          "appInstanceId": {
            "type": "string",
            "nullable": true
          },
          "tagDataType": {
            "type": "string",
            "nullable": true
          },
          "target": {
            "type": "string",
            "nullable": true
          },
          "connectionName": {
            "type": "string",
            "nullable": true
          },
          "tagName": {
            "type": "string",
            "nullable": true
          },
          "valueRank": {
            "type": "integer",
            "format": "int32"
          },
          "arrayDimensions": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "nullable": true
          },
          "accessRight": {
            "type": "integer",
            "format": "int32"
          },
          "acquisitionCycle": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "SemanticaMapping": {
        "type": "object",
        "properties": {
          "expression": {
            "type": "string",
            "nullable": true
          },
          "ruleName": {
            "type": "string",
            "nullable": true
          },
          "variables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SemanticaExpressionVariable"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SemanticaValidationResult": {
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5,
          10,
          11,
          12,
          13,
          20,
          21,
          22,
          23,
          24,
          25,
          -2,
          -1
        ],
        "type": "integer",
        "format": "int32"
      },
      "SemanticaValidationResultAndMessage": {
        "type": "object",
        "properties": {
          "result": {
            "$ref": "#/components/schemas/SemanticaValidationResult"
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SourceOpcNamespaceRequest": {
        "required": [
          "generateGraph",
          "namespaces"
        ],
        "type": "object",
        "properties": {
          "namespaces": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The source namespace (from online, or from file)\r\nIf multiple namespaces are provided, they should come in the dependency order\r\nFor example, if there are two namespaces available in file\r\nand B(Robotics) depend on A(DI), then the order should be A(DI), B(Robotics)"
          },
          "generateGraph": {
            "type": "boolean",
            "description": "whether to generate graph or not, default is false",
            "default": "true"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid"
          },
          "serverUri": {
            "type": "string",
            "format": "uri",
            "nullable": true
          },
          "browseAll": {
            "type": "boolean"
          },
          "reuseDependencies": {
            "type": "boolean",
            "description": "if the requested namespace depend on other namespaces, whether to get those dependencies or use what is already\r\nloaded via POST nodesets. Also in case the dependencies were not available, then it will save the dependencies for reuse\r\nDefault is true, ie, use the loaded namespace. \r\nExample, browse for Kuka, that needs DI http://opcfoundation.org/UA/DI/ (already POSTED)\r\nReuseDependencies - true: reuse the DI http://opcfoundation.org/UA/DI/ posted already, load if necessary, if loading from server\r\n                            these dependencies will be reusable\r\nReuseDependencies - false: browse and get it from server http://localhost_48010/opcfoundation.org/UA/DI/, regardless whether\r\n                            the DI was already loaded"
          }
        },
        "additionalProperties": false,
        "description": "OnlineNamespaceRequest: define for OnlineNamespaceRequest"
      },
      "StatusItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Id to identify this status",
            "nullable": true
          },
          "messages": {
            "$ref": "#/components/schemas/StatusMessageItem"
          },
          "code": {
            "type": "string",
            "description": "code for the message, Info/Warning/Error",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "StatusMessageItem": {
        "type": "object",
        "properties": {
          "messageId": {
            "type": "integer",
            "description": "a message Id",
            "format": "int32"
          },
          "messageDetail": {
            "type": "string",
            "description": "detail of the message",
            "nullable": true
          },
          "messageParameters": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "nullable": true
            },
            "description": "parameters to be used in the message, this is for translation",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One message item to describe status of one resource (identified by id)"
      }
    },
    "securitySchemes": {}
  },
  "security": [
    {
      "Swagger": []
    }
  ]
}