{"type":"api","title":"Get a list of policies","meta":{"id":"/apps/pubhub/media/crosswork-network-controller-7-1/f445c17e25a1120e8fbde4bd413083d0fd88b2b3/d1c072e8-3151-3b90-a574-d773df736b16","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-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":"GetDevicesPolicies","requestBody":{"content":{"application/json":{"schema":{"description":"ZTP device policy request object.","properties":{"criteria":{"description":"Filter criteria. Not used.","type":"string"},"filter":{"description":"ZTP device policy object. Filter criteria. Not used.","properties":{"existingAttributes":{"additionalProperties":{"type":"string"},"description":"policy attributes that are exits in ZTP","type":"object"},"id":{"format":"int32","description":"unique identifier","type":"integer"},"newAttributes":{"additionalProperties":{"type":"string"},"description":"policy attributes that are added to ZTP","type":"object"},"policyFields":{"items":{"type":"string"},"description":"all the policy fields","type":"array"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpDevicePolicy"},"filterData":{"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"},"limit":{"description":"Limit response records. Not used.","format":"int32","type":"integer"},"page":{"description":"Paginate response records. Not used.","format":"int32","type":"integer"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpDevicePolicyRequest"},"example":{}}},"description":"The information used to retrieve list of policies that apply on ZTP devices. Currently ignored.","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"ZTP device policy response object","properties":{"code":{"description":"Response code. Indicates success/failure.","format":"int32","type":"integer"},"message":{"description":"Response message. Indicates success/failure reason.","type":"string"},"policydata":{"description":"ZTP device policy object. Filter criteria. Not used.","properties":{"existingAttributes":{"additionalProperties":{"type":"string"},"description":"policy attributes that are exits in ZTP","type":"object"},"id":{"format":"int32","description":"unique identifier","type":"integer"},"newAttributes":{"additionalProperties":{"type":"string"},"description":"policy attributes that are added to ZTP","type":"object"},"policyFields":{"items":{"type":"string"},"description":"all the policy fields","type":"array"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpDevicePolicy"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpDevicePolicyResponse"},"examples":{"Success Response":{"value":{"policydata":{"existingAttributes":{"inventoryid":"InventoryId"},"id":1,"newAttributes":{"routingInfo.globalisissystemid":"string","routingInfo.globalospfrouterid":"string","routingInfo.ipv6routerid":"string","routingInfo.teRouterid":"string"},"policyFields":["inventoryid","routingInfo.globalospfrouterid","routingInfo.globalisissystemid","routingInfo.teRouterid","routingInfo.ipv6routerid"]},"code":200}},"Polciy Not Found":{"value":{"code":404,"message":"No polices exits in ztp"}},"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 a list of policies","description":"This API retrieves a list of policies that apply on ZTP devices. Pass an empty device like this: \"{}\". Request Body: ZtpDevicePolicyRequest. Response Body: ZtpDevicePolicyResponse.","tags":["Device APIs"],"__originalOperationId":"GetDevicesPolicies","security":[{"bearerAuth":[]}],"method":"post","path":"/device/policy/query"}}