Skip to Content

Secrets

Secret values the server keeps and gives to hosts.

OperationKindHTTP
secrets.listcallGET /v1/secrets
secrets.setcallPUT /v1/secrets/{name}
secrets.removecallDELETE /v1/secrets/{name}
secrets.renamecallPOST /v1/secrets/{name}/rename

secrets.list

The names of the secrets.

Needs the role admin.

Result

FieldTypeDescription
namesstring[]The global secrets' names, and the addresses of those that belong to something: a registry's password or token is registry/NAME, the passwords rookery logs in to a host with ssh/HOST and sudo/HOST, and a provisioner's own provisioner/NAME/SECRET.
secretsNamed[]The global secrets, by name, with their ids.
Request
{
  "id": 1,
  "op": "secrets.list"
}
Reply
{
  "id": 1,
  "result": {
    "names": [
      "text"
    ],
    "secrets": [
      {
        "id": "k3v9qz2m8w1x",
        "name": "status"
      }
    ]
  }
}

secrets.set

Set a secret's value.

Needs the role admin.

Arguments

NameWhereRequiredDescription
namepathyesThe secret, by its name or its id (bare or as sec_ID); registry/REGISTRY is a registry's login, ssh/HOST and sudo/HOST a host's passwords and provisioner/PROVISIONER/SECRET a provisioner's own

Input

The value

FieldTypeDescription
valuestring

Result

FieldTypeDescription
okboolean

Errors

StatusWhen
400Not a name
Request
{
  "id": 1,
  "op": "secrets.set",
  "args": {
    "name": "status"
  },
  "data": {
    "value": "text"
  }
}
Reply
{
  "id": 1,
  "result": {
    "ok": true
  }
}

secrets.remove

Remove a secret.

Needs the role admin.

Arguments

NameWhereRequiredDescription
namepathyesThe secret, by its name or its id (bare or as sec_ID), or the address of one that belongs to something

Result

FieldTypeDescription
okboolean

Errors

StatusWhen
404No such secret
Request
{
  "id": 1,
  "op": "secrets.remove",
  "args": {
    "name": "status"
  }
}
Reply
{
  "id": 1,
  "result": {
    "ok": true
  }
}

secrets.rename

Give a global secret another name.

Needs the role admin.

Arguments

NameWhereRequiredDescription
namepathyesThe secret, by its name or its id (bare or as sec_ID)

Input

The new name

FieldTypeDescription
namestring

Result

FieldTypeDescription
okboolean

Errors

StatusWhen
400Not a name for a secret, or one that belongs to something
404No such secret
409The name is taken
Request
{
  "id": 1,
  "op": "secrets.rename",
  "args": {
    "name": "status"
  },
  "data": {
    "name": "status"
  }
}
Reply
{
  "id": 1,
  "result": {
    "ok": true
  }
}

Types

The named types used on this page.

Named

A thing rookery keeps, by its id and its name.

FieldTypeDescription
idstringIts id, which stays when it is renamed.
namestring

On this page