Print this chapterPrint this chapter

Data Hub 2.0

Full list of actions and required fields for each

Entity
Action
Required Fields
Success Message
Failure Message
user
add
username, password, firstname, lastname, email, city, country
User with username "[username]" successfully created.
User with username "[username]" could not be created.

or

User could not be created.
user
update
username / email / idnumber

These are identifying fields, only one is required to update a user. Identifying fields can not be updated.
User with username "[username]" successfully updated.
User with username "[username]" could not be updated.

or

User could not be updated
user
disable
username / email / idnumber

These are identifying fields, only one is required to delete a user.
User with username "[username]" successfully deleted. User with username "[username]" could not be deleted.

or

User could not be deleted.
roleassignment (role assignment)
create
username / email / idnumber, context (context level name), instance (context instance identifier), role (role shortname)
User with username "[username]" successfully assigned role with shortname "[shortname]" on [context] "[instance]".

For version 1 plugin, if performing group / enrolment action (only show relevant sentences):

User with username "[username]" successfully assigned role with shortname "[shortname]" on [context] "[instance]". User with username "[username]" enrolled in course with shortname "[instance]". Created group with name "[group]". Assigned user with username "[username]" to group with name "[group]". Created grouping with name "[grouping]". Assigned group with name "[group]" to grouping with name "[grouping]".
User with username "[username]" could not be assigned role with shortname "[shortname]" on [context] "[instance]".

or

Role assignment could not be created.

See notes below about implementation in version 1 plugin.
roleassignment (role assignment) delete
username / email / idnumber, context (context level name), instance (context instance identifier), role (role shortname) User with username "[username]" successfully unassigned role with shortname "[shortname]" on [context] "[instance]".

Add applicable statements:

User with username "[username]" unenrolled from course with shortname "[instance]".
User with username "[username]" could not be unassigned role with shortname "[shortname]" on [context] "[instance]".

or

Role assignment could not be deleted.

See notes below about implementation in version 1 plugin.
enrolment
create
username / email / idnumber, courseshortname (course shortname)
User with username "[username]" successfully enrolled in course with shortname "[shortname]".
User with username "[username]" could not be enrolled in course with shortname "[shortname]".

or

Enrolment could not be created.

Enrolment into {$context_descriptor} has failed for user with {$user_descriptor}, likely due to manual enrolments being disabled.

See notes below about implementation in version 1 plugin.
enrolment
delete
username / email / idnumber, courseshortname (course shortname) User with username "[username]" successfully unenrolled from course with shortname "[shortname]". User with username "[username]" could not be unenrolled from course with shortname "[shortname]".

or

Enrolment could not be deleted.

See notes below about implementation in version 1 plugin.
course
create
fullname, shortname, category (category name / path / id)
Course with shortname "[shortname]" successfully created.

For version 1 with reference to non-existent category:

Course with shortname "[shortname]" successfully created. Category with name "[name]" successfully created.
Course with shortname "[shortname]" could not be created.

or

Course could not be created.
course
update
shortname
Course with shortname "[shortname]" successfully updated. Course with shortname "[shortname]" could not be updated.

or

Course could not be updated.
course
delete
shortname
Course with shortname "[shortname]" successfully deleted. Course with shortname "[shortname]" could not be deleted.

or

Course could not be deleted.
course
createfromtemplate
fullname, shortname, templateshortname (template course shortname)
Course with shortname "[shortname]" successfully created from template course with shortname "[templateshortname]". Course with shortname "[shortname]" could not be created from template course with shortname "[templateshortname]".
group
create
courseshortname (course shortname), name (group name)
Group with name "[name]" successfully created in course with shortname "[courseshortname]".
Group with name "[name]" could not be created in course with shortname "[courseshortname]".
group
update
courseshortname (course shortname), name (group name) Group with name "[name]" successfully updated in course with shortname "[courseshortname]". Group with name "[name]" could not be updated in course with shortname "[courseshortname]".
group
delete
courseshortname (course shortname), name (group name) Group with name "[name]" successfully deleted from course with shortname "[courseshortname]". Group with name "[name]" could not be deleted from course with shortname "[courseshortname]".
groupassignment (group assignment) create
courseshortname (course shortname), name (group name), username / email / idnumber
User with username "[username]" successfully assigned to group with name "[name]" in course with shortname "[shortname]".
User with username "[username]" could not be assigned to group with name "[name]" in course with shortname "[shortname]".
groupassignment (group assignment) delete
courseshortname (course shortname), name (group name), username / email / idnumber User with username "[username]" successfully unassigned from group with name "[name]" in course with shortname "[shortname]". User with username "[username]" could not be unassigned from group with name "[name]" in course with shortname "[shortname]".
enrolmentplugin (enrolment plugin)
update
courseshortname (course shortname), shortname (plugin shortname)
Enrolment plugin with shortname "[shortname]" successfully updated in course with shortname "[courseshortname]".
Enrolment plugin with shortname "[shortname]" could not be updated in course with shortname "[courseshortname]".