validate#

dpsctl topology validate Usage Guide#

Validate a topology JSON file without importing it.

Validation is two-layered. The CLI first validates the file against the embedded JSON schema. It then streams the model to TopologyManagementService.ValidateTopology for semantic checks. Closing the stream starts server validation. The call does not modify the database.

Usage#

dpsctl topology validate <filename>

Flags#

Includes global dpsctl options.

   --help, -h          show help

Examples#

Basic Validation#

$ dpsctl topology validate topology.json
{
  "status": {
    "ok": true,
    "diag_msg": "Topology validation passed"
  }
}

JSON output omits validation_errors when the list is empty.

Validation with Errors#

$ dpsctl topology validate invalid-topology.json
{
  "status": {
    "ok": false,
    "diag_msg": "Topology validation failed with 3 validation error(s)"
  },
  "validation_errors": [
    {
      "object_name": "node001",
      "object_type": "entity",
      "error": "device_not_found",
      "message": "Entity 'node001' references undefined device model 'UnknownModel'"
    },
    {
      "object_name": "node001",
      "object_type": "topology_entity",
      "error": "referenced_entity_not_found",
      "message": "Referenced entity not found"
    },
    {
      "object_name": "pdn",
      "object_type": "topology",
      "error": "circular_dependency",
      "message": "Circular dependency detected in topology relations"
    }
  ]
}

The message strings in the failure example are illustrative. Match failures by the error code.

Notes#

  • A topology JSON filename is required.

  • Local schema failures report instance location. JSON syntax errors report line, column, and offset. Those failures do not produce validation_errors.

  • A non-empty top-level Policies array is rejected before the server call.

  • Server validation checks entity references, device models, and logical consistency, including cycles and disconnected entities.

  • Files are validated against the same schema used during import.

  • Validation does not modify any existing topology data.

  • The status.ok field indicates overall semantic validation success or failure.

  • The validation_errors array contains object name, type, error code, and message for each server-side failure.

  • Server error codes include device_not_found, invalid_model, circular_dependency, disconnected_graph, referenced_entity_not_found, duplicate_entity, self_reference, and invalid_secret_name.