Class GetApiKeyRequest

java.lang.Object
org.elasticsearch.client.security.GetApiKeyRequest
All Implemented Interfaces:
Validatable, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject

public final class GetApiKeyRequest extends Object implements Validatable, org.elasticsearch.xcontent.ToXContentObject
Request for get API key
  • Method Details

    • getRealmName

      public String getRealmName()
    • getUserName

      public String getUserName()
    • getId

      public String getId()
    • getName

      public String getName()
    • ownedByAuthenticatedUser

      public boolean ownedByAuthenticatedUser()
    • usingRealmName

      public static GetApiKeyRequest usingRealmName(String realmName)
      Creates get API key request for given realm name
      Parameters:
      realmName - realm name
      Returns:
      GetApiKeyRequest
    • usingUserName

      public static GetApiKeyRequest usingUserName(String userName)
      Creates get API key request for given user name
      Parameters:
      userName - user name
      Returns:
      GetApiKeyRequest
    • usingRealmAndUserName

      public static GetApiKeyRequest usingRealmAndUserName(String realmName, String userName)
      Creates get API key request for given realm and user name
      Parameters:
      realmName - realm name
      userName - user name
      Returns:
      GetApiKeyRequest
    • usingApiKeyId

      public static GetApiKeyRequest usingApiKeyId(String apiKeyId, boolean ownedByAuthenticatedUser)
      Creates get API key request for given api key id
      Parameters:
      apiKeyId - api key id
      ownedByAuthenticatedUser - set true if the request is only for the API keys owned by current authenticated user elsefalse
      Returns:
      GetApiKeyRequest
    • usingApiKeyName

      public static GetApiKeyRequest usingApiKeyName(String apiKeyName, boolean ownedByAuthenticatedUser)
      Creates get API key request for given api key name
      Parameters:
      apiKeyName - api key name
      ownedByAuthenticatedUser - set true if the request is only for the API keys owned by current authenticated user elsefalse
      Returns:
      GetApiKeyRequest
    • forOwnedApiKeys

      public static GetApiKeyRequest forOwnedApiKeys()
      Creates get api key request to retrieve api key information for the api keys owned by the current authenticated user.
    • forAllApiKeys

      public static GetApiKeyRequest forAllApiKeys()
      Creates get api key request to retrieve api key information for all api keys if the authenticated user is authorized to do so.
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException