Get Workers

JFrog REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Gets a list of worker services, or a filtered list of worker services associated with a specific action. To get a specific worker by workersKey, see Get Specified Worker.

Since: 7.63.2

Security: Admin authentication is required.

Usage: GET /worker/api/v1/workers

Produces: application/json; charset=utf-8

Sample Usage

curl -X GET 'https://myserver.com/worker/api/v1/workers

Request Parameters

Name

Datatype

Mandatory

Description

action

string

No

If an action is provided, only workers associated with the given action will be returned, otherwise the full list is returned. One of the following actions can be applied:

BEFORE_DOWNLOAD

AFTER_DOWNLOAD

BEFORE_UPLOAD

AFTER_CREATE

AFTER_BUILD_INFO_SAVE

AFTER_MOVE

keysOnly

boolean

No

If true only the list of worker keys will be returned, otherwise a list of workers will be returned.

Default: false

Sample Query 1

GET 'https://myserver.com/worker/api/v1/workers?action=BEFORE_DOWNLOAD&keysOnly=trueworkers'

Sample Response 1

{
    "keys": [
        "Worker1",
        "Worker2",
        ...
        "WorkerN"
    ]
}

Sample Query 2

GET 'https://myserver.com/worker/api/v1/workers'

Sample Response 2

{
    "workers": [
        {
            "key": string,
            "description": string,
            "enabled": boolean,
            "sourceCode": string,
            "action": string,
            "filterCriteria": {
                "artifactFilterCriteria": {
                    "repoKeys": [
                        "repo1",
                        "Repo2"
                    ],
                    "includePatterns": undefined | string[],
                    "excludePatterns": undefined | string[]
                }
            },
            "secrets": Secret[]
}

Success Response Codes:

200: Ok successful.

Error Response Codes:

400 The request payload is malformed.

401 Invalid credentials.

403 Insufficient permissions.

Error Response

{
    "errors": [
        {
            "status": number // The HTTP error status code
            "message": string // The reason of the error
        }
    ]
}