RPC methods

This page contains basic documentation of all RPC methods available to clients, the privileges required for them and a description of their parameters.

admin-level methods

Method name prefix
admin.
Privilege required
PRIV_ADMIN

admin.get_computer_info

Requests information on a computer from the server. If computer ID parameter is None information for ALL computers is returned.

Parameters
computer ID (may be None)
Return value
computer info array (array of dictionaries)

admin.get_computer_tasks

Requests information on tasks assigned to given computer (selected via computer ID).

Parameters
computer ID
Return value
task info array (array of dictionaries)

admin.get_current_packages

Requests information on current packages of given computer (selected via computer ID).

Parameters
  • computer ID
  • package name (may be "*" for all packages)
Return value
current packages info array (array of dictionaries)

admin.get_update_candidates

Requests information on package update candidates of given computer (selected via computer ID).

Parameters
  • computer ID
  • package name (may be "*" for all packages)
Return value
update candidates info array (array of dictionaries)

admin.get_repositories

Requests information on repositories used by given computer (selected via computer ID).

Parameters
  • computer ID
  • type (repository type)
  • uri (may be "*" for all uris)
Return value
repositories info array (array of dictionaries)

admin.get_account

Requests account information of given account (selected via account ID).

Parameters
account ID
Return value
account info dictionary

admin.get_account_id_by_name

Requests account ID of given account (selected via account name).

Parameters
account name
Return value
account ID

admin.get_account_ids

Requests account IDs of all accounts.

Parameters
None
Return value
account IDs array

admin.set_privilege

Sets privilege level of given account (selected via account ID).

Parameters
  • account ID
  • privilege level
Return value
None

admin.sign_csr

Signs CSR of given account (selected via account ID).

Parameters
account ID
Return value
None

agent-level methods

Method name prefix
agent.
Privilege required
PRIV_AGENT

anonymous-level methods

Method name prefix
anon.
Privilege required
PRIV_ANONYMOUS

anon.check_protocol_version

Requests the current 'nwu' protocol version implemented by the server.

This method should be used by the client to check if the version of its protocol matches the one implemented at the server. If they don't match, 'nwu-agent' should run a "self update".

The client informs the current version to the server, so that information can be logged and 'stale' clients can be detected.

Parameters
  • client protocol version (string)
Return value
  • server protocol version (string)

anon.get_my_privileges

Requests privilege information from the server.

Parameters
None
Return value
Privileges (level, integer)

anon.get_ca_certificate

Requests the CA root certificate from the server.

Parameters
None
Return value
CA root certificate (string)

anon.get_certificate

Requests a client certificate from the server.
NOTE: There is no point in securing this method as downloading a certificate alone does not enable an attacker to authenticate. The attacker would also need the corresponding private key.

Parameters
Account ID (integer)
Return value
Client certificate (string)

anon.request_csr_signing

Requests signing of a newly created CSR. This method creates a new account with PRIV_ANONYMOUS privileges. An admin may or may not create a certificate from the CSR so the client can authenticate.
NOTE: Anti-spam measures in implementation are required (#111).

Parameters
Account name (string)
CSR (string)
Return value
Account ID (integer)
-->