IBM / ibm-cos-sdk-js

ibm-cos-sdk-js
Apache License 2.0
38 stars 19 forks source link

deleteObject response data #12

Closed JPMardelli closed 6 years ago

JPMardelli commented 6 years ago

On calling deleteObject, the response data I'm getting back is an empty object, instead of:

{
  DeleteMarker //Boolean
  VersionID //String 
}

Specified in https://ibm.github.io/ibm-cos-sdk-js/AWS/S3.html#deleteObject-property

JPMardelli commented 6 years ago

Bucket Name: certificate-management-dev File Name: 1234567UnitTest.png Service Endpoint: s3-api.dal-us-geo.objectstorage.softlayer.net Auth Endpoint: https://iam.ng.bluemix.net/oidc/token Timeframe: Frequently, as they are unit tests

widget- commented 6 years ago

Unlike Amazon, our object deletes are immediately consistent which means we have no need for a DeleteMarker. If a delete were to fail, COS will immediately return an error rather than delaying it for later. A 2xx response code would mean success (204 No Content here I believe.)

This does look like a documentation discrepancy though.

JPMardelli commented 6 years ago

Interesting. As a followup, should an attempt to delete an object that doesn't exist resolve successfully? I thought that since it was resolving it should get DeleteMarker: false, but if that doesn't exist I'm wondering what the functionality should be.

wbhuberIBM commented 6 years ago

@JPMardelli are you running the env in vault or container mode?

JPMardelli commented 6 years ago

The buckets are set to standard instead of vault, not sure if that's what you're asking though.

wbhuberIBM commented 6 years ago

@JPMardelli the cloud does not currently support Bucket and Object Versioning.

Info on DeleteMarker & VersionId: http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html

JPMardelli commented 6 years ago

So you only get that response if you're deleting a version and a delete marker. Got it, was a little confusing. And deleting an object that doesn't exist will just resolve successfully.

wbhuberIBM commented 6 years ago

We made update to clarify this in a docstring.