Replication targets
A replication target is your own storage the workspace's archived data is copied to; list the targets and how their latest copies went.
ReplicationTarget object
A replication target is storage you own that the workspace's archived data is copied to, for the organizations it covers.
idstringThe target's id.
target_type stringThe kind of storage it is, such as s3, s3_compatible, azure_blob, azure_files, gcs or b2.
namestringThe target's name.
descriptionstring or nullThe target's description; null when it has none.
enabledbooleanWhether data is copied to the target.
scopeScopeWhich organizations' data is copied to the target, all or selected. A target saved without organizations copies nothing and reads as selected with none.
configmap of stringThe target's storage settings by name, such as bucket, s3_region or azure_container. Settings that are not storage settings are left out, and so is an s3_endpoint carrying a user name or a query. Its contents are not part of the API contract and may change.
credential_names array of stringThe names of the credentials stored on the target, such as s3_secret_access_key, in order. The credentials themselves are never sent.
job_status ReplicationJobStatus or nullHow the target's latest run went; null until it has run.
List replication targets
/workspaces/{workspace_id}/replication-targets Returns the workspace's replication targets you can see, in id order: where each copies data, its storage settings, which credentials it stores and how its latest run went. Needs archive.config.read: held over every organization, it lists every target; held at some organizations, it lists the targets that name one of them. A target's organizations are cut to those you can see. Credentials are named, never sent.
- Request
- Response
- curl
- PowerShell
- Python
curl -X GET \ "https://engine.sparklogs.app/app-api/workspaces/5e1f0a00-0000-4000-8000-000000000001/replication-targets" \ -H "Authorization: Bearer $SPARKLOGS_TOKEN"Invoke-RestMethod -Method Get ` -Uri "https://engine.sparklogs.app/app-api/workspaces/5e1f0a00-0000-4000-8000-000000000001/replication-targets" ` -Headers @{ Authorization = "Bearer $env:SPARKLOGS_TOKEN" }import os import requests response = requests.get( "https://engine.sparklogs.app/app-api/workspaces/5e1f0a00-0000-4000-8000-000000000001/replication-targets" , headers={"Authorization": f"Bearer {os.environ['SPARKLOGS_TOKEN']}"},)response.raise_for_status(){ "message": "replication targets retrieved", "replication_targets": [ { "id": "offsite-copy", "target_type": "s3", "name": "Offsite copy", "description": "Nightly copy to the MSP's own bucket", "enabled": true, "scope": { "kind": "all", "org_ids": [], "inherited": false, "other_orgs": false }, "config": { "bucket": "northwind-archive", "s3_region": "us-east-2" }, "credential_names": [ "s3_access_key_id", "s3_secret_access_key" ], "job_status": null } ]}Access
- Works with
- Signed-in person, Personal token, OAuth token, Workspace token
- Scope
- any of
admin:readadmin:write - Privilege
archive.config.read
Needs archive.config.read. archive.config.read applies at each organization a grant covers and every organization below it. A caller who reaches no organization gets an empty list.
Behavior
- Retry
- Safe to send again
Path parameters
workspace_id uuidrequiredThe workspace's id.
Query parameters
fieldsarray of stringComma-separated top-level fields of each object to return instead of the default set.
Sent by default: idtarget_typenamedescriptionenabledscopeconfigcredential_namesjob_status
Response 200
Every one of the replication targets you can see.
messagestringrequiredWhat the call did, as a short phrase for a person to read. Its wording may change: act on the HTTP status.
Errors
400APP_API_ERR_BAD_PARAMETERS A query parameter it does not take, one given twice, or fields naming a field it does not have.No403APP_API_ERR_NO_PRIVILEGE token_scopeno_privilegeYou do not hold archive.config.read. The same refusal comes when the path names a workspace other than the token's own.NoPlus the errors every call can return.