Package org.opensearch.client
Class GetAliasesResponse
- java.lang.Object
-
- org.opensearch.client.GetAliasesResponse
-
- All Implemented Interfaces:
org.opensearch.common.xcontent.StatusToXContentObject,org.opensearch.common.xcontent.ToXContent,org.opensearch.common.xcontent.ToXContentObject
public class GetAliasesResponse extends java.lang.Object implements org.opensearch.common.xcontent.StatusToXContentObjectResponse obtained from the get aliases API. The format is pretty horrible as it holds aliases, but at the same time errors can come back through the status and error fields. Such errors are mostly 404 - NOT FOUND for aliases that were specified but not found. In such case the client won't throw exception so it allows to retrieve the returned aliases, while at the same time checking if errors were returned. There's also the case where an exception is returned, like for instance anIndexNotFoundException. We would usually throw such exception, but we configure the client to not throw for 404 to support the case above, hence we also not throw in case an index is not found, although it is a hard error that doesn't come back with aliases.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GetAliasesResponsefromXContent(org.opensearch.common.xcontent.XContentParser parser)Parse the get aliases responsejava.util.Map<java.lang.String,java.util.Set<org.opensearch.cluster.metadata.AliasMetadata>>getAliases()Return the requested aliasesjava.lang.StringgetError()Return the possibly returned error, null otherwiseorg.opensearch.OpenSearchExceptiongetException()Return the exception that may have been returnedorg.opensearch.rest.RestStatusstatus()org.opensearch.common.xcontent.XContentBuildertoXContent(org.opensearch.common.xcontent.XContentBuilder builder, org.opensearch.common.xcontent.ToXContent.Params params)
-
-
-
Method Detail
-
status
public org.opensearch.rest.RestStatus status()
- Specified by:
statusin interfaceorg.opensearch.common.xcontent.StatusToXContentObject
-
getError
public java.lang.String getError()
Return the possibly returned error, null otherwise
-
getException
public org.opensearch.OpenSearchException getException()
Return the exception that may have been returned
-
getAliases
public java.util.Map<java.lang.String,java.util.Set<org.opensearch.cluster.metadata.AliasMetadata>> getAliases()
Return the requested aliases
-
toXContent
public org.opensearch.common.xcontent.XContentBuilder toXContent(org.opensearch.common.xcontent.XContentBuilder builder, org.opensearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContentin interfaceorg.opensearch.common.xcontent.ToXContent- Throws:
java.io.IOException
-
fromXContent
public static GetAliasesResponse fromXContent(org.opensearch.common.xcontent.XContentParser parser) throws java.io.IOException
Parse the get aliases response- Throws:
java.io.IOException
-
-