This API is used for configuring hubs so that a single hub can be used to report on any host connected to participating feeder hubs.
Federated reporting must be enabled before it is possible to use the remote hubs API, please
see the Enable hub for Federated Reporting
section below.
URI: https://hub.cfengine.com/api/fr/remote-hub
Method: GET
Example response:
HTTP 200 OK
{
"id-1": {
"id": 1,
"hostkey": "SHA=2d67a6840878de...",
"api_url": "https://172.28.128.5",
"ui_name": "ubuntu-xenial",
"role": "feeder",
"target_state": "on",
"transport": {
"mode": "pull_over_rsync",
"ssh_user": "cfdrop",
"ssh_host": "172.28.128.5",
"ssh_pubkey": "",
"ssh_fingerprint": ""
}
},
"id-2": {
"id": 2,
"hostkey": "SHA=wefweg34tgfds...",
"api_url": "https://172.28.128.6",
"ui_name": "ubuntu-beaver",
"role": "feeder",
"target_state": "on",
"transport": {
"mode": "pull_over_rsync",
"ssh_user": "cfdrop",
"ssh_host": "superhub",
"ssh_pubkey": "pubkey cfdrop",
"ssh_fingerprint": null
}
}
}
URI: https://hub.cfengine.com/api/fr/remote-hub/:remote_hub_id
Method: GET
Parameters:
Example response:
HTTP 200 OK
{
"id": 1,
"hostkey": "SHA=2d67a6840878de098abbef1172f103a6febbfb5d00b8ace31ca3d46a9d22930d",
"api_url": "https://172.28.128.5",
"ui_name": "ubuntu-xenial",
"role": "feeder",
"target_state": "on",
"transport": {
"mode": "pull_over_rsync",
"ssh_user": "cfdrop",
"ssh_host": "172.28.128.5",
"ssh_pubkey": "",
"ssh_fingerprint": ""
}
}
URI: https://hub.cfengine.com/api/fr/remote-hub
Method: POST
Parameters:
feeder
, superhub
on
, paused
{ "mode": "pull_over_rsync", "ssh_user": "cfdrop", "ssh_host": "172.28.128.5", "ssh_pubkey": "", "ssh_fingerprint": ""}
Example response:
HTTP 201 CREATED
URI: https://hub.cfengine.com/api/fr/remote-hub/:remote_hub_id
Method: PUT
Parameters:
feeder
, superhub
on
, paused
{ "mode": "pull_over_rsync", "ssh_user": "cfdrop", "ssh_host": "172.28.128.5", "ssh_pubkey": "", "ssh_fingerprint": ""}
Example response:
HTTP 202 ACCEPTED
URI: https://hub.cfengine.com/api/fr/remote-hub/:remote_hub_id
Method: DELETE
Parameters:
Example response:
HTTP 202 ACCEPTED
URI: https://hub.cfengine.com/api/fr/setup-hub/superhub
Method: POST
Example response:
HTTP 202 ACCEPTED
URI: https://hub.cfengine.com/api/fr/setup-hub/feeder
Method: POST
Example response:
HTTP 202 ACCEPTED
URI: https://hub.cfengine.com/api/fr/hub-status
Method: GET
Example response:
{
"configured": true,
"role": "feeder",
"enable_request_sent": true,
"transport_ssh_public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFpTZhfubmkXONNReTAXA9v2eYo3xQ4GKcsB3J7i5arw root@ubuntu-xenial",
"ssh_fingerprint": false
}
Federated reporting must be enabled before generating or removing federation configuration, please
see Enable hub for Federated Reporting
section above. Otherwise an error will be thrown and
config file will not be created/deleted.
URI: https://hub.cfengine.com/api/fr/federation-config
Method: POST
Example response:
HTTP 202 ACCEPTED
URI: https://hub.cfengine.com/api/fr/federation-config
Method: DELETE
Example response:
HTTP 202 ACCEPTED