Skip to main content

users

Creates, updates, deletes, gets or lists a users resource.

Overview​

Nameusers
TypeResource
Idovh.license_office.users

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
task_pending_idintegerPending task id (wire: taskPendingId)
first_namestringUser's first name (wire: firstName)
last_namestringUser's last name (wire: lastName)
activation_emailstringEmail used to activate Microsoft Office (wire: activationEmail)
delete_at_expirationbooleanWhether or not this user slot will be resigned at the next renew period (wire: deleteAtExpiration)
is_virtualbooleanSpecify if the user is actually a user slot (configureme) or a real user (wire: isVirtual)
licencesarrayLicenses attributed to the user
statusstringUser state (creating, deleting, ok, suspended, suspending, unsuspending)
usage_locationstringISO 3166-1 alpha-2 country code where the user is using Office365 services (ac, ad, ae, af, ag, ai, al, am, an, ao, aq, ar, as, at, au, aw, ax, az, ba, bb, bd, be, bf, bg, bh, bi, bj, bl, bm, bn, bo, bq, br, bs, bt, bv, bw, by, bz, ca, cc, cd, cf, cg, ch, ci, ck, cl, cm, cn, co, cr, cs, cu, cv, cw, cx, cy, cz, de, dj, dk, dm, do, dz, ec, ee, eg, eh, er, es, et, fc, fd, fi, fj, fk, fm, fo, fr, fx, ga, gb, gd, ge, gf, gg, gh, gi, gl, gm, gn, gp, gq, gr, gs, gt, gu, gw, gy, hk, hm, hn, hr, ht, hu, id, ie, il, im, in, io, iq, ir, is, it, je, jm, jo, jp, ke, kg, kh, ki, km, kn, kp, kr, kw, ky, kz, la, lb, lc, li, lk, lr, ls, lt, lu, lv, ly, ma, mc, md, me, mf, mg, mh, mk, ml, mm, mn, mo, mp, mq, mr, ms, mt, mu, mv, mw, mx, my, mz, na, nc, ne, nf, ng, ni, nl, no, np, nr, nu, nz, om, pa, pe, pf, pg, ph, pk, pl, pm, pn, pr, ps, pt, pw, py, qa, qc, re, ro, rs, ru, rw, sa, sb, sc, sd, se, sg, sh, si, sj, sk, sl, sm, sn, so, sr, ss, st, sv, sx, sy, sz, tc, td, tf, tg, th, tj, tk, tl, tm, tn, to, tp, tr, tt, tv, tw, tz, ua, ug, uk, um, us, uy, uz, va, vc, ve, vg, vi, vn, vu, we, wf, ws, ye, yt, yu, za, zm, zw) (wire: usageLocation)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectactivation_email, service_nameReturns the names, activation email, licenses and state of the user. isVirtual tells whether it is a user slot or a real user.
listselectservice_nameactivation_email, first_name, last_name, licences, x_pagination_modeReturns the activation emails of the users of the tenant. Filter them by activationEmail, firstName, lastName or licences.
createinsertservice_name, domain, loginCreates a user from a login on a domain of the tenant, with a license, optional first and last names and a usage location, and returns the task.
updateupdateactivation_email, service_nameUpdates the first name, last name and activation email of the user, and deleteAtExpiration, which ends the user slot at the next renewal.
deletedeleteactivation_email, service_nameDeletes the user and returns the task.
change_passwordexecactivationEmail, serviceName, shouldSendMailChanges the password of the user and returns the task. Leave password empty to receive a generated password by email. Set shouldSendMail to send the new password to notifyEmail, the admin contact email by default.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
activationEmailstringActivation email
activation_emailstringActivation email (wire: activationEmail)
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
serviceNamestringService name
service_namestringService name (wire: serviceName)
activation_emailstring (wire: activationEmail)
first_namestring (wire: firstName)
last_namestring (wire: lastName)
licencesarray
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Returns the names, activation email, licenses and state of the user. isVirtual tells whether it is a user slot or a real user.

SELECT
task_pending_id,
first_name,
last_name,
activation_email,
delete_at_expiration,
is_virtual,
licences,
status,
usage_location
FROM ovh.license_office.users
WHERE activation_email = '{{ activation_email }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Creates a user from a login on a domain of the tenant, with a license, optional first and last names and a usage location, and returns the task.

INSERT INTO ovh.license_office.users (
domain,
first_name,
last_name,
licence,
login,
usage_location,
service_name
)
SELECT
'{{ domain }}' /* required */,
'{{ first_name }}',
'{{ last_name }}',
'{{ licence }}',
'{{ login }}' /* required */,
'{{ usage_location }}',
'{{ service_name }}'
RETURNING
id,
finish_date,
function,
status,
todo_date
;

UPDATE examples​

Updates the first name, last name and activation email of the user, and deleteAtExpiration, which ends the user slot at the next renewal.

UPDATE ovh.license_office.users
SET
activation_email = '{{ activation_email }}',
delete_at_expiration = {{ delete_at_expiration }},
first_name = '{{ first_name }}',
last_name = '{{ last_name }}',
usage_location = '{{ usage_location }}'
WHERE
activation_email = '{{ activation_email }}' --required
AND service_name = '{{ service_name }}' --required;

DELETE examples​

Deletes the user and returns the task.

DELETE FROM ovh.license_office.users
WHERE activation_email = '{{ activation_email }}' --required
AND service_name = '{{ service_name }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Changes the password of the user and returns the task. Leave password empty to receive a generated password by email. Set shouldSendMail to send the new password to notifyEmail, the admin contact email by default.

EXEC ovh.license_office.users.change_password
@activationEmail='{{ activationEmail }}' --required,
@serviceName='{{ serviceName }}' --required
@@json=
'{
"notifyEmail": "{{ notifyEmail }}",
"password": "{{ password }}",
"shouldSendMail": {{ shouldSendMail }}
}'
;