Get Workers

JFrog REST APIs

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 user, project-admin or non-admin if the Worker is of Generic Event type and has been shared with non-admin users.

Usage:GET /worker/api/v1/workers

Produces: application/json; charset=utf-8

Header parameter: Authorization: Bearer

Sample Usage

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

Query 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. See worker actions.

keysOnly

boolean

No

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

Default: false

projectKey

string

No

If set, this Worker will be available in the scope of the given project (editable by platform admin and project admin). Otherwise this Worker will be global and only editable by platform admin. Once set, the projectKey cannot be changed.

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
        }
    ]
}