Trouble Retrieving Metadata Information from OpenStack Swift Object using REST APIs: Need Help Adding Metadata from Horizon UI or REST API properly

57 views Asked by At

I am new to OpenStack Swift and I am trying to add single/multiple metadata to an object using REST APIs. However, although I receive a 202 success response for the request, when I try to retrieve the metadata information using a HEAD request, it returns a 200 success but without the metadata information.

My questions are:

Can metadata be added from the Horizon web UI dashboard? If yes, what are the steps to do that?

Are there any configuration changes required to work with metadata?

Adding metadata to an object using REST API

Trying to retrieve metadata using REST API

Just to add some more information I attached swift capabilities command output

[root@controller ~]# swift -V 3 capabilities                                                                                                                                                                       Core: swift                                                                                                                                                                                                         Options:                                                                                                                                                                                                            account_autocreate: True                                                                                                                                                                                           account_listing_limit: 10000                                                                                                                                                                                       allow_account_management: True                                                                                                                                                                                     container_listing_limit: 10000                                                                                                                                                                                     extra_header_count: 0                                                                                                                                                                                              max_account_name_length: 256                                                                                                                                                                                       max_container_name_length: 256                                                                                                                                                                                     max_file_size: 5368709122                                                                                                                                                                                          max_header_size: 8192                                                                                                                                                                                              max_meta_count: 90                                                                                                                                                                                                 max_meta_name_length: 128                                                                                                                                                                                          max_meta_overall_size: 4096                                                                                                                                                                                        max_meta_value_length: 256                                                                                                                                                                                         max_object_name_length: 1024                                                                                                                                                                                       policies: [{u'default': True, u'name': u'Policy-0', u'aliases': u'Policy-0'}]                                                                                                                                      strict_cors_mode: True                                                                                                                                                                                             version: 2.17.1                                                                                                                                                                                                  Additional middleware: account_quotas                                                                                                                                                                              Additional middleware: bulk_delete                                                                                                                                                                                  Options:                                                                                                                                                                                                            max_deletes_per_request: 10000                                                                                                                                                                                     max_failed_deletes: 1000                                                                                                                                                                                         Additional middleware: bulk_upload                                                                                                                                                                                  Options:                                                                                                                                                                                                            max_containers_per_extraction: 10000                                                                                                                                                                               max_failed_extractions: 1000                                                                                                                                                                                     Additional middleware: container_quotas                                                                                                                                                                            Additional middleware: crossdomain                                                                                                                                                                                 Additional middleware: formpost                                                                                                                                                                                    Additional middleware: ratelimit                                                                                                                                                                                    Options:                                                                                                                                                                                                            account_ratelimit: 0.0                                                                                                                                                                                             container_listing_ratelimits: []                                                                                                                                                                                   container_ratelimits: []                                                                                                                                                                                           max_sleep_time_seconds: 60.0                                                                                                                                                                                     Additional middleware: slo                                                                                                                                                                                          Options:                                                                                                                                                                                                            max_manifest_segments: 1000                                                                                                                                                                                        max_manifest_size: 2097152                                                                                                                                                                                         min_segment_size: 1                                                                                                                                                                                                yield_frequency: 10                                                                                                                                                                                              Additional middleware: staticweb                                                                                                                                                                                   Additional middleware: tempurl                                                                                                                                                                                      Options:                                                                                                                                                                                                            allowed_digests: [u'sha1', u'sha256', u'sha512']                                                                                                                                                                   incoming_allow_headers: []                                                                                                                                                                                         incoming_remove_headers: [u'x-timestamp']                                                                                                                                                                          methods: [u'GET', u'HEAD', u'PUT', u'POST', u'DELETE']                                                                                                                                                             outgoing_allow_headers: [u'x-object-meta-public-*']                                                                                                                                                                outgoing_remove_headers: [u'x-object-meta-*'] 

I need a help in adding and retrieving metadata to an object using both horizon UI and REST API way.

1

There are 1 answers

0
Surya Kumar Kumaravelan On

I made a mistake here. If you want to create a metadata for an object then you have to follow the key naming convention below

X-Object-Meta-:

instead in wrongly used X-Container-Meta-: