{"type":"api","title":"Retrieve policies","meta":{"id":"/apps/pubhub/media/crosswork-network-controller-7-1/f445c17e25a1120e8fbde4bd413083d0fd88b2b3/4ecd3a14-d0be-3ef0-ba5d-c3cd958217a7","info":{"title":"Crosswork Device Lifecycle Management (DLM) Inventory API","description":"Crosswork DLM Inventory APIs allow the user to perform CRUD operations on Crosswork Tags, Credentials, Providers and Nodes.","version":"1.0.0","contact":{"name":"Crosswork Team, Cisco","email":"support@cisco.com"},"license":{"name":"Cisco Software License Agreement","url":"https://www.cisco.com/public/sw-license-agreement.html"}},"security":[{"bearerAuth":[]}],"x-parser-conf":{"overview":{"markdownPath":"reference/INFRA/DLM/nodedbapi-overview.md"}},"swagger":"2.0","basePath":"/crosswork/inventory/v1","schemes":["http","https"],"securityDefinitions":{"bearerAuth":{"type":"apiKey","description":"bearer auth","name":"Authorization","in":"header"}}},"spec":{"summary":"Retrieve policies","description":"This api returns RobotUniquePolicy, filters can be applied to retrieve specific sets of policies by specifying one or more fields to match. User can filter on combinations of supported fields. The exceptions and details of the filter structure are listed below. This api takes RobotUniquePolicyGetReq as input, in which the user can specify the limit(page size), next_from, filters (RobotUniquePolicy) and sort_by (Not supported in this version, default sorting is done using uuid in ascending order).\nURL : post: /crosswork/inventory/v1/policies/query","operationId":"NodeDb_GetPolicies","responses":{"200":{"description":"A successful response.","schema":{"type":"object","properties":{"return":{"type":"object","properties":{"code":{"type":"string","format":"int64","description":"Typically from an enum defined by the component."},"desc":{"type":"string","description":"Description of error. May not be filled for success error codes."}},"title":"Generic template for responses","$$ref":"#/definitions/robotapiRobotResponseInfo"},"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","title":"Unique name"},"invType":{"type":"string","enum":["INV_TYPE_UNKNOWN","INV_TYPE_NODE","INV_TYPE_PROVIDER","INV_TYPE_CREDENTIAL","INV_TYPE_TAG"],"default":"INV_TYPE_UNKNOWN","$$ref":"#/definitions/robotapiRobotInventoryType","title":"Inventory Type, In 3.1 version, policies are supported only for Nodes"},"fields":{"type":"array","items":{"type":"string"},"title":"Array of field names on which the uniqueness will be maintained"},"Type":{"title":"Combination of all the filed supplied or independent","type":"string","enum":["UNKNOWN_TYPE","INDEPENDENT","COMBINED"],"default":"UNKNOWN_TYPE","$$ref":"#/definitions/robotapiUniquePolicyType"}},"$$ref":"#/definitions/robotapiRobotUniquePolicy"}},"total_count":{"type":"integer","format":"int32","title":"Number of total policies available at present"}},"example":{"data":[{"name":"Default Policy","invType":"INV_TYPE_NODE","fields":["inventoryid","routingInfo.globalospfrouterid","routingInfo.globalisissystemid","routingInfo.teRouterid","routingInfo.ipv6routerid"],"Type":"INDEPENDENT"}],"total_count":1},"$$ref":"#/definitions/robotapiRobotUniquePolicyGetResp"}},"default":{"description":"An unexpected error response.","schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"type_url":{"type":"string"},"value":{"type":"string","format":"byte"}},"$$ref":"#/definitions/protobufAny"}}},"example":{"error":"string","code":0,"message":"string","details":[{"type_url":"string","value":"string"}]},"$$ref":"#/definitions/runtimeError"}}},"parameters":[{"name":"body","in":"body","description":"Retrieves a list of policies request","required":true,"schema":{"type":"object","properties":{"limit":{"type":"integer","format":"int64","description":"Number of policies requested in the response."},"sort_by_field":{"type":"string","description":"The field name in RobotUniquePolicy to use for sorting. If this field\nis omitted, data is sorted by default on name."},"last_key":{"type":"string","description":"Ask for data beyond last_key per the sorted order."},"filter":{"type":"object","properties":{"name":{"type":"string","title":"Unique name"},"invType":{"type":"string","enum":["INV_TYPE_UNKNOWN","INV_TYPE_NODE","INV_TYPE_PROVIDER","INV_TYPE_CREDENTIAL","INV_TYPE_TAG"],"default":"INV_TYPE_UNKNOWN","$$ref":"#/definitions/robotapiRobotInventoryType","title":"Inventory Type, In 3.1 version, policies are supported only for Nodes"},"fields":{"type":"array","items":{"type":"string"},"title":"Array of field names on which the uniqueness will be maintained"},"Type":{"title":"Combination of all the filed supplied or independent","type":"string","enum":["UNKNOWN_TYPE","INDEPENDENT","COMBINED"],"default":"UNKNOWN_TYPE","$$ref":"#/definitions/robotapiUniquePolicyType"}},"$$ref":"#/definitions/robotapiRobotUniquePolicy"},"filterData":{"type":"object","properties":{"SortBy":{"type":"string"},"PageSize":{"type":"integer","format":"int64"},"PageNum":{"type":"integer","format":"int64"},"Descending":{"type":"boolean"},"MatchCase":{"type":"boolean"},"Criteria":{"type":"string"}},"$$ref":"#/definitions/robotapiRobotFilterData"}},"$$ref":"#/definitions/robotapiRobotUniquePolicyGetReq"}}],"tags":["NodeDb"],"__originalOperationId":"NodeDb_GetPolicies","consumes":["application/json"],"produces":["application/json"],"security":[{"bearerAuth":[]}],"method":"post","path":"/policies/query"}}