{"type":"api","title":"Add ZTP profiles in bulk","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":"SetProfiles","deprecated":true,"requestBody":{"content":{"application/json":{"schema":{"description":"ZTP device profile list.","properties":{"profiles":{"description":"List of ZTP device profiles.","items":{"description":"ZTP Device Profile object.","properties":{"config":{"description":"The unique ID of the configuration file associated with this ZTP profile.","type":"string"},"configName":{"description":"Config name.","type":"string"},"deviceFamily":{"description":"The Device Family of the image and configuration files associated with this ZTP profile.","type":"string"},"image":{"description":"The unique ID of the image file associated with this ZTP profile.","type":"string"},"imageName":{"description":"Image name.","type":"string"},"isConfigInvalid":{"description":"The flag to check if the ZTP profile is in sync with the associated configuration.","format":"boolean","type":"boolean"},"isImageInvalid":{"description":"The flag indicating whether Crosswork must check if the ZTP profile is in sync with the associated image.","format":"boolean","type":"boolean"},"isPostConfigInvalid":{"description":"The flag to check if the ZTP profile is in sync with the associated postConfig file.","format":"boolean","type":"boolean"},"isPreConfigInvalid":{"description":"The flag to check if the ZTP profile is in sync with the associated preConfig file.","format":"boolean","type":"boolean"},"isSecureZtp":{"description":"The flag to identify if profile is secure or classic.","type":"string"},"lastUpdated":{"format":"int64","description":"TimeInMillis when device was last updated/created","type":"string"},"osPlatform":{"description":"The OS platform of the image and configuration files associated with this ZTP profile.","type":"string"},"postConfig":{"description":"The unique ID of post-Config file associated with this ZTP profile.","type":"string"},"postConfigName":{"description":"The name of post-Config file associated with this ZTP profile.","type":"string"},"preConfig":{"description":"The unique ID of pre-Config file associated with this ZTP profile.","type":"string"},"preConfigName":{"description":"The name of pre-Config file associated with this ZTP profile.","type":"string"},"profileCategory":{"description":"Category of profile","type":"string"},"profileDescription":{"description":"Profile description.","type":"string"},"profileId":{"description":"Unique ID of Profile","type":"string"},"profileName":{"description":"Name of the profile","type":"string"},"vendor":{"description":"The vendor of the image and configuration files associated with this ZTP profile.","type":"string"},"version":{"description":"The Version of the image and configuration files associated with this ZTP profile.","type":"string"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpProfile"},"type":"array"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpProfileList"},"examples":{"profileCreateRequestObjectExample":{"value":{"profiles":[{"profileName":"profile-test1","profileDescription":"test profile","profileCategory":"0day","vendor":"Cisco Systems","osPlatform":"IOS XR","deviceFamily":"NCS5500","version":"7.9.2","image":"","isSecureZtp":"false","preConfig":"","postConfig":"","config":"ab6a3763-998f-49b9-81c5-c6182420d6c0"}]},"$$ref":"#/components/examples/ProfileCreateRequestObjectExample"}}}},"description":"The information used to add ZTP profiles.","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"ZTP device profile 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"},"ztpProfiles":{"description":"List of ZTP Device profiles.","items":{"description":"ZTP Device Profile object.","properties":{"config":{"description":"The unique ID of the configuration file associated with this ZTP profile.","type":"string"},"configName":{"description":"Config name.","type":"string"},"deviceFamily":{"description":"The Device Family of the image and configuration files associated with this ZTP profile.","type":"string"},"image":{"description":"The unique ID of the image file associated with this ZTP profile.","type":"string"},"imageName":{"description":"Image name.","type":"string"},"isConfigInvalid":{"description":"The flag to check if the ZTP profile is in sync with the associated configuration.","format":"boolean","type":"boolean"},"isImageInvalid":{"description":"The flag indicating whether Crosswork must check if the ZTP profile is in sync with the associated image.","format":"boolean","type":"boolean"},"isPostConfigInvalid":{"description":"The flag to check if the ZTP profile is in sync with the associated postConfig file.","format":"boolean","type":"boolean"},"isPreConfigInvalid":{"description":"The flag to check if the ZTP profile is in sync with the associated preConfig file.","format":"boolean","type":"boolean"},"isSecureZtp":{"description":"The flag to identify if profile is secure or classic.","type":"string"},"lastUpdated":{"format":"int64","description":"TimeInMillis when device was last updated/created","type":"string"},"osPlatform":{"description":"The OS platform of the image and configuration files associated with this ZTP profile.","type":"string"},"postConfig":{"description":"The unique ID of post-Config file associated with this ZTP profile.","type":"string"},"postConfigName":{"description":"The name of post-Config file associated with this ZTP profile.","type":"string"},"preConfig":{"description":"The unique ID of pre-Config file associated with this ZTP profile.","type":"string"},"preConfigName":{"description":"The name of pre-Config file associated with this ZTP profile.","type":"string"},"profileCategory":{"description":"Category of profile","type":"string"},"profileDescription":{"description":"Profile description.","type":"string"},"profileId":{"description":"Unique ID of Profile","type":"string"},"profileName":{"description":"Name of the profile","type":"string"},"vendor":{"description":"The vendor of the image and configuration files associated with this ZTP profile.","type":"string"},"version":{"description":"The Version of the image and configuration files associated with this ZTP profile.","type":"string"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpProfile"},"type":"array"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpProfileResponse"},"examples":{"Success Response":{"value":{"code":201,"message":"Profile Created Successfully"}},"Invalid Request Body":{"summary":"Invalid Request Body","value":{"code":422,"message":"invalid character '}' looking for beginning of value"},"$$ref":"#/components/examples/Invalid_Request_Body"},"Invalid Input":{"value":{"code":400,"message":"Profile Id field is Mandatory."}},"Data Persistence Failure":{"value":{"code":500,"message":"Failed to save data. DB error."}},"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":"Add ZTP profiles in bulk","description":"This API adds ZTP profiles in bulk. The Request Body contains ZtpProfileList. The Response Body contains ZtpProfileResponse.","tags":["Profile APIs"],"__originalOperationId":"SetProfiles","security":[{"bearerAuth":[]}],"method":"post","path":"/profiles"}}