Handling objects that might not have ETags

If the HCP system has been upgraded from a release earlier than 6.0, some objects that were stored in the namespace before the upgrade may not yet have ETags. In such cases, the HCP behavior depends on the request type and object size, as follows:

For a GET request for an object 512,000 bytes or smaller, HCP automatically calculates the ETag, returns it in the ETag header and uses it, if needed, for conditional processing.

For a GET request for an object larger than 512,000 bytes, by default, HCP does not calculate the ETag. In this case:

oThe response does not return an ETag header.

oIf the request has an If-Match or If-None-Match header, HCP returns a 400 error response with a message explaining the cause.

For a PUT request to copy an object, HCP handles the source object the same way it handles the object in a GET request. For source objects of 512,000 bytes or less, HCP calculates and saves the ETag and uses it to processes any X-HCP-CopySource-If-Match or X-HCP-CopySource-If-None-Match header. For larger source objects, using these headers results in a 400 error response.

For a PUT or HEAD request, including for the target of a PUT request to copy an object, HCP does not generate the ETag for an existing object. If a PUT or HEAD request has an If-Match or If-None-Match header and specifies an object that does not yet have an ETag, HCP returns a 400 error.

If you get an error because an object does not have an ETag, you can force HCP to calculate the missing ETag by including a forceEtag query parameter with a value of true in either of these requests:

A GET request. In this case, HCP processes any If-Match or If-None-Match header and includes an ETag header when it returns an object.

A PUT request to copy an object. In this case, HCP processes any X-HCP-CopySource-If-Match or X-HCP-CopySource-If-None-Match header and can copy the specified object if the condition is met.

Once HCP has generated an object ETag, you can use conditional headers in GET, PUT, and HEAD requests for the object.

© 2015, 2020 Hitachi Vantara LLC. All rights reserved.