Class CreateApiKeyRequest.Builder
- All Implemented Interfaces:
WithJson<CreateApiKeyRequest.Builder>,ObjectBuilder<CreateApiKeyRequest>
- Enclosing class:
- CreateApiKeyRequest
CreateApiKeyRequest.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aCreateApiKeyRequest.expiration(Time value) The expiration time for the API key.The expiration time for the API key.Arbitrary metadata that you want to associate with the API key.Arbitrary metadata that you want to associate with the API key.A name for the API key.Iftrue(the default) then refresh the affected shards to make this operation visible to search, ifwait_forthen wait for a refresh to make this operation visible to search, iffalsethen do nothing with refreshes.roleDescriptors(String key, RoleDescriptor value) An array of role descriptors for this API key.An array of role descriptors for this API key.An array of role descriptors for this API key.protected CreateApiKeyRequest.Builderself()Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJsonMethods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
expiration
The expiration time for the API key. By default, API keys never expire.API name:
expiration -
expiration
The expiration time for the API key. By default, API keys never expire.API name:
expiration -
metadata
Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning with_are reserved for system usage.API name:
metadataAdds all entries of
maptometadata. -
metadata
Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning with_are reserved for system usage.API name:
metadataAdds an entry to
metadata. -
name
A name for the API key.API name:
name -
refresh
Iftrue(the default) then refresh the affected shards to make this operation visible to search, ifwait_forthen wait for a refresh to make this operation visible to search, iffalsethen do nothing with refreshes.API name:
refresh -
roleDescriptors
An array of role descriptors for this API key. When it is not specified or it is an empty array, the API key will have a point in time snapshot of permissions of the authenticated user. If you supply role descriptors, the resultant permissions are an intersection of API keys permissions and the authenticated user's permissions thereby limiting the access scope for API keys. The structure of role descriptor is the same as the request for the create role API. For more details, refer to the create or update roles API.NOTE: Due to the way in which this permission intersection is calculated, it is not possible to create an API key that is a child of another API key, unless the derived key is created without any privileges. In this case, you must explicitly specify a role descriptor with no privileges. The derived API key can be used for authentication; it will not have authority to call Elasticsearch APIs.
API name:
role_descriptorsAdds all entries of
maptoroleDescriptors. -
roleDescriptors
An array of role descriptors for this API key. When it is not specified or it is an empty array, the API key will have a point in time snapshot of permissions of the authenticated user. If you supply role descriptors, the resultant permissions are an intersection of API keys permissions and the authenticated user's permissions thereby limiting the access scope for API keys. The structure of role descriptor is the same as the request for the create role API. For more details, refer to the create or update roles API.NOTE: Due to the way in which this permission intersection is calculated, it is not possible to create an API key that is a child of another API key, unless the derived key is created without any privileges. In this case, you must explicitly specify a role descriptor with no privileges. The derived API key can be used for authentication; it will not have authority to call Elasticsearch APIs.
API name:
role_descriptorsAdds an entry to
roleDescriptors. -
roleDescriptors
public final CreateApiKeyRequest.Builder roleDescriptors(String key, Function<RoleDescriptor.Builder, ObjectBuilder<RoleDescriptor>> fn) An array of role descriptors for this API key. When it is not specified or it is an empty array, the API key will have a point in time snapshot of permissions of the authenticated user. If you supply role descriptors, the resultant permissions are an intersection of API keys permissions and the authenticated user's permissions thereby limiting the access scope for API keys. The structure of role descriptor is the same as the request for the create role API. For more details, refer to the create or update roles API.NOTE: Due to the way in which this permission intersection is calculated, it is not possible to create an API key that is a child of another API key, unless the derived key is created without any privileges. In this case, you must explicitly specify a role descriptor with no privileges. The derived API key can be used for authentication; it will not have authority to call Elasticsearch APIs.
API name:
role_descriptorsAdds an entry to
roleDescriptorsusing a builder lambda. -
self
- Specified by:
selfin classRequestBase.AbstractBuilder<CreateApiKeyRequest.Builder>
-
build
Builds aCreateApiKeyRequest.- Specified by:
buildin interfaceObjectBuilder<CreateApiKeyRequest>- Throws:
NullPointerException- if some of the required fields are null.
-