Description: Get conditions, with pagination and filtering
Since: 3.116.x
Security: Requires a valid user with the "VIEW_POLICIES" permission.
Usage: GET /xray/api/v1/curation/conditions
Consumes: None
Produces: application/json
Path Parameters: None
Query Parameters:
Parameters:
Parameter | Type | Mandatory/Optional | Default Value | Description |
---|---|---|---|---|
| string | optional |
| Field used for sorting. One of: “ |
| string | optional |
| Sorting direction. One of “ |
| number | optional |
| Number of rows in the response. |
| number | optional |
| The number of the page in pagination. |
| number | optional |
| Alternative to page number, pagination offset. |
| string | optional | n/a | Filter by name of condition |
| boolean | optional | n/a | Filter by whether it’s a built-in condition or a custom condition. Either “ |
| string | optional | n/a | Filter by the template of a condition |
| string | optional | n/a | Filter by risk type. One of: |
| string | optional | n/a | Filter by package type. One of: " Additional package types will be added. |
Response Body
Name | Type | Description |
---|---|---|
| Array[Condition] | Array of condition objects |
| PaginationMeta | Pagination metadata |
Condition
Name | Type | Description |
---|---|---|
| string | The ID of the condition, used as path parameter when updating or deleting the condition and when referring to it in a policy. |
| string | One of the IDs of the supported condition templates returned by the list condition templates api |
| string | The name of the condition |
| Boolean | false for built-in immutable conditions, true for mutable user created custom conditions |
| string | Timestamp when the condition was created |
| Timestamp when the condition was updated | |
| One of: | |
| One of: " | |
| Array[ParamWithValue] | Array of parameter values. |
ParamWithValue
Name | Type | Description |
---|---|---|
| string | A |
| Various. See explanation in the section about List Curation Condition Templates API. | A value that is allowed for the |
PaginationMeta
Name | Type | Description |
---|---|---|
| integer | Total number of objects that fit the filter (if any), possibly more than fit in a page |
| integer | Count of objects in this result page |
| string | Echo of request sorting key (or default sorting key) |
| string | Echo of request sorting direction (or default sorting direction) |
| integer | Echo of request number of objects per page (or default value) |
page_num | integer | Echo of request page number (or default value) |
Sample Request
GET /xray/api/v1/curation/conditions?order_by=updated_at&direction=asc&num_of_rows=100&page_num=1&is_custom=false&condition_template_id=isImmature&risk_type=operational&supported_pkg_types=npm
Sample Response
{ "data": [ { "id": "14", "is_custom": false, "created_at": "2023-08-01T03:00:00+03:00", "updated_at": "2023-08-01T03:00:00+03:00", "risk_type": "operational", "supported_pkg_types": ["npm", "PyPI", "Maven", "Go", "NuGet", "Conan", "Gems", "Gradle"], "condition_template_id": "isImmature", "name": "Package version is immature (permissive)", "param_values": [ { "param_id": "package_age_days", "value": 2 } ] }, { "id": "15", "is_custom": false, "created_at": "2023-08-01T03:00:00+03:00", "updated_at": "2023-08-01T03:00:00+03:00", "risk_type": "operational", "supported_pkg_types": ["npm", "PyPI", "Maven", "Go", "NuGet", "Conan", "Gems", "Gradle"], "condition_template_id": "isImmature", "name": "Package version is immature (moderate)", "param_values": [ { "param_id": "package_age_days", "value": 14 } ] }, { "id": "16", "is_custom": false, "created_at": "2023-08-01T03:00:00+03:00", "updated_at": "2023-08-01T03:00:00+03:00", "risk_type": "operational", "supported_pkg_types": ["npm", "PyPI", "Maven", "Go", "NuGet", "Conan", "Gems", "Gradle"], "condition_template_id": "isImmature", "name": "Package version is immature (strict)", "param_values": [ { "param_id": "package_age_days", "value": 30 } ] } ], "meta": { "total_count": 3, "result_count": 3, "order_by": "updated_at", "direction": "asc", "num_of_rows": 100, "page_num": 1 } }
Response Codes:
Status | Description |
---|---|
200 | OK |
400 | Bad request |