简体   繁体   English

使用pyrax设置Rackspace CloudServer元数据

[英]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. 我正在考虑将Rackspace用于我们的服务器托管,并且我需要能够通过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. 我在这里看到了其他线程,该线程当前未在API中返回,但是我们可以检查服务器的元数据以实现相同的目标。

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? 但是问题是,Pyrax似乎没有选项来设置已经存在的云服务器的元数据,我是否错过了某些内容,或者有人可以向我指出正确的方向?

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. 请注意set_meta调用,因为set_meta会覆盖所有元数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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