Bondy Connect
Skip to content

Admin HTTP API ​

The Admin HTTP API exposes Bondy's administration procedures over HTTP. Each route calls one procedure of the WAMP Admin API, and that procedure's reference page is the contract for its arguments, results and errors. This page lists the routes and how an HTTP request maps onto the procedure call.

The routes are served by the admin_api service. Bondy's default admin listener carries it on port 18081, bound to loopback. See Network Listeners.

Protect the listener, not the route

The Admin HTTP API declares no authentication scheme. Anyone who can reach a listener carrying the admin_api service can administer every realm. Keep that listener on loopback or a private network, and never mount admin_api on a listener that serves the public.

Request and response mapping ​

Every route follows the same rules:

  • Base path. Routes are served at the paths below, and also under the prefix /v1.0.
  • Positional arguments. Path parameters become the procedure's positional arguments, in the order they appear in the path. For routes that send a body, the JSON request body is the next positional argument.
  • Result. A successful call answers with the procedure's first positional result as the JSON response body.
  • Errors. A failed call answers with the error's keyword arguments as the JSON body, with code replaced by the error URI. The HTTP status is the error's status from the Error Reference. For example, bondy.error.not_found maps to 404 and bondy.error.already_exists to 400. An error URI that the catalogue does not hold answers 500.
  • OPTIONS. Every path also answers OPTIONS, with an empty body.

Routes ​

Realms ​

MethodPathWAMP procedure
GET/realmsbondy.realm.list
POST/realmsbondy.realm.create
GET/realms/:realm_uribondy.realm.get
PUT/realms/:realm_uribondy.realm.update
DELETE/realms/:realm_uribondy.realm.delete
GET/realms/:realm_uri/security_enabledbondy.realm.security.is_enabled
PUT/realms/:realm_uri/security_enabledbondy.realm.security.enable
DELETE/realms/:realm_uri/security_enabledbondy.realm.security.disable

Users ​

MethodPathWAMP procedure
GET/realms/:realm_uri/usersbondy.user.list
POST/realms/:realm_uri/usersbondy.user.add
GET/realms/:realm_uri/users/:idbondy.user.get
PUT/realms/:realm_uri/users/:idbondy.user.update
DELETE/realms/:realm_uri/users/:idbondy.user.delete
POST/realms/:realm_uri/users/:id/change_passwordbondy.user.change_password
GET/realms/:realm_uri/users/:id/enabledbondy.user.is_enabled
PUT/realms/:realm_uri/users/:id/enabledbondy.user.enable
DELETE/realms/:realm_uri/users/:id/enabledbondy.user.disable
POST/realms/:realm_uri/users/:id/aliasesbondy.user.add_alias
PUT/realms/:realm_uri/users/:id/aliases/:aliasbondy.user.add_alias
DELETE/realms/:realm_uri/users/:id/aliases/:aliasbondy.user.remove_alias
PUT/realms/:realm_uri/users/:id/groups/:groupbondy.user.add_group
DELETE/realms/:realm_uri/users/:id/groups/:groupbondy.user.remove_group
POST/realms/:realm_uri/services/change_passwordbondy.user.change_password

Groups ​

MethodPathWAMP procedure
GET/realms/:realm_uri/groupsbondy.group.list
POST/realms/:realm_uri/groupsbondy.group.add
GET/realms/:realm_uri/groups/:idbondy.group.get
PUT/realms/:realm_uri/groups/:idbondy.group.update
DELETE/realms/:realm_uri/groups/:idbondy.group.delete

OAuth2 clients and resource owners ​

MethodPathWAMP procedure
POST/realms/:realm_uri/clientsbondy.oauth2.client.add
PUT/realms/:realm_uri/clients/:idbondy.oauth2.client.update
DELETE/realms/:realm_uri/clients/:idbondy.oauth2.client.delete
POST/realms/:realm_uri/resource_ownersbondy.oauth2.resource_owner.add
PUT/realms/:realm_uri/resource_owners/:idbondy.oauth2.resource_owner.update
DELETE/realms/:realm_uri/resource_owners/:idbondy.oauth2.resource_owner.delete

Grants and sources ​

MethodPathWAMP procedure
GET/realms/:realm_uri/grantsbondy.realm.grants
POST/realms/:realm_uri/grantsbondy.grant.create
PUT/realms/:realm_uri/grantsbondy.grant.revoke
GET/realms/:realm_uri/groups/:id/grantsbondy.group.grants
GET/realms/:realm_uri/users/:id/grantsbondy.user.grants
GET/realms/:realm_uri/sourcesbondy.source.list
POST/realms/:realm_uri/sourcesbondy.source.add
GET/realms/:realm_uri/users/:id/sourcesbondy.source.match
DELETE/realms/:realm_uri/users/:id/sourcesbondy.source.delete

Registrations and subscriptions ​

MethodPathWAMP procedure
GET/realms/:realm_uri/calleesbondy.wamp.callee.list — broken: no procedure has this name, so the route answers with an error
GET/realms/:realm_uri/callees/:session_idbondy.wamp.callee.get — broken: no procedure has this name, so the route answers with an error
GET/realms/:realm_uri/registrationsbondy.registration.list
GET/realms/:realm_uri/registrations/:idbondy.registration.get
GET/realms/:realm_uri/registrations/:id/calleesbondy.registration.list_callees
GET/realms/:realm_uri/subscriptionsbondy.subscription.list

The /registrations and /subscriptions routes answer with the first page of the paginated procedure. The body holds values, has_more and, when more entries remain, cursor. Each entry carries its id and its match policy. These routes pass no limit or cursor to the procedure, so the page has the default size and no route reads the next page. Use POST /services/call to call the procedure with limit and cursor.

API Gateway specifications ​

MethodPathWAMP procedure
POST/services/load_api_specbondy.http_gateway.api.load
GET/api_specsbondy.http_gateway.api.list
POST/api_specsbondy.http_gateway.api.load
GET/api_specs/:idbondy.http_gateway.api.get
DELETE/api_specs/:idbondy.http_gateway.api.delete
GET/api_specs/:id/infobondy.http_gateway.api.get

Backup and restore ​

MethodPathWAMP procedure
POST/services/create_backupbondy.export.create
GET/services/backup_statusbondy.export.status
POST/services/restore_backupbondy.export.import

Calling any procedure ​

MethodPathWAMP procedure
POST/services/callThe procedure named in the body

POST /services/call takes a body of the form {"procedure": ..., "args": [...], "kwargs": {...}, "options": {...}}, calls that procedure, and answers with {"args": ..., "kwargs": ..., "details": ...}.