Workers Management Workflow

JFrog Platform Administration Documentation

Content Type
Administration / Platform
ft:sourceType
Paligo

The operations for creating and managing a worker are provided below. These operations are performed by a Platform Administrator.

Tasks to Set Up Worker

#

Task

Using APIs

1

Create a worker

(Includes adding secrets and filtering repositories)

Create WorkerCreate Worker

POST /worker/api/v1/workers

2

Delete a worker

Delete WorkerDelete Worker

DELETE /worker/api/v1/workers/{workerKey}

3

Get all workers

Get WorkersGet Workers

GET /worker/api/v1/workers 

3

Get a specified worker

Get Specified WorkerGet Specified Worker

GET /worker/api/v1/workers/{workerKey}

4

Update a worker

Update WorkerUpdate Worker

PUT /worker/api/v1/workers

5

Get available actions for a worker

Get Available ActionsGet Available Actions

GET /worker/api/v1/system/actions  

6

Test worker

Execute TestExecute Test

POST /worker/api/v1/test/[/{workerKey}] 

7

Service readiness of worker

Workers Service ReadinessWorkers Service Readiness

GET /worker/api/v1/system/readiness 

8

Service liveness of worker

Workers Service LivenessWorkers Service Liveness

GET /worker/api/v1/system/liveness

9

Filter repositories for worker

Update WorkerUpdate Worker

PUT /worker/api/v1/workers 

9

Add secrets to worker

Update WorkerUpdate Worker

PUT /worker/api/v1/workers 

10

Get worker's run history

Get Worker Execution HistoryGet Worker Execution History

GET /worker/api/v1/execution_history

API Task Usage Overview

The API usage and request/response bodies for creating and managing a worker are provided below.

Task

API Usage and Request/Response

Create a worker

(Includes adding secrets and filtering repositories)

Create WorkerCreate Worker

POST /worker/api/v1/workers

Request

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

You differentiate between the type of worker created using the action parameter. Choose the worker action with which the worker is associated.List of Worker Events

Delete a worker

Delete WorkerDelete Worker

DELETE /worker/api/v1/workers/{workerKey}

Get all workers

Get WorkersGet Workers

GET /worker/api/v1/workers 

Response

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

Get a specified worker

Get Specified WorkerGet Specified Worker

GET /worker/api/v1/workers/{workerKey}

Response

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

Update a worker /

Add secrets to worker /

Filter repositories for worker

Update WorkerUpdate Worker

PUT /worker/api/v1/workers

Request

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

Get available actions for a worker

Get Available ActionsGet Available Actions

GET /worker/api/v1/system/actions  

Response

[
   "BEFORE_DOWNLOAD",
   "AFTER_DOWNLOAD",
   "BEFORE_UPLOAD",
   "AFTER_CREATE",
]  

Test worker

Execute TestExecute Test

POST /worker/api/v1/test/[/{workerKey}] 

Request

{
  "code": string,
  "action": string,
  "data": object, // action specific payload
  "stagedSecrets": undefined | Secret[]
}

Service readiness of worker

Workers Service ReadinessWorkers Service Readiness

GET /worker/api/v1/system/readiness 

Get Execution History

Get Worker Execution HistoryGet Worker Execution History

GET /worker/api/v1/execution_history

Request

{
    "workerKey": string,
    "showTestRun": boolean
}