{"type":"api","title":"Bulk import of ZTP devices","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":"ImportDevices","deprecated":true,"requestBody":{"content":{"application/json":{"schema":{"description":"ZTP device import object.","properties":{"b64Content":{"description":"encoded base64 content","type":"string"},"isDryRun":{"format":"boolean","description":"validate only device fields","type":"boolean"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpImport"},"example":{"b64Content":"eyJ2b3VjaGVrLXlucHV0Ijp7InNlcmlhAC1udW1iZXIiOiIxIiwicGlubmVklWRvbwFpbi1jZXk0IjoiTUlJr1VqQ0NlRHFnQXdJQkFnSVJBLzk2WGt3eHJ2eitGRUh2VU4rZW8wd3dEUVlKS29aSWh2Y05BUUVMQlFBd2FERUxNQWtHQTFVRUJoTUNWVk14Q3pBSkJnTlZCQWdUQWtOQk1SRXdEd1lEVlFRSEV3aFRZVzRnU205elpURWFNQmdHQTFVRUNoTVJRMGxUUTA4Z1UxbFRWRVZOVXlCSlRrTXhIVEFiQmdOVkJBTVRGRnBVVUNCSmJuUmxjbTVoYkNCU2IyOTBJRU5CTUI0WERUSXlNRFV6TVRBM05UTXpPVm9YRFRJM01EVXpNREEzTlRN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XpldVM0K083bHBTdWMweEI1TmN1bXRxMUI1SDhkR1cwVUF5Zzg1WUtsMTFPaVJxb3hwVTRrUzNlRjZGa3ZuR1JhT3hEdXE0SFV4MTJUQVB5dDFLeDI2Y3dUZGhkUUwrbmpwVFBFQ0dVQVNvZTErMm4yUjZFbml2dTAyZ00yYjl0MnVRcS96Q3FxWUI4U3ozSjhjQkNyMm9tWVZsRmc5OU9iWkJpUWR0U0dXdWtBTUVzMUsxMkNoNVFnM3B0RSs1YnlZN1RSdUx4L1E4TzN2U1ZtVWVwN3cvd2JKeHdQOHFoQ3YzOVNEdGx5aHVqVjZ6bjFMY0lpaUV3bDRUOFZvdUxGRFZtUlFZTXE0enBkeWNhOWlmUmdnM1NvMFBTSjVvUlpsYlB0TWNxeGhXNWdreDl2Sk9za0p5b2JwWnFFY2U3czBvVW92YWVPaHVqbTM2dDVtYmNJUmFvWUZ3PSJ9fQ==","isDryRun":false}}},"description":"The information used to add ZTP devices in bulk by importing a CSV file.","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":""}},"Invalid Input":{"value":{"code":400,"message":"Unable to parse the json payload."}},"Invalid Request Body":{"summary":"Invalid Request Body","value":{"code":422,"message":"invalid character '}' looking for beginning of value"},"$$ref":"#/components/examples/Invalid_Request_Body"},"Service Unavailable":{"value":{"code":503,"message":"Sorry, ztp service is in maintenance mode. Only read operations are supported."}}}}},"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":"Bulk import of ZTP devices","description":"This API adds ZTP devices in bulk by importing a CSV file. Request Body: ZtpImport (the body must contain the base64-encoded content of the CSV file). Response Body: ZtpDeviceResponse. DEPRECATED Attribute: providerDeviceKey.","tags":["Device APIs"],"__originalOperationId":"ImportDevices","security":[{"bearerAuth":[]}],"method":"post","path":"/devices/import"}}