简体   繁体   中英

Set Rackspace CloudServer Metadata with pyrax

I'm looking at using Rackspace for our server hosting and I need to be able to gain a list of servers based on tag via the API. I've seen other threads on here that its currently not returned in the API, but we can inspect the metadata of a server in order to achieve the same goal.

The problem however is that pyrax doesn't seem to have an option to set the metadata of a cloudserver that already exists, have I missed something or could someone point me in the right direction?

See the following calls:

pyrax.cloudservers.servers.delete_meta(server, list_of_keys)
pyrax.cloudservers.servers.set_meta(server, key_value_dict)

Be careful of the set_meta call, as set_meta overwrites all metadata.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM