List Curation Conditions

JFrog REST APIs

Content Type
REST API
ft:sourceType
Paligo

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

order_by

string

optional

updated_at

Field used for sorting. One of: “id”, “updated_at”.

direction

string

optional

desc

Sorting direction. One of “asc” or “desc”.

num_of_rows

number

optional

15

Number of rows in the response.

page_num

number

optional

1

The number of the page in pagination.

offset

number

optional

0

Alternative to page number, pagination offset.

name

string

optional

n/a

Filter by name of condition

is_custom

boolean

optional

n/a

Filter by whether it’s a built-in condition or a custom condition.

Either “true” or “false”.

condition_template_id

string

optional

n/a

Filter by the template of a condition

risk_type

string

optional

n/a

Filter by risk type. One of: security, legal or operational.

supported_pkg_types

string

optional

n/a

Filter by package type.

One of: "npm", "PyPI", "Maven", "Go", "NuGet", "Conan", "Gems", "Gradle", "HuggingFaceML" or "Docker".

Additional package types will be added.

Response Body

Name

Type

Description

data

Array[Condition]

Array of condition objects

meta

PaginationMeta

Pagination metadata

Condition

Name

Type

Description

id

string

The ID of the condition, used as path parameter when updating or deleting the condition and when referring to it in a policy.

condition_template_id

string

One of the IDs of the supported condition templates returned by the list condition templates api

name

string

The name of the condition

is_custom

Boolean

false for built-in immutable conditions, true for mutable user created custom conditions

created_at

string

Timestamp when the condition was created

updated_at

Timestamp when the condition was updated

risk_type

One of: security, legal or operational.

supported_pkg_types

One of: "npm", "PyPI", "Maven", "Go", "NuGet", "Conan", "Gems", "Gradle", "HuggingFaceML" or "Docker". Additional package types will be added.

param_values

Array[ParamWithValue]

Array of parameter values.

ParamWithValue

Name

Type

Description

param_id

string

A param_id that is allowed with the condition_template_id of the condition

value

Various. See explanation in the section about List Curation Condition Templates API.

A value that is allowed for the param_id

PaginationMeta

Name

Type

Description

total_count

integer

Total number of objects that fit the filter (if any), possibly more than fit in a page

result_count

integer

Count of objects in this result page

order_by

string

Echo of request sorting key (or default sorting key)

direction

string

Echo of request sorting direction (or default sorting direction)

num_of_rows

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