获取有关OpenStack租户中的内容的信息

openstackinfo的Python项目详细描述


Build Statuscodecov

OpenStack信息

获取有关openstack租户中的内容的信息。

安装

先决条件:-python>;=3.6

该工具可以从pypi安装:

pip install openstackinfo

出血边缘版本可以直接从github安装:

git clone https://github.com/wtsi-hgi/openstack-info.git
cd openstack-tenant-cleaner
python setup.py install

或者使用pip:

pip install git+https://github.com/wtsi-hgi/openstack-info.git@master#egg=openstackinfo

使用量

cli

设置环境变量:

exportOS_USERNAME=user
exportOS_TENANT_NAME=tenant
exportOS_AUTH_URL=http://example.com:5000/v2.0/
exportOS_PASSWORD=password

然后拨打电话:

openstackinfo

可用的选项可以使用openstackinfo -h

usage: openstackinfo [-h] [-i {type,id}] [--max-connections MAX_CONNECTIONS]
                     [--retries RETRIES] [--retry-wait RETRY_WAIT]
                     [--retry-wait-multiplier RETRY_WAIT_MULTIPLIER]

Openstack tenant information retriever

optional arguments:
  -h, --help            show this help message and exit
  -i {type,id}, --index {type,id}
                        What the OpenStack information should be index by
                        (default: type)
  --max-connections MAX_CONNECTIONS
                        Maximum number of simultaneous connections to make to
                        OpenStack. Configured automatically if not set
                        (default: None)
  --retries RETRIES     Number of times to retry getting information about a
                        particular tpye of OpenStack resource (default: 3)
  --retry-wait RETRY_WAIT
                        Initial amount of time (in seconds) to wait after a
                        failure before retrying (default: 1.0)
  --retry-wait-multiplier RETRY_WAIT_MULTIPLIER
                        Multiplier that is applied to the wait time after each
                        failure. e.g. An initial wait time of 1.0s, a wait
                        multiplier of 5.0, and a maximum of 3 retries will
                        result in the waits between retries of [1.0s, 5.0s,
                        25.0s] (default: 5.0)
  --retry-wait-deviation RETRY_WAIT_DEVIATION
                        To minimise collisions, the wait time before retrying
                        a request is randomised to plus or minus the value of
                        this parameter as a percentage of the total wait time.
                        e.g. A wait time of 1.0s and max deviation percentage
                        of 10.0 will result in an actual wait between 0.9s and
                        1.1s (default: 10.0)

Python

fromopenstackinfo.retriever.modelsimportCredentialsfromopenstackinfo.retriever.retrieversimportShadeInformationRetrieverfromopenstackinfo.helpersimportget_information,RunConfigurationfromopenstackinfo.indexersimportInformationIndexerByTyperetriever=ShadeInformationRetriever(credentials=Credentials(username,password,auth_url,tenant))configuration=RunConfiguration(retriever=retriever,indexer=InformationIndexerByType)openstack_info=get_information(configuration)

替代方案

  • shade(基础库: 没有CLI,没有重新索引)。
  • Nova CLI (不返回json)。
  • Openstack CLI (不返回服务器元数据)。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Jackson json双向对象引用   java从isValid()方法调用进一步的验证器?   通过黑名单进行正则表达式Java字符串验证   JavaSpring集成转发原始消息并在处理后回复   jacocomavenplugin中的java是准备目标是必要的吗?   java实际上是在移动鼠标   java使用gradle创建可执行jar   java ComparisonFailure看不到物理差异   java如何:在重新绘制之前清除JPanel,然后运行另一个类并移动对象   java银行帐户不工作   Java命令行cmd用户输入UI   java引用外部静态连接方法中的变量   avr在java中获取AVRDUDE flash进程状态   带参数的Groovy模拟Java类   类型会话中的java setConfig(属性)不适用于参数(字符串、字符串)”