> For the complete documentation index, see [llms.txt](https://docs.enlyze.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.enlyze.com/en/enlyze-api/api-reference/variable-discoveries.md).

# Variable Discoveries

## Get Variable Discovery

> Returns details for a specific Variable Discovery.

```json
{"openapi":"3.1.0","info":{"title":"ENLYZE API","version":"v2"},"tags":[{"name":"Variable Discoveries"}],"servers":[{"url":"/api"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"VariableDiscoveryResponse":{"properties":{"uuid":{"type":"string","format":"uuid","title":"Uuid","description":"Unique identifier for this variable discovery"},"data_source":{"type":"string","format":"uuid","title":"Data Source","description":"The data source this variable discovery is assigned to."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when this variable discovery was created."},"last_modified_at":{"type":"string","format":"date-time","title":"Last Modified At","description":"Timestamp when this variable discovery was last modified, generally the case when its state changes."},"state":{"oneOf":[{"$ref":"#/components/schemas/VariableDiscoveryPendingState"},{"$ref":"#/components/schemas/VariableDiscoveryInProgressState"},{"$ref":"#/components/schemas/VariableDiscoverySucessState"},{"$ref":"#/components/schemas/VariableDiscoveryFailureState"}],"title":"State","description":"The current state of the variable discovery.","discriminator":{"propertyName":"type","mapping":{"FAILURE":"#/components/schemas/VariableDiscoveryFailureState","IN_PROGRESS":"#/components/schemas/VariableDiscoveryInProgressState","PENDING":"#/components/schemas/VariableDiscoveryPendingState","SUCCESS":"#/components/schemas/VariableDiscoverySucessState"}}}},"type":"object","required":["uuid","data_source","created_at","last_modified_at","state"],"title":"VariableDiscoveryResponse"},"VariableDiscoveryPendingState":{"properties":{"type":{"type":"string","const":"PENDING","title":"Type"}},"type":"object","required":["type"],"title":"VariableDiscoveryPendingState"},"VariableDiscoveryInProgressState":{"properties":{"type":{"type":"string","const":"IN_PROGRESS","title":"Type"},"added_variables":{"type":"integer","title":"Added Variables","description":"The number of variables added by this discovery"}},"type":"object","required":["type","added_variables"],"title":"VariableDiscoveryInProgressState"},"VariableDiscoverySucessState":{"properties":{"type":{"type":"string","const":"SUCCESS","title":"Type"},"added_variables":{"type":"integer","title":"Added Variables","description":"The number of variables added by this discovery"}},"type":"object","required":["type","added_variables"],"title":"VariableDiscoverySucessState"},"VariableDiscoveryFailureState":{"properties":{"type":{"type":"string","const":"FAILURE","title":"Type"},"reason":{"oneOf":[{"$ref":"#/components/schemas/HostLookupError"},{"$ref":"#/components/schemas/NoRouteToHost"},{"$ref":"#/components/schemas/HostDown"},{"$ref":"#/components/schemas/NetworkUnreachable"},{"$ref":"#/components/schemas/ConnectionRefused"},{"$ref":"#/components/schemas/ConnectionReset"},{"$ref":"#/components/schemas/ConnectionClosed"},{"$ref":"#/components/schemas/Timeout"},{"$ref":"#/components/schemas/EnlyzeGatewayError"},{"$ref":"#/components/schemas/OpcUaErrorResponse"},{"$ref":"#/components/schemas/OpcUaNoMatchingEndpointPolicy"},{"$ref":"#/components/schemas/S7PlusError"},{"$ref":"#/components/schemas/UnknownVariableDiscoveryFailureReason"}],"title":"Reason","description":"The reason why the variable discovery failed.","discriminator":{"propertyName":"type","mapping":{"CONNECTION_CLOSED":"#/components/schemas/ConnectionClosed","CONNECTION_REFUSED":"#/components/schemas/ConnectionRefused","CONNECTION_RESET":"#/components/schemas/ConnectionReset","ENLYZE_GATEWAY_ERROR":"#/components/schemas/EnlyzeGatewayError","HOST_DOWN":"#/components/schemas/HostDown","LOOKUP_ERROR":"#/components/schemas/HostLookupError","NETWORK_UNREACHABLE":"#/components/schemas/NetworkUnreachable","NO_ROUTE_TO_HOST":"#/components/schemas/NoRouteToHost","OPC_UA_ERROR_RESPONSE":"#/components/schemas/OpcUaErrorResponse","OPC_UA_NO_MATCHING_ENDPOINT_POLICY":"#/components/schemas/OpcUaNoMatchingEndpointPolicy","S7PLUS_ERROR":"#/components/schemas/S7PlusError","TIMEOUT":"#/components/schemas/Timeout","UNKNOWN":"#/components/schemas/UnknownVariableDiscoveryFailureReason"}}}},"type":"object","required":["type","reason"],"title":"VariableDiscoveryFailureState"},"HostLookupError":{"properties":{"type":{"type":"string","const":"LOOKUP_ERROR","title":"Type"}},"type":"object","required":["type"],"title":"HostLookupError"},"NoRouteToHost":{"properties":{"type":{"type":"string","const":"NO_ROUTE_TO_HOST","title":"Type"}},"type":"object","required":["type"],"title":"NoRouteToHost"},"HostDown":{"properties":{"type":{"type":"string","const":"HOST_DOWN","title":"Type"}},"type":"object","required":["type"],"title":"HostDown"},"NetworkUnreachable":{"properties":{"type":{"type":"string","const":"NETWORK_UNREACHABLE","title":"Type"}},"type":"object","required":["type"],"title":"NetworkUnreachable"},"ConnectionRefused":{"properties":{"type":{"type":"string","const":"CONNECTION_REFUSED","title":"Type"}},"type":"object","required":["type"],"title":"ConnectionRefused"},"ConnectionReset":{"properties":{"type":{"type":"string","const":"CONNECTION_RESET","title":"Type"}},"type":"object","required":["type"],"title":"ConnectionReset"},"ConnectionClosed":{"properties":{"type":{"type":"string","const":"CONNECTION_CLOSED","title":"Type"}},"type":"object","required":["type"],"title":"ConnectionClosed"},"Timeout":{"properties":{"type":{"type":"string","const":"TIMEOUT","title":"Type"}},"type":"object","required":["type"],"title":"Timeout"},"EnlyzeGatewayError":{"properties":{"type":{"type":"string","const":"ENLYZE_GATEWAY_ERROR","title":"Type"}},"type":"object","required":["type"],"title":"EnlyzeGatewayError"},"OpcUaErrorResponse":{"properties":{"type":{"type":"string","const":"OPC_UA_ERROR_RESPONSE","title":"Type"},"code":{"type":"integer","title":"Code","description":"The numerical error code returned by the OPC UA Server."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"A descriptive name corresponding to the error code."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"A descriptive string corresponding to the error code."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"The error reason returned by the server."}},"type":"object","required":["type","code"],"title":"OpcUaErrorResponse"},"OpcUaNoMatchingEndpointPolicy":{"properties":{"type":{"type":"string","const":"OPC_UA_NO_MATCHING_ENDPOINT_POLICY","title":"Type"},"endpoint_url":{"type":"string","title":"Endpoint Url","description":"The endpoint of the OPC UA server"},"endpoint_security_policy_uri":{"type":"string","title":"Endpoint Security Policy Uri","description":"The URI of the requested Endpoint Security Policy"},"message_security_mode":{"type":"string","title":"Message Security Mode","description":"The requested Message Security Mode"},"token_type":{"type":"string","title":"Token Type","description":"The configured Token Type"},"token_security_policy_uri":{"type":"string","title":"Token Security Policy Uri","description":"The requested Token Security Policy"}},"type":"object","required":["type","endpoint_url","endpoint_security_policy_uri","message_security_mode","token_type","token_security_policy_uri"],"title":"OpcUaNoMatchingEndpointPolicy"},"S7PlusError":{"properties":{"type":{"type":"string","const":"S7PLUS_ERROR","title":"Type"},"category":{"$ref":"#/components/schemas/S7PlusErrorCategory","description":"The category of the error. `AUTHENTICATION` can indicate an incorrect password or lack of permissions."}},"type":"object","required":["type","category"],"title":"S7PlusError"},"S7PlusErrorCategory":{"type":"string","enum":["AUTHENTICATION","UNKNOWN"],"title":"S7PlusErrorCategory"},"UnknownVariableDiscoveryFailureReason":{"properties":{"type":{"type":"string","const":"UNKNOWN","title":"Type"}},"type":"object","required":["type"],"title":"UnknownVariableDiscoveryFailureReason"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/variable-discoveries/{uuid}":{"get":{"tags":["Variable Discoveries"],"summary":"Get Variable Discovery","description":"Returns details for a specific Variable Discovery.","operationId":"get_variable_discovery_v2_variable_discoveries__uuid__get","parameters":[{"name":"uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The UUID of the Variable Discovery."}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariableDiscoveryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Get Variable Discoveries

> Lists Variable Discovery resources

```json
{"openapi":"3.1.0","info":{"title":"ENLYZE API","version":"v2"},"tags":[{"name":"Variable Discoveries"}],"servers":[{"url":"/api"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"VariableDiscoveryState":{"type":"string","enum":["PENDING","IN_PROGRESS","SUCCESS","FAILURE"],"title":"VariableDiscoveryState"},"PaginatedVariableDiscoveries":{"properties":{"data":{"items":{"$ref":"#/components/schemas/VariableDiscoveryResponse"},"type":"array","title":"Data"},"metadata":{"$ref":"#/components/schemas/Metadata","description":"This field contains pagination metadata."}},"additionalProperties":false,"type":"object","required":["data","metadata"],"title":"PaginatedVariableDiscoveries"},"VariableDiscoveryResponse":{"properties":{"uuid":{"type":"string","format":"uuid","title":"Uuid","description":"Unique identifier for this variable discovery"},"data_source":{"type":"string","format":"uuid","title":"Data Source","description":"The data source this variable discovery is assigned to."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when this variable discovery was created."},"last_modified_at":{"type":"string","format":"date-time","title":"Last Modified At","description":"Timestamp when this variable discovery was last modified, generally the case when its state changes."},"state":{"oneOf":[{"$ref":"#/components/schemas/VariableDiscoveryPendingState"},{"$ref":"#/components/schemas/VariableDiscoveryInProgressState"},{"$ref":"#/components/schemas/VariableDiscoverySucessState"},{"$ref":"#/components/schemas/VariableDiscoveryFailureState"}],"title":"State","description":"The current state of the variable discovery.","discriminator":{"propertyName":"type","mapping":{"FAILURE":"#/components/schemas/VariableDiscoveryFailureState","IN_PROGRESS":"#/components/schemas/VariableDiscoveryInProgressState","PENDING":"#/components/schemas/VariableDiscoveryPendingState","SUCCESS":"#/components/schemas/VariableDiscoverySucessState"}}}},"type":"object","required":["uuid","data_source","created_at","last_modified_at","state"],"title":"VariableDiscoveryResponse"},"VariableDiscoveryPendingState":{"properties":{"type":{"type":"string","const":"PENDING","title":"Type"}},"type":"object","required":["type"],"title":"VariableDiscoveryPendingState"},"VariableDiscoveryInProgressState":{"properties":{"type":{"type":"string","const":"IN_PROGRESS","title":"Type"},"added_variables":{"type":"integer","title":"Added Variables","description":"The number of variables added by this discovery"}},"type":"object","required":["type","added_variables"],"title":"VariableDiscoveryInProgressState"},"VariableDiscoverySucessState":{"properties":{"type":{"type":"string","const":"SUCCESS","title":"Type"},"added_variables":{"type":"integer","title":"Added Variables","description":"The number of variables added by this discovery"}},"type":"object","required":["type","added_variables"],"title":"VariableDiscoverySucessState"},"VariableDiscoveryFailureState":{"properties":{"type":{"type":"string","const":"FAILURE","title":"Type"},"reason":{"oneOf":[{"$ref":"#/components/schemas/HostLookupError"},{"$ref":"#/components/schemas/NoRouteToHost"},{"$ref":"#/components/schemas/HostDown"},{"$ref":"#/components/schemas/NetworkUnreachable"},{"$ref":"#/components/schemas/ConnectionRefused"},{"$ref":"#/components/schemas/ConnectionReset"},{"$ref":"#/components/schemas/ConnectionClosed"},{"$ref":"#/components/schemas/Timeout"},{"$ref":"#/components/schemas/EnlyzeGatewayError"},{"$ref":"#/components/schemas/OpcUaErrorResponse"},{"$ref":"#/components/schemas/OpcUaNoMatchingEndpointPolicy"},{"$ref":"#/components/schemas/S7PlusError"},{"$ref":"#/components/schemas/UnknownVariableDiscoveryFailureReason"}],"title":"Reason","description":"The reason why the variable discovery failed.","discriminator":{"propertyName":"type","mapping":{"CONNECTION_CLOSED":"#/components/schemas/ConnectionClosed","CONNECTION_REFUSED":"#/components/schemas/ConnectionRefused","CONNECTION_RESET":"#/components/schemas/ConnectionReset","ENLYZE_GATEWAY_ERROR":"#/components/schemas/EnlyzeGatewayError","HOST_DOWN":"#/components/schemas/HostDown","LOOKUP_ERROR":"#/components/schemas/HostLookupError","NETWORK_UNREACHABLE":"#/components/schemas/NetworkUnreachable","NO_ROUTE_TO_HOST":"#/components/schemas/NoRouteToHost","OPC_UA_ERROR_RESPONSE":"#/components/schemas/OpcUaErrorResponse","OPC_UA_NO_MATCHING_ENDPOINT_POLICY":"#/components/schemas/OpcUaNoMatchingEndpointPolicy","S7PLUS_ERROR":"#/components/schemas/S7PlusError","TIMEOUT":"#/components/schemas/Timeout","UNKNOWN":"#/components/schemas/UnknownVariableDiscoveryFailureReason"}}}},"type":"object","required":["type","reason"],"title":"VariableDiscoveryFailureState"},"HostLookupError":{"properties":{"type":{"type":"string","const":"LOOKUP_ERROR","title":"Type"}},"type":"object","required":["type"],"title":"HostLookupError"},"NoRouteToHost":{"properties":{"type":{"type":"string","const":"NO_ROUTE_TO_HOST","title":"Type"}},"type":"object","required":["type"],"title":"NoRouteToHost"},"HostDown":{"properties":{"type":{"type":"string","const":"HOST_DOWN","title":"Type"}},"type":"object","required":["type"],"title":"HostDown"},"NetworkUnreachable":{"properties":{"type":{"type":"string","const":"NETWORK_UNREACHABLE","title":"Type"}},"type":"object","required":["type"],"title":"NetworkUnreachable"},"ConnectionRefused":{"properties":{"type":{"type":"string","const":"CONNECTION_REFUSED","title":"Type"}},"type":"object","required":["type"],"title":"ConnectionRefused"},"ConnectionReset":{"properties":{"type":{"type":"string","const":"CONNECTION_RESET","title":"Type"}},"type":"object","required":["type"],"title":"ConnectionReset"},"ConnectionClosed":{"properties":{"type":{"type":"string","const":"CONNECTION_CLOSED","title":"Type"}},"type":"object","required":["type"],"title":"ConnectionClosed"},"Timeout":{"properties":{"type":{"type":"string","const":"TIMEOUT","title":"Type"}},"type":"object","required":["type"],"title":"Timeout"},"EnlyzeGatewayError":{"properties":{"type":{"type":"string","const":"ENLYZE_GATEWAY_ERROR","title":"Type"}},"type":"object","required":["type"],"title":"EnlyzeGatewayError"},"OpcUaErrorResponse":{"properties":{"type":{"type":"string","const":"OPC_UA_ERROR_RESPONSE","title":"Type"},"code":{"type":"integer","title":"Code","description":"The numerical error code returned by the OPC UA Server."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"A descriptive name corresponding to the error code."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"A descriptive string corresponding to the error code."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"The error reason returned by the server."}},"type":"object","required":["type","code"],"title":"OpcUaErrorResponse"},"OpcUaNoMatchingEndpointPolicy":{"properties":{"type":{"type":"string","const":"OPC_UA_NO_MATCHING_ENDPOINT_POLICY","title":"Type"},"endpoint_url":{"type":"string","title":"Endpoint Url","description":"The endpoint of the OPC UA server"},"endpoint_security_policy_uri":{"type":"string","title":"Endpoint Security Policy Uri","description":"The URI of the requested Endpoint Security Policy"},"message_security_mode":{"type":"string","title":"Message Security Mode","description":"The requested Message Security Mode"},"token_type":{"type":"string","title":"Token Type","description":"The configured Token Type"},"token_security_policy_uri":{"type":"string","title":"Token Security Policy Uri","description":"The requested Token Security Policy"}},"type":"object","required":["type","endpoint_url","endpoint_security_policy_uri","message_security_mode","token_type","token_security_policy_uri"],"title":"OpcUaNoMatchingEndpointPolicy"},"S7PlusError":{"properties":{"type":{"type":"string","const":"S7PLUS_ERROR","title":"Type"},"category":{"$ref":"#/components/schemas/S7PlusErrorCategory","description":"The category of the error. `AUTHENTICATION` can indicate an incorrect password or lack of permissions."}},"type":"object","required":["type","category"],"title":"S7PlusError"},"S7PlusErrorCategory":{"type":"string","enum":["AUTHENTICATION","UNKNOWN"],"title":"S7PlusErrorCategory"},"UnknownVariableDiscoveryFailureReason":{"properties":{"type":{"type":"string","const":"UNKNOWN","title":"Type"}},"type":"object","required":["type"],"title":"UnknownVariableDiscoveryFailureReason"},"Metadata":{"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Pagination continuation point. Specify its value as the `cursor` parameter in a request with otherwise the same parameters to fetch the next page. `None`, if there is no more data to be fetched from the server."}},"additionalProperties":false,"type":"object","required":["next_cursor"],"title":"Metadata"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/variable-discoveries":{"get":{"tags":["Variable Discoveries"],"summary":"Get Variable Discoveries","description":"Lists Variable Discovery resources","operationId":"get_variable_discoveries_v2_variable_discoveries_get","parameters":[{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"array","uniqueItems":true,"items":{"$ref":"#/components/schemas/VariableDiscoveryState"},"maxItems":50},{"type":"null"}],"title":"Filter by one or more Variable Discovery states."}},{"name":"data_source","in":"query","required":false,"schema":{"anyOf":[{"type":"array","uniqueItems":true,"items":{"type":"string","format":"uuid"},"maxItems":50},{"type":"null"}],"title":"Filter by one or more data sources."}},{"name":"machine","in":"query","required":false,"schema":{"anyOf":[{"type":"array","uniqueItems":true,"items":{"type":"string","format":"uuid"},"maxItems":50},{"type":"null"}],"title":"Filter by one or more machine UUIDs."}},{"name":"spark","in":"query","required":false,"schema":{"anyOf":[{"type":"array","uniqueItems":true,"items":{"type":"string","format":"uuid"},"maxItems":50},{"type":"null"}],"title":"Filter by one or more SPARK UUIDs."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","title":"Get page starting at cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedVariableDiscoveries"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Create Variable Discovery

> Start a Variable Discovery run on a data source.

```json
{"openapi":"3.1.0","info":{"title":"ENLYZE API","version":"v2"},"tags":[{"name":"Variable Discoveries"}],"servers":[{"url":"/api"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"VariableDiscoveryCreateRequest":{"properties":{"data_source":{"type":"string","format":"uuid","title":"Data Source","description":"The data source this variable discovery is assigned to."}},"type":"object","required":["data_source"],"title":"VariableDiscoveryCreateRequest"},"VariableDiscoveryResponse":{"properties":{"uuid":{"type":"string","format":"uuid","title":"Uuid","description":"Unique identifier for this variable discovery"},"data_source":{"type":"string","format":"uuid","title":"Data Source","description":"The data source this variable discovery is assigned to."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when this variable discovery was created."},"last_modified_at":{"type":"string","format":"date-time","title":"Last Modified At","description":"Timestamp when this variable discovery was last modified, generally the case when its state changes."},"state":{"oneOf":[{"$ref":"#/components/schemas/VariableDiscoveryPendingState"},{"$ref":"#/components/schemas/VariableDiscoveryInProgressState"},{"$ref":"#/components/schemas/VariableDiscoverySucessState"},{"$ref":"#/components/schemas/VariableDiscoveryFailureState"}],"title":"State","description":"The current state of the variable discovery.","discriminator":{"propertyName":"type","mapping":{"FAILURE":"#/components/schemas/VariableDiscoveryFailureState","IN_PROGRESS":"#/components/schemas/VariableDiscoveryInProgressState","PENDING":"#/components/schemas/VariableDiscoveryPendingState","SUCCESS":"#/components/schemas/VariableDiscoverySucessState"}}}},"type":"object","required":["uuid","data_source","created_at","last_modified_at","state"],"title":"VariableDiscoveryResponse"},"VariableDiscoveryPendingState":{"properties":{"type":{"type":"string","const":"PENDING","title":"Type"}},"type":"object","required":["type"],"title":"VariableDiscoveryPendingState"},"VariableDiscoveryInProgressState":{"properties":{"type":{"type":"string","const":"IN_PROGRESS","title":"Type"},"added_variables":{"type":"integer","title":"Added Variables","description":"The number of variables added by this discovery"}},"type":"object","required":["type","added_variables"],"title":"VariableDiscoveryInProgressState"},"VariableDiscoverySucessState":{"properties":{"type":{"type":"string","const":"SUCCESS","title":"Type"},"added_variables":{"type":"integer","title":"Added Variables","description":"The number of variables added by this discovery"}},"type":"object","required":["type","added_variables"],"title":"VariableDiscoverySucessState"},"VariableDiscoveryFailureState":{"properties":{"type":{"type":"string","const":"FAILURE","title":"Type"},"reason":{"oneOf":[{"$ref":"#/components/schemas/HostLookupError"},{"$ref":"#/components/schemas/NoRouteToHost"},{"$ref":"#/components/schemas/HostDown"},{"$ref":"#/components/schemas/NetworkUnreachable"},{"$ref":"#/components/schemas/ConnectionRefused"},{"$ref":"#/components/schemas/ConnectionReset"},{"$ref":"#/components/schemas/ConnectionClosed"},{"$ref":"#/components/schemas/Timeout"},{"$ref":"#/components/schemas/EnlyzeGatewayError"},{"$ref":"#/components/schemas/OpcUaErrorResponse"},{"$ref":"#/components/schemas/OpcUaNoMatchingEndpointPolicy"},{"$ref":"#/components/schemas/S7PlusError"},{"$ref":"#/components/schemas/UnknownVariableDiscoveryFailureReason"}],"title":"Reason","description":"The reason why the variable discovery failed.","discriminator":{"propertyName":"type","mapping":{"CONNECTION_CLOSED":"#/components/schemas/ConnectionClosed","CONNECTION_REFUSED":"#/components/schemas/ConnectionRefused","CONNECTION_RESET":"#/components/schemas/ConnectionReset","ENLYZE_GATEWAY_ERROR":"#/components/schemas/EnlyzeGatewayError","HOST_DOWN":"#/components/schemas/HostDown","LOOKUP_ERROR":"#/components/schemas/HostLookupError","NETWORK_UNREACHABLE":"#/components/schemas/NetworkUnreachable","NO_ROUTE_TO_HOST":"#/components/schemas/NoRouteToHost","OPC_UA_ERROR_RESPONSE":"#/components/schemas/OpcUaErrorResponse","OPC_UA_NO_MATCHING_ENDPOINT_POLICY":"#/components/schemas/OpcUaNoMatchingEndpointPolicy","S7PLUS_ERROR":"#/components/schemas/S7PlusError","TIMEOUT":"#/components/schemas/Timeout","UNKNOWN":"#/components/schemas/UnknownVariableDiscoveryFailureReason"}}}},"type":"object","required":["type","reason"],"title":"VariableDiscoveryFailureState"},"HostLookupError":{"properties":{"type":{"type":"string","const":"LOOKUP_ERROR","title":"Type"}},"type":"object","required":["type"],"title":"HostLookupError"},"NoRouteToHost":{"properties":{"type":{"type":"string","const":"NO_ROUTE_TO_HOST","title":"Type"}},"type":"object","required":["type"],"title":"NoRouteToHost"},"HostDown":{"properties":{"type":{"type":"string","const":"HOST_DOWN","title":"Type"}},"type":"object","required":["type"],"title":"HostDown"},"NetworkUnreachable":{"properties":{"type":{"type":"string","const":"NETWORK_UNREACHABLE","title":"Type"}},"type":"object","required":["type"],"title":"NetworkUnreachable"},"ConnectionRefused":{"properties":{"type":{"type":"string","const":"CONNECTION_REFUSED","title":"Type"}},"type":"object","required":["type"],"title":"ConnectionRefused"},"ConnectionReset":{"properties":{"type":{"type":"string","const":"CONNECTION_RESET","title":"Type"}},"type":"object","required":["type"],"title":"ConnectionReset"},"ConnectionClosed":{"properties":{"type":{"type":"string","const":"CONNECTION_CLOSED","title":"Type"}},"type":"object","required":["type"],"title":"ConnectionClosed"},"Timeout":{"properties":{"type":{"type":"string","const":"TIMEOUT","title":"Type"}},"type":"object","required":["type"],"title":"Timeout"},"EnlyzeGatewayError":{"properties":{"type":{"type":"string","const":"ENLYZE_GATEWAY_ERROR","title":"Type"}},"type":"object","required":["type"],"title":"EnlyzeGatewayError"},"OpcUaErrorResponse":{"properties":{"type":{"type":"string","const":"OPC_UA_ERROR_RESPONSE","title":"Type"},"code":{"type":"integer","title":"Code","description":"The numerical error code returned by the OPC UA Server."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"A descriptive name corresponding to the error code."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"A descriptive string corresponding to the error code."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"The error reason returned by the server."}},"type":"object","required":["type","code"],"title":"OpcUaErrorResponse"},"OpcUaNoMatchingEndpointPolicy":{"properties":{"type":{"type":"string","const":"OPC_UA_NO_MATCHING_ENDPOINT_POLICY","title":"Type"},"endpoint_url":{"type":"string","title":"Endpoint Url","description":"The endpoint of the OPC UA server"},"endpoint_security_policy_uri":{"type":"string","title":"Endpoint Security Policy Uri","description":"The URI of the requested Endpoint Security Policy"},"message_security_mode":{"type":"string","title":"Message Security Mode","description":"The requested Message Security Mode"},"token_type":{"type":"string","title":"Token Type","description":"The configured Token Type"},"token_security_policy_uri":{"type":"string","title":"Token Security Policy Uri","description":"The requested Token Security Policy"}},"type":"object","required":["type","endpoint_url","endpoint_security_policy_uri","message_security_mode","token_type","token_security_policy_uri"],"title":"OpcUaNoMatchingEndpointPolicy"},"S7PlusError":{"properties":{"type":{"type":"string","const":"S7PLUS_ERROR","title":"Type"},"category":{"$ref":"#/components/schemas/S7PlusErrorCategory","description":"The category of the error. `AUTHENTICATION` can indicate an incorrect password or lack of permissions."}},"type":"object","required":["type","category"],"title":"S7PlusError"},"S7PlusErrorCategory":{"type":"string","enum":["AUTHENTICATION","UNKNOWN"],"title":"S7PlusErrorCategory"},"UnknownVariableDiscoveryFailureReason":{"properties":{"type":{"type":"string","const":"UNKNOWN","title":"Type"}},"type":"object","required":["type"],"title":"UnknownVariableDiscoveryFailureReason"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/variable-discoveries":{"post":{"tags":["Variable Discoveries"],"summary":"Create Variable Discovery","description":"Start a Variable Discovery run on a data source.","operationId":"create_variable_discovery_v2_variable_discoveries_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariableDiscoveryCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariableDiscoveryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```
