{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cisco-crosswork/json-schema/cisco-crosswork-cwztpsvc-ztp-device-schema.json",
  "title": "cwztpsvcZtpDevice",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cisco-crosswork-cwztpdevice-api-openapi.yml#/components/schemas/cwztpsvcZtpDevice",
  "type": "object",
  "properties": {
    "uuid": {
      "type": "string",
      "description": "Unique device identifier. If a UUID is not passed, it is randomly generated by Crosswork."
    },
    "hostName": {
      "type": "string",
      "description": "The device Host name."
    },
    "serialNumber": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The device Serial Number(s)."
    },
    "credentialProfile": {
      "type": "string",
      "title": "REQUIRED: The name of the Credential Profile applicable to this device"
    },
    "ipAddress": {
      "$ref": "#/$defs/cwztpsvcZtpInetAddr",
      "title": "IP address od device"
    },
    "macAddress": {
      "type": "string",
      "description": "The chassis backplane MAC address."
    },
    "osPlatform": {
      "type": "string",
      "description": "The OS Platform of the associated image and configuration file."
    },
    "version": {
      "type": "string",
      "description": "The Version of the associated image and configuration file."
    },
    "deviceFamily": {
      "type": "string",
      "description": "The Device Family of the associated image and configuration file."
    },
    "image": {
      "type": "string",
      "description": "The unique ID of the associated image file."
    },
    "config": {
      "type": "string",
      "description": "The unique ID of the associated day0-configuration file."
    },
    "profileName": {
      "type": "string",
      "description": "The name of the ZTP profile associated with the device."
    },
    "status": {
      "type": "string",
      "title": "The ZTP device status. Supported status values are \\\"Unprovisioned\\\", \\\"InProgress\\\", \\\"Provisioned\\\", \\\"ProvisioningError\\\", \\\"ZtpError\\\", \\\"Onboarded\\\", and \\\"OnboardingError\\\""
    },
    "providerInfo": {
      "$ref": "#/$defs/cwztpsvcProviderInfo",
      "description": "Data for the Crosswork Provider."
    },
    "connectivityDetails": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/cwztpsvcConnectivityDetail"
      },
      "description": "List of device connectivity types."
    },
    "message": {
      "type": "string",
      "description": "Device onboarding status messages."
    },
    "lastUpdated": {
      "type": "string",
      "format": "int64",
      "title": "TimeInMillis when device was last updated/created"
    },
    "imageName": {
      "type": "string"
    },
    "configName": {
      "type": "string"
    },
    "isImageInvalid": {
      "type": "boolean",
      "format": "boolean",
      "description": "Flag to check if the ZTP device is in sync with the associated image file."
    },
    "isConfigInvalid": {
      "type": "boolean",
      "format": "boolean",
      "description": "Flag to check if the ZTP device is in sync with the associated configuration file."
    },
    "additionalAttributes": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "A map of device attributes that are added as part of policy data."
    },
    "inventoryId": {
      "type": "string",
      "description": "Device Inventory ID. Supported starting with the Crosswork 3.2.2 release."
    },
    "isSecureZtp": {
      "type": "string",
      "title": "flag to identify if device is secure or classic"
    },
    "secureZtpInfo": {
      "$ref": "#/$defs/cwztpsvcSecureZtpInfo",
      "title": "Secure ztp details"
    },
    "configAttributes": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "title": "Extra config attributes from config script"
    },
    "enableOption82": {
      "type": "string",
      "title": "Flag to identify if device is identified by location params or serial"
    },
    "remoteId": {
      "type": "string",
      "title": "Location identifier params"
    },
    "circuitId": {
      "type": "string"
    }
  },
  "$defs": {
    "cwztpsvcConnectivityDetail": {
      "type": "object",
      "properties": {
        "protocol": {
          "type": "string",
          "description": "The protocol for this connectivity type."
        },
        "inetAddr": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/cwztpsvcZtpInetAddr"
          },
          "description": "The IPv4/IPv6 address for this connectivity type."
        },
        "port": {
          "type": "integer",
          "format": "int64",
          "description": "The port for this connectivity type."
        },
        "timeout": {
          "type": "integer",
          "format": "int64",
          "description": "The timeout for this connectivity type."
        }
      }
    },
    "cwztpsvcProviderInfo": {
      "type": "object",
      "properties": {
        "providerName": {
          "type": "string",
          "title": "The name of the Crosswork Provider. Should be unique"
        },
        "providerDeviceKey": {
          "type": "string",
          "title": "Deprecated attribute from Crosswork 3.2.2 release"
        }
      }
    },
    "cwztpsvcSecureZtpInfo": {
      "type": "object",
      "properties": {
        "preConfig": {
          "type": "string",
          "description": "The unique ID of the associated pre-configuration file."
        },
        "postConfig": {
          "type": "string",
          "description": "The unique ID of the associated post-configuration file."
        },
        "preConfigName": {
          "type": "string"
        },
        "postConfigName": {
          "type": "string"
        },
        "isPreConfigInvalid": {
          "type": "boolean",
          "format": "boolean",
          "description": "Flag to check if ZTP device is in sync with preConfigName."
        },
        "isPostConfigInvalid": {
          "type": "boolean",
          "format": "boolean",
          "description": "Flag to check if ZTP device is in sync with postConfigName."
        },
        "isEncrypted": {
          "type": "string",
          "description": "Flag to check if ZTP device is data should be encrypted."
        }
      },
      "title": "Secure ZTP info"
    },
    "cwztpsvcZtpInetAddr": {
      "type": "object",
      "properties": {
        "inetAddressFamily": {
          "type": "string"
        },
        "ipaddrs": {
          "type": "string"
        },
        "mask": {
          "type": "integer",
          "format": "int32"
        },
        "type": {
          "type": "string"
        }
      },
      "title": "device ip address"
    }
  }
}