From ba980484019f5e471d418a2916a87ea4e31f50ac Mon Sep 17 00:00:00 2001 From: Chris Spencer Date: Tue, 30 Aug 2016 15:04:22 -0700 Subject: [PATCH] Add documentation on how to set a user's tenant. Change-Id: I61b98891336ca1ed096f013ff1ed1a89d7854886 Closes-Bug: #1609161 --- api-ref/source/v2-admin/admin-users.inc | 2 + .../samples/admin/user-update-request.json | 3 +- .../samples/admin/user-update-response.json | 3 +- api-ref/source/v2-ext/ksadm-admin.inc | 44 +++++++++++++++++++ .../samples/OS-KSADM/user-show-response.json | 3 +- .../OS-KSADM/user-update-tenant-request.json | 5 +++ 6 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 api-ref/source/v2-ext/samples/OS-KSADM/user-update-tenant-request.json diff --git a/api-ref/source/v2-admin/admin-users.inc b/api-ref/source/v2-admin/admin-users.inc index 0af068f8a9..b1bd8c9c2d 100644 --- a/api-ref/source/v2-admin/admin-users.inc +++ b/api-ref/source/v2-admin/admin-users.inc @@ -132,6 +132,7 @@ Request - enabled: enabled - email: email - name: name + - tenantId: tenantId Request Example --------------- @@ -149,6 +150,7 @@ Response Parameters - email: email - name: name - id: id + - tenantId: tenantId Response Example ---------------- diff --git a/api-ref/source/v2-admin/samples/admin/user-update-request.json b/api-ref/source/v2-admin/samples/admin/user-update-request.json index 904765f30a..5550840ce7 100644 --- a/api-ref/source/v2-admin/samples/admin/user-update-request.json +++ b/api-ref/source/v2-admin/samples/admin/user-update-request.json @@ -1,5 +1,6 @@ { "user": { - "email": "updated_email@example.org" + "email": "updated_email@example.org", + "tenantId": "1ca8e0" } } diff --git a/api-ref/source/v2-admin/samples/admin/user-update-response.json b/api-ref/source/v2-admin/samples/admin/user-update-response.json index 3ff6a35b1f..2007c34c2d 100644 --- a/api-ref/source/v2-admin/samples/admin/user-update-response.json +++ b/api-ref/source/v2-admin/samples/admin/user-update-response.json @@ -4,6 +4,7 @@ "name": "demo", "email": "updated_email@example.org", "username": "demo", - "enabled": true + "enabled": true, + "tenantId": "1ca8e0" } } diff --git a/api-ref/source/v2-ext/ksadm-admin.inc b/api-ref/source/v2-ext/ksadm-admin.inc index 94f10cc157..db685fb732 100644 --- a/api-ref/source/v2-ext/ksadm-admin.inc +++ b/api-ref/source/v2-ext/ksadm-admin.inc @@ -92,6 +92,50 @@ Response Example :language: javascript +Update user tenant +================== + +.. rest_method:: PUT /v2.0/users/{userId}/OS-KSADM/tenant + +Sets a user's tenant + +Normal response codes: 200 + +Error response codes: 413, 415, 405, 404, 403, 401, 400, 503, 409 + +Request +------- + +.. rest_parameters:: parameters.yaml + + - userId: userId + - tenantId: tenantId + +Request Example +--------------- + +.. literalinclude:: samples/OS-KSADM/user-update-tenant-request.json + :language: javascript + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - email: email + - enabled: enabled + - tenantId: tenantId + - id: id + - name: name + - username: username + +Response Example +---------------- + +.. literalinclude:: samples/OS-KSADM/user-show-response.json + :language: javascript + + Create service (admin extension) ================================ diff --git a/api-ref/source/v2-ext/samples/OS-KSADM/user-show-response.json b/api-ref/source/v2-ext/samples/OS-KSADM/user-show-response.json index 62f3b7e08c..5914996fbb 100644 --- a/api-ref/source/v2-ext/samples/OS-KSADM/user-show-response.json +++ b/api-ref/source/v2-ext/samples/OS-KSADM/user-show-response.json @@ -4,6 +4,7 @@ "name": "admin", "email": "admin@example.org", "username": "admin", - "enabled": true + "enabled": true, + "tenantId": "1ca8e0" } } diff --git a/api-ref/source/v2-ext/samples/OS-KSADM/user-update-tenant-request.json b/api-ref/source/v2-ext/samples/OS-KSADM/user-update-tenant-request.json new file mode 100644 index 0000000000..95261260d4 --- /dev/null +++ b/api-ref/source/v2-ext/samples/OS-KSADM/user-update-tenant-request.json @@ -0,0 +1,5 @@ +{ + "user": { + "tenantId": "1ca8e0" + } +} \ No newline at end of file