java.lang.Object
co.elastic.clients.elasticsearch.security.ApiKey
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class ApiKey extends Object implements JsonpSerializable
See Also:
  • Field Details

  • Method Details

    • of

    • id

      public final String id()
      Required - Id for the API key

      API name: id

    • name

      public final String name()
      Required - Name of the API key.

      API name: name

    • type

      public final ApiKeyType type()
      Required - The type of the API key (e.g. rest or cross_cluster).

      API name: type

    • creation

      public final long creation()
      Required - Creation time for the API key in milliseconds.

      API name: creation

    • expiration

      @Nullable public final Long expiration()
      Expiration time for the API key in milliseconds.

      API name: expiration

    • invalidated

      public final boolean invalidated()
      Required - Invalidation status for the API key. If the key has been invalidated, it has a value of true. Otherwise, it is false.

      API name: invalidated

    • invalidation

      @Nullable public final Long invalidation()
      If the key has been invalidated, invalidation time in milliseconds.

      API name: invalidation

    • username

      public final String username()
      Required - Principal for which this API key was created

      API name: username

    • realm

      public final String realm()
      Required - Realm name of the principal for which this API key was created.

      API name: realm

    • realmType

      @Nullable public final String realmType()
      Realm type of the principal for which this API key was created

      API name: realm_type

    • metadata

      public final Map<String,JsonData> metadata()
      Required - Metadata of the API key

      API name: metadata

    • roleDescriptors

      public final Map<String,RoleDescriptor> roleDescriptors()
      The role descriptors assigned to this API key when it was created or last updated. An empty role descriptor means the API key inherits the owner user’s permissions.

      API name: role_descriptors

    • limitedBy

      public final List<Map<String,RoleDescriptor>> limitedBy()
      The owner user’s permissions associated with the API key. It is a point-in-time snapshot captured at creation and subsequent updates. An API key’s effective permissions are an intersection of its assigned privileges and the owner user’s permissions.

      API name: limited_by

    • access

      @Nullable public final Access access()
      The access granted to cross-cluster API keys. The access is composed of permissions for cross cluster search and cross cluster replication. At least one of them must be specified. When specified, the new access assignment fully replaces the previously assigned access.

      API name: access

    • profileUid

      @Nullable public final String profileUid()
      The profile uid for the API key owner principal, if requested and if it exists

      API name: profile_uid

    • sort

      public final List<FieldValue> sort()
      Sorting values when using the sort parameter with the security.query_api_keys API.

      API name: _sort

    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setupApiKeyDeserializer

      protected static void setupApiKeyDeserializer(ObjectDeserializer<ApiKey.Builder> op)