Class: subject

Last published : Oct 01, 2026
A user or group that can log in xapi

Fields for class: subject

Field Type Qualifier Description
other_config (string -> string) map RO/constructor additional configuration
roles role ref set RO/runtime the roles associated with this subject
subject_identifier string RO/constructor the subject identifier, unique in the external directory service
uuid string RO/runtime Unique identifier/object reference

RPCs associated with class: subject

RPC name: addtoroles

Overview:
This call adds a new role to a subject
Signature:
void add_to_roles (session ref session_ref, subject ref self, role ref role)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
subject ref self The subject who we want to add the role to
role ref role The unique role reference
Minimum Role: pool-admin
Return Type: void

RPC name: create

Overview:
Create a new subject instance, and return its handle.
Signature:
subject ref create (session ref session_ref, subject record args)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
subject record args All constructor arguments
Minimum Role: pool-admin
Return Type: subject ref
reference to the newly created object

RPC name: destroy

Overview:
Destroy the specified subject instance.
Signature:
void destroy (session ref session_ref, subject ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
subject ref self reference to the object
Minimum Role: pool-admin
Return Type: void

RPC name: getall

Overview:
Return a list of all the subjects known to the system.
Signature:
subject ref set get_all (session ref session_ref)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
Minimum Role: read-only
Return Type: subject ref set
references to all objects

RPC name: getallrecords

Overview:
Return a map of subject references to subject records for all subjects known to the system.
Signature:
(subject ref -> subject record) map get_all_records (session ref session_ref)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
Minimum Role: read-only
Return Type: (subject ref -> subject record) map
records of all objects

RPC name: getbyuuid

Overview:
Get a reference to the subject instance with the specified UUID.
Signature:
subject ref get_by_uuid (session ref session_ref, string uuid)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
string uuid UUID of object to return
Minimum Role: read-only
Return Type: subject ref
reference to the object

RPC name: getotherconfig

Overview:
Get the otherconfig field of the given subject.
Signature:
(string -> string) map get_other_config (session ref session_ref, subject ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
subject ref self reference to the object
Minimum Role: read-only
Return Type: (string -> string) map
value of the field

RPC name: getpermissionsnamelabel

Overview:
This call returns a list of permission names given a subject
Signature:
string set get_permissions_name_label (session ref session_ref, subject ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
subject ref self The subject whose permissions will be retrieved
Minimum Role: read-only
Return Type: string set
a list of permission names

RPC name: getrecord

Overview:
Get a record containing the current state of the given subject.
Signature:
subject record get_record (session ref session_ref, subject ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
subject ref self reference to the object
Minimum Role: read-only
Return Type: subject record
all fields from the object

RPC name: getroles

Overview:
Get the roles field of the given subject.
Signature:
role ref set get_roles (session ref session_ref, subject ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
subject ref self reference to the object
Minimum Role: read-only
Return Type: role ref set
value of the field

RPC name: getsubjectidentifier

Overview:
Get the subjectidentifier field of the given subject.
Signature:
string get_subject_identifier (session ref session_ref, subject ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
subject ref self reference to the object
Minimum Role: read-only
Return Type: string
value of the field

RPC name: getuuid

Overview:
Get the uuid field of the given subject.
Signature:
string get_uuid (session ref session_ref, subject ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
subject ref self reference to the object
Minimum Role: read-only
Return Type: string
value of the field

RPC name: removefromroles

Overview:
This call removes a role from a subject
Signature:
void remove_from_roles (session ref session_ref, subject ref self, role ref role)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
subject ref self The subject from whom we want to remove the role
role ref role The unique role reference in the subject's roles field
Minimum Role: pool-admin
Return Type: void