Browse Source

[Docs] Document with_profile_uid parameter for GetUser API (#98959)

The GetUser API supports retrieving user profile uid since 8.5.0 but was
not documented. This PR adds documentation for the new parameter.

Relates: #89570
Yang Wang 2 years ago
parent
commit
880882c132
2 changed files with 41 additions and 0 deletions
  1. 8 0
      x-pack/docs/build.gradle
  2. 33 0
      x-pack/docs/en/rest-api/security/get-users.asciidoc

+ 8 - 0
x-pack/docs/build.gradle

@@ -711,6 +711,14 @@ tasks.named("buildRestTests").configure { buildRestTests ->
             "email" : "jacknich@example.com",
             "metadata" : { "intelligence" : 7 }
           }
+  - do:
+      security.activate_user_profile:
+        body: >
+          {
+            "grant_type": "password",
+            "username": "jacknich",
+            "password" : "l0ng-r4nd0m-p@ssw0rd"
+          }
 '''
   setups['app0102_privileges'] = '''
   - do:

+ 33 - 0
x-pack/docs/en/rest-api/security/get-users.asciidoc

@@ -35,6 +35,13 @@ For more information about the native realm, see
   usernames as a comma-separated list. If you omit this parameter, the API
   retrieves information about all users.
 
+[[security-api-get-user-query-params]]
+==== {api-query-parms-title}
+
+`with_profile_uid`::
+(Optional, boolean) Determines whether to retrieve the <<user-profile,user profile>> `uid`,
+if exists, for the users. Defaults to `false`.
+
 [[security-api-get-user-response-body]]
 ==== {api-response-body-title}
 
@@ -74,6 +81,32 @@ GET /_security/user/jacknich
 }
 --------------------------------------------------
 
+To retrieve the user `profile_uid` as part of the response:
+
+[source,console]
+--------------------------------------------------
+GET /_security/user/jacknich?with_profile_uid=true
+--------------------------------------------------
+// TEST[continued]
+
+[source,console-result]
+--------------------------------------------------
+{
+  "jacknich": {
+    "username": "jacknich",
+    "roles": [
+      "admin", "other_role1"
+    ],
+    "full_name": "Jack Nicholson",
+    "email": "jacknich@example.com",
+    "metadata": { "intelligence" : 7 },
+    "enabled": true,
+    "profile_uid": "u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0"
+  }
+}
+--------------------------------------------------
+
+
 Omit the username to retrieve all users:
 
 [source,console]