{"type":"api","title":"Get-the-ZTP-device-headers-with-sample-data in CSV format","meta":{"id":"/apps/pubhub/media/crosswork-network-controller-7-1/f445c17e25a1120e8fbde4bd413083d0fd88b2b3/6c38d1fe-54c3-3c7d-9226-ba8b795939ba","info":{"title":"Crosswork ZTP Service API","description":"Crosswork ZTP Service API for devices, profiles, serial numbers, and static routes. These APIs permit users to add, update, delete, query, and perform bulk CSV import/export of devices and device onboarding operations using ZTP services.","version":"7.1.0","contact":{"name":"Crosswork Team, Cisco","email":"support@cisco.com"},"license":{"name":"Cisco Software License Agreement","url":"http://www.cisco.com/public/sw-license-agreement.html"}},"security":[{"bearerAuth":[]}],"x-parser-conf":{"overview":{"markdownPath":"reference/EMF/ztp-service-deprecated-api-overview.md"}},"openapi":"3.0.1","servers":[{"url":"/crosswork/ztp/v1"}],"securitySchemes":{"bearerAuth":{"description":"Security definitions details.","in":"header","name":"Authorization","type":"apiKey"}}},"spec":{"operationId":"ZtpsampleService","deprecated":true,"requestBody":{"content":{"application/json":{"schema":{"properties":{"additionalAttributes":{"additionalProperties":{"type":"string"},"description":"A map of device attributes that are added as part of policy data.","type":"object"},"circuitId":{"type":"string","description":"Circuit Id. Location identifier params"},"config":{"description":"The unique ID of the associated day0-configuration file.","type":"string"},"configAttributes":{"additionalProperties":{"type":"string"},"description":"Extra config attributes from config script","type":"object"},"configName":{"type":"string","description":"Config name."},"connectivityDetails":{"description":"List of device connectivity types.","items":{"description":"Device connectivity types.","properties":{"inetAddr":{"description":"The IPv4/IPv6 address for this connectivity type.","items":{"properties":{"inetAddressFamily":{"description":"IP address family. Either \"IPv6\" or \"IPv4\"","type":"string"},"ipaddrs":{"description":"IP Address","type":"string"},"mask":{"description":"Network Mask","format":"int32","type":"integer"},"type":{"description":"Usage indicator. Example: \"DEVICEINFO\", \"CONNECTIVITYINFO\"","type":"string"}},"description":"Device IP address.","type":"object","$$ref":"#/components/schemas/cwztpsvcZtpInetAddr"},"type":"array"},"port":{"description":"The port for this connectivity type.","format":"int64","type":"integer"},"protocol":{"description":"The protocol for this connectivity type.","type":"string"},"timeout":{"description":"The timeout for this connectivity type.","format":"int64","type":"integer"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcConnectivityDetail"},"type":"array"},"credentialProfile":{"description":"REQUIRED: The name of the Credential Profile applicable to this device","type":"string"},"deviceFamily":{"description":"The Device Family of the associated image and configuration file.","type":"string"},"enableOption82":{"description":"Flag to identify if device is identified by location params or serial","type":"string"},"hostName":{"description":"The device Unique Host name.","type":"string"},"image":{"description":"The unique ID of the associated image file.","type":"string"},"imageName":{"description":"Image name.","type":"string"},"inventoryId":{"description":"Device Inventory ID. Supported starting with the Crosswork 3.2.2 release.","type":"string"},"ipAddress":{"properties":{"inetAddressFamily":{"description":"IP address family. Either \"IPv6\" or \"IPv4\"","type":"string"},"ipaddrs":{"description":"IP Address","type":"string"},"mask":{"description":"Network Mask","format":"int32","type":"integer"},"type":{"description":"Usage indicator. Example: \"DEVICEINFO\", \"CONNECTIVITYINFO\"","type":"string"}},"description":"Device IP address.","type":"object","$$ref":"#/components/schemas/cwztpsvcZtpInetAddr"},"isConfigInvalid":{"description":"Flag to check if the ZTP device is in sync with the associated configuration file.","format":"boolean","type":"boolean"},"isImageInvalid":{"description":"Flag to check if the ZTP device is in sync with the associated image file.","format":"boolean","type":"boolean"},"isOtherPlatform":{"format":"boolean","type":"boolean","description":"Indicates whether the devive is a non-Cisco device."},"isSecureZtp":{"description":"Flag to identify if the device was onboarded using secure or classic ZTP.","type":"string"},"lastUpdated":{"format":"int64","description":"The time in milliseconds since the device was last updated or created.","type":"string"},"macAddress":{"description":"The chassis backplane MAC address.","type":"string"},"message":{"description":"Device onboarding status messages.","type":"string"},"osPlatform":{"description":"The OS Platform of the associated image and configuration file.","type":"string"},"productId":{"description":"PnP additional identifiers","type":"string"},"profileName":{"description":"The name of the ZTP profile associated with the device.","type":"string"},"providerInfo":{"properties":{"providerDeviceKey":{"description":"Deprecated attribute from Crosswork 3.2.2 release","type":"string"},"providerName":{"description":"The name of the Crosswork Provider. Should be unique.","type":"string"}},"type":"object","description":"Data for the Crosswork Provider.","$$ref":"#/components/schemas/cwztpsvcProviderInfo"},"remoteId":{"description":"Remote Id. Location identifier params","type":"string"},"secureZtpInfo":{"properties":{"configMode":{"description":"Supported only for SZTP-enabled devices. Supported values are replace or merge. The default value is replace.","type":"string"},"isEncrypted":{"description":"Flag to check if ZTP device is data should be encrypted.","type":"string"},"isPostConfigInvalid":{"description":"Flag to check if ZTP device is in sync with postConfigName.","format":"boolean","type":"boolean"},"isPreConfigInvalid":{"description":"Flag to check if ZTP device is in sync with preConfigName.","format":"boolean","type":"boolean"},"postConfig":{"description":"The unique ID of the associated post-configuration file.","type":"string"},"postConfigName":{"description":"The name of the associated post-configuration file.","type":"string"},"preConfig":{"description":"The unique ID of the associated pre-configuration file.","type":"string"},"preConfigName":{"description":"The name of the associated pre-configuration file.","type":"string"}},"type":"object","description":"Secure ZTP details.","$$ref":"#/components/schemas/cwztpsvcSecureZtpInfo"},"serialNumber":{"description":"The device Serial Number(s).","items":{"type":"string"},"type":"array"},"status":{"description":"The ZTP device status. Supported status values are \\\"Unprovisioned\\\", \\\"InProgress\\\", \\\"Provisioned\\\", \\\"ProvisioningError\\\", \\\"ZtpError\\\", \\\"Onboarded\\\", and \\\"OnboardingError\\\"","type":"string"},"uuid":{"description":"The unique device identifier. If a UUID is not passed, it is randomly generated by Crosswork.","type":"string"},"vendor":{"description":"The Vendor of the associated image and configuration file.","type":"string"},"version":{"description":"The Version of the associated image and configuration file.","type":"string"},"versionId":{"description":"The Version id of the associated image file.","type":"string"}},"type":"object","description":"ZTP Device object.","$$ref":"#/components/schemas/cwztpsvcZtpDevice"},"examples":{"deviceObjectExample":{"value":{"uuid":"e1d32c83-9141-4eb5-8105-8afb47c25533","hostName":"test1","serialNumber":["1"],"credentialProfile":"cred1","ipAddress":{},"osPlatform":"IOS XR","version":"7.0.2","deviceFamily":"CISCO NCS540","config":"b4d4504c-2a0f-4b68-84a3-a0273eabcf03","profileName":"test-1","status":"Unprovisioned","providerInfo":{},"lastUpdated":"1685793663523","configName":"cfg2","additionalAttributes":{"routingInfo.globalisissystemid":"","routingInfo.globalospfrouterid":"","routingInfo.ipv6routerid":"","routingInfo.teRouterid":""},"isSecureZtp":"false","secureZtpInfo":{"isEncrypted":"false"},"configAttributes":{"hname":"ss"},"enableOption82":"false"},"summary":"Sample Device object","$$ref":"#/components/examples/DeviceObjectExample"}}}},"description":"The information used to get the ZTP device headers with sample data in CSV format.","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"ZTP Device response object.","properties":{"code":{"description":"Response code. Indicates success/failure.","format":"int32","type":"integer"},"message":{"description":"Response message. Indicates success/failure reason.","type":"string"},"paginationDetails":{"description":"Used to filter results, paginationin device and other APIs.","properties":{"Criteria":{"description":"Response filter criteria. Not used.","type":"string"},"Descending":{"description":"Order response in ascending/descending order. Default value: \"false\"","format":"boolean","type":"boolean"},"MatchCase":{"description":"Do case matching. Not used.","format":"boolean","type":"boolean"},"PageNum":{"description":"Page number in the list of generated records, paginated by \"PageSize\". Starts with 0.","format":"int64","type":"integer"},"PageSize":{"description":"Number of records to be returned in a response.","format":"int64","type":"integer"},"SortBy":{"description":"Field to be used for sorting responses.","type":"string"},"TotalCount":{"description":"Total number of records matching the query criteria.","format":"int64","type":"integer"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpFilterData"},"ztpnodes":{"description":"Device data. One Device object entry per device","items":{"properties":{"additionalAttributes":{"additionalProperties":{"type":"string"},"description":"A map of device attributes that are added as part of policy data.","type":"object"},"circuitId":{"type":"string","description":"Circuit Id. Location identifier params"},"config":{"description":"The unique ID of the associated day0-configuration file.","type":"string"},"configAttributes":{"additionalProperties":{"type":"string"},"description":"Extra config attributes from config script","type":"object"},"configName":{"type":"string","description":"Config name."},"connectivityDetails":{"description":"List of device connectivity types.","items":{"description":"Device connectivity types.","properties":{"inetAddr":{"description":"The IPv4/IPv6 address for this connectivity type.","items":{"properties":{"inetAddressFamily":{"description":"IP address family. Either \"IPv6\" or \"IPv4\"","type":"string"},"ipaddrs":{"description":"IP Address","type":"string"},"mask":{"description":"Network Mask","format":"int32","type":"integer"},"type":{"description":"Usage indicator. Example: \"DEVICEINFO\", \"CONNECTIVITYINFO\"","type":"string"}},"description":"Device IP address.","type":"object","$$ref":"#/components/schemas/cwztpsvcZtpInetAddr"},"type":"array"},"port":{"description":"The port for this connectivity type.","format":"int64","type":"integer"},"protocol":{"description":"The protocol for this connectivity type.","type":"string"},"timeout":{"description":"The timeout for this connectivity type.","format":"int64","type":"integer"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcConnectivityDetail"},"type":"array"},"credentialProfile":{"description":"REQUIRED: The name of the Credential Profile applicable to this device","type":"string"},"deviceFamily":{"description":"The Device Family of the associated image and configuration file.","type":"string"},"enableOption82":{"description":"Flag to identify if device is identified by location params or serial","type":"string"},"hostName":{"description":"The device Unique Host name.","type":"string"},"image":{"description":"The unique ID of the associated image file.","type":"string"},"imageName":{"description":"Image name.","type":"string"},"inventoryId":{"description":"Device Inventory ID. Supported starting with the Crosswork 3.2.2 release.","type":"string"},"ipAddress":{"properties":{"inetAddressFamily":{"description":"IP address family. Either \"IPv6\" or \"IPv4\"","type":"string"},"ipaddrs":{"description":"IP Address","type":"string"},"mask":{"description":"Network Mask","format":"int32","type":"integer"},"type":{"description":"Usage indicator. Example: \"DEVICEINFO\", \"CONNECTIVITYINFO\"","type":"string"}},"description":"Device IP address.","type":"object","$$ref":"#/components/schemas/cwztpsvcZtpInetAddr"},"isConfigInvalid":{"description":"Flag to check if the ZTP device is in sync with the associated configuration file.","format":"boolean","type":"boolean"},"isImageInvalid":{"description":"Flag to check if the ZTP device is in sync with the associated image file.","format":"boolean","type":"boolean"},"isOtherPlatform":{"format":"boolean","type":"boolean","description":"Indicates whether the devive is a non-Cisco device."},"isSecureZtp":{"description":"Flag to identify if the device was onboarded using secure or classic ZTP.","type":"string"},"lastUpdated":{"format":"int64","description":"The time in milliseconds since the device was last updated or created.","type":"string"},"macAddress":{"description":"The chassis backplane MAC address.","type":"string"},"message":{"description":"Device onboarding status messages.","type":"string"},"osPlatform":{"description":"The OS Platform of the associated image and configuration file.","type":"string"},"productId":{"description":"PnP additional identifiers","type":"string"},"profileName":{"description":"The name of the ZTP profile associated with the device.","type":"string"},"providerInfo":{"properties":{"providerDeviceKey":{"description":"Deprecated attribute from Crosswork 3.2.2 release","type":"string"},"providerName":{"description":"The name of the Crosswork Provider. Should be unique.","type":"string"}},"type":"object","description":"Data for the Crosswork Provider.","$$ref":"#/components/schemas/cwztpsvcProviderInfo"},"remoteId":{"description":"Remote Id. Location identifier params","type":"string"},"secureZtpInfo":{"properties":{"configMode":{"description":"Supported only for SZTP-enabled devices. Supported values are replace or merge. The default value is replace.","type":"string"},"isEncrypted":{"description":"Flag to check if ZTP device is data should be encrypted.","type":"string"},"isPostConfigInvalid":{"description":"Flag to check if ZTP device is in sync with postConfigName.","format":"boolean","type":"boolean"},"isPreConfigInvalid":{"description":"Flag to check if ZTP device is in sync with preConfigName.","format":"boolean","type":"boolean"},"postConfig":{"description":"The unique ID of the associated post-configuration file.","type":"string"},"postConfigName":{"description":"The name of the associated post-configuration file.","type":"string"},"preConfig":{"description":"The unique ID of the associated pre-configuration file.","type":"string"},"preConfigName":{"description":"The name of the associated pre-configuration file.","type":"string"}},"type":"object","description":"Secure ZTP details.","$$ref":"#/components/schemas/cwztpsvcSecureZtpInfo"},"serialNumber":{"description":"The device Serial Number(s).","items":{"type":"string"},"type":"array"},"status":{"description":"The ZTP device status. Supported status values are \\\"Unprovisioned\\\", \\\"InProgress\\\", \\\"Provisioned\\\", \\\"ProvisioningError\\\", \\\"ZtpError\\\", \\\"Onboarded\\\", and \\\"OnboardingError\\\"","type":"string"},"uuid":{"description":"The unique device identifier. If a UUID is not passed, it is randomly generated by Crosswork.","type":"string"},"vendor":{"description":"The Vendor of the associated image and configuration file.","type":"string"},"version":{"description":"The Version of the associated image and configuration file.","type":"string"},"versionId":{"description":"The Version id of the associated image file.","type":"string"}},"type":"object","description":"ZTP Device object.","$$ref":"#/components/schemas/cwztpsvcZtpDevice"},"type":"array"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpDeviceResponse"},"examples":{"Success Response":{"value":{"code":200,"message":"Sample CSV file data with headers, dummy records and user instructions."}},"Invalid Request Body":{"summary":"Invalid Request Body","value":{"code":422,"message":"invalid character '}' looking for beginning of value"},"$$ref":"#/components/examples/Invalid_Request_Body"}}}},"description":"OK. The request was successful. The result is contained in the response body."},"401":{"description":"Unauthorized. The request has not been applied because it lacks valid authentication credentials for the target resource."},"403":{"description":"Forbidden. The server recognizes the authentication credentials, but the client is not authorized to perform this request."},"404":{"description":"Not Found. The client made a request for a resource that does not exist."}},"summary":"Get-the-ZTP-device-headers-with-sample-data in CSV format","description":"This API gets the ZTP device headers with sample data in CSV format. Pass an empty device like \"{}\". Request Body: ZtpDevice. Response Body: ZtpDeviceResponse.","tags":["Device APIs"],"__originalOperationId":"ZtpsampleService","security":[{"bearerAuth":[]}],"method":"post","path":"/devices/csvtemplate"}}