eBay / YiDB

Apache License 2.0
42 stars 32 forks source link

Can't update metadata #1

Closed sergiiF closed 9 years ago

sergiiF commented 9 years ago

While trying to update metadata I got 500 response. http://pastebin.com/k9kPuYdS Is it possible to update metadata not just field by field?

Also Is it possible to delete metadata/repo? It throw 500 error with 'Not supported' when I try to delete metadata, and just ignore (returns 200 but repo is not deleted) when try to delete repo

zhihzhang commented 9 years ago

Hi, sergiiF

Thank you for your input! Update metadata api only support add metafield to metadata, not supporting changing existing metafield. If you want to change multiple fields, I suggest you to delete and recreate the metadata.

For now we support delete metadata api, not support delete repo api. You could give the api detail so I can take a look why it's throwing 500 error.

Thanks & Regards Al Zhang

sergiiF commented 9 years ago

I was slightly wrong. Delete returns 400 error, with a reason message only in stack trace. Looks that I need to enable metaclass deletion. Will try to figure out how to do this. (.venv)sergii$ curl -X delete http://10.119.160.164:9090/cms/repositories/Assets/metadata/Server {"status":{"code":"400","msg":"exception while delete metaclass","stackTrace":"com.ebay.cloud.cms.sysmgmt.exception.NotSupportOperationException: Delete metadata not enabled!\n\tat com

zhihzhang commented 9 years ago

By default, delete metadata is not allowed. To do this, you need to add a config item in config {"MetadataDelete":true}

you can check config info under page /cms/config Use post to add a allow MetadataDelete item. Thanks.

sergiiF commented 9 years ago

Thanks, it was helpful.