targets

add_site_direct: upload Target struct

MethodPath
POST/api/v1/targets/add-direct

Body Fields

FieldType
bboxString,
contextValueMap
nameString,
pipelines (optional)[String]
tags (optional)[String]
tenant (optional)String

Examples

cURL

curl -X POST -H 'Content-Type: application/json' -H "Authorization: $JWT" \
$URL/api/v1/targets/add-direct -d '{
  "bbox": "0",
  "name": "test0",
  "tags": [
    "test"
  ]
}'

add_site: upload target YAML definition

MethodPath
POST/api/v1/targets/add

Examples

cURL

curl -X POST -H 'Content-Type: application/json' -H "Authorization: $JWT" \
$URL/api/v1/targets/add --data-binary 'name: "test0"
bbox: "0"
'

cURL

curl -X POST -H 'Content-Type: application/json' -H "Authorization: $JWT" \
$URL/api/v1/targets/add -d '{
  "num_records": 1,
  "pipes": [
    "HRD"
  ],
  "targets": [
    "SERVER"
  ]
}'

update_site: upload site definition which will be merged with site using this id

MethodPath
POST/api/v1/targets/update

Body Fields

FieldType
bboxString,
contextValueMap
nameString,
pipelines (optional)[String]
tags (optional)[String]
tenant (optional)String

Examples

cURL

curl -X POST -H 'Content-Type: application/json' -H "Authorization: $JWT" \
$URL/api/v1/targets/update -d '{
  "bbox": "0",
  "name": "test_zero"
}'

update_site_yaml: like update_site, except provide Target in YAML

MethodPath
POST/api/v1/targets/update/update-yaml

Examples

cURL

curl -X POST -H 'Content-Type: application/json' -H "Authorization: $JWT" \
$URL/api/v1/targets/update/update-yaml --data-binary 'bbox: "0"
name: test_zero
'

get_sites: get all sites, optionally filtering by tags, tenant, names or target ids

MethodPath
GET/api/v1/targets/list

Body Fields

FieldType
names (optional)[String]
tags (optional)[String]
targets (optional)[String]
tenant (optional)String
with_additional_contextbool

Examples

search by target id

cURL

curl -X GET -H 'Content-Type: application/json' -H "Authorization: $JWT" \
$URL/api/v1/targets/list -d '{
  "targets": [
    "0"
  ]
}'

Output

{
  "Sites": [
  {
    "name": "test0",
    "bbox": "0",
    "tenant": "default",
    "trace": [],
    "pipelines": [],
    "tags": [
        "test"
    ],
    "context": {},
    "protected": false
  }
  ]
}

search by matching tags

cURL

curl -X GET -H 'Content-Type: application/json' -H "Authorization: $JWT" \
$URL/api/v1/targets/list -d '{
  "tags": [
    "test"
  ]
}'

get_target_ids: get all site ids, filtering by tags, tenants or names

MethodPath
GET/api/v1/targets/list-ids

Body Fields

FieldType
names (optional)[String]
tags (optional)[String]
targets (optional)[String]
tenant (optional)String
with_additional_contextbool

add_all_sites: upload full 'sites.yml' definition

MethodPath
POST/api/v1/targets/add-all

remove_site: remove named site

MethodPath
POST/api/v1/targets/remove/name:String

Params

ParamType
nameString

Examples

cURL

curl -X POST -H 'Content-Type: application/json' -H "Authorization: $JWT" \
$URL/api/v1/targets/remove/1

add_pipeline_to_site: add a pipeline by name to a site by id

MethodPath
POST/api/v1/targets/add-pipe

Body Fields

FieldType
pipeString
target_idString

Examples

cURL

curl -X POST -H 'Content-Type: application/json' -H "Authorization: $JWT" \
$URL/api/v1/targets/add-pipe -d '{
  "pipe": "simple",
  "target_id": "0"
}'

remove_pipeline_from_site: remove pipe from target

MethodPath
POST/api/v1/targets/remove-pipe

Body Fields

FieldType
target_idString
valueString

Examples

cURL

curl -X POST -H 'Content-Type: application/json' -H "Authorization: $JWT" \
$URL/api/v1/targets/remove-pipe -d '{
  "target_id": "0",
  "value": "simple"
}'

remove_tag_from_site: remove tag from target

MethodPath
POST/api/v1/targets/remove-tag

Body Fields

FieldType
target_idString
valueString

add_tag_to_site: add a tag to a target

MethodPath
POST/api/v1/targets/add-tag

Body Fields

FieldType
target_idString
valueString

Examples

cURL

curl -X POST -H 'Content-Type: application/json' -H "Authorization: $JWT" \
$URL/api/v1/targets/add-tag -d '{
  "target_id": "0",
  "value": "tagged"
}'

rebuild_targets: rebuild specified targets by name

MethodPath
POST/api/v1/targets/rebuild

Examples

cURL

curl -X POST -H 'Content-Type: application/json' -H "Authorization: $JWT" \
$URL/api/v1/targets/rebuild -d '[
  "0"
]'

start_target_update: indicate that a set of target updates will happen

MethodPath
POST/api/v1/targets/start-update

end_target_update: target updates are finished and building can happen

MethodPath
POST/api/v1/targets/end-update

get_target_report_times: get the agent report times in epoch secs

MethodPath
GET/api/v1/targets/report-times

get_target_pipe_statuses: return status map for particular target, or all if target is '*'

MethodPath
GET/api/v1/targets/pipe-status/target:String

Params

ParamType
targetString

set_target_settings: set log settings etc for a set of targets

MethodPath
POST/api/v1/targets/settings

get_target_settings: get current settings for this target

MethodPath
GET/api/v1/targets/get-settings/target:String

Params

ParamType
targetString

Examples

get all the settings for target ID '0'

cURL

curl -X GET -H 'Content-Type: application/json' -H "Authorization: $JWT" \
$URL/api/v1/targets/get-settings/0

get_metrics: get metrics from the Hotrodd

MethodPath
GET/api/v1/targets/metrics

Body Fields

FieldType
end_time (optional)Timestamp
pipes[String]
start_time (optional)Timestamp
targets[String]

get_statistics: get pipe process statistics from the Hotrodd

MethodPath
GET/api/v1/targets/stats

get_logs: get remote logs from the Hotrodd server

MethodPath
GET/api/v1/targets/logs

Body Fields

FieldType
end_time (optional)Timestamp
log_level (optional)LogLevel
num_records (optional)int
pipes[String]
start_time (optional)Timestamp
targets[String]
trace_id (optional)int

Examples

cURL

curl -X GET -H 'Content-Type: application/json' -H "Authorization: $JWT" \
$URL/api/v1/targets/logs -d '{
  "num_records": 1,
  "pipes": [
    "HRD"
  ],
  "targets": [
    "SERVER"
  ]
}'