用于Indigo PaaS Orchestrator的Python库和CLI。

orp的Python项目详细描述


orpy

用于Indigo PaaS Orchestrator的Python库和CLI。

安装。

您可以直接从pypi安装它

pip install orpy

用作cli

在Orpy中使用Orchestrator之前,需要导出IAM访问权限 代币。只要访问令牌有效,orchent就可以告诉编排器 怎么办。

export ORCHESTRATOR_TOKEN=<your access token here>
usage: orpy [--version] [-v | -q] [--log-file LOG_FILE] [-h] [--debug]
            [--url <orchestrator-url>]

Command line client for the INDIGO PaaS Orchestrator.

    Please, before using this command put your a valid OpenID Connnect access
    token into the ORCHESTRATOR_TOKEN environment variable, so that we can use
    this token for authentication.


optional arguments:
  --version             show program's version number and exit
  -v, --verbose         Increase verbosity of output. Can be repeated.
  -q, --quiet           Suppress output except warnings and errors.
  --log-file LOG_FILE   Specify a file to log output. Disabled by default.
  -h, --help            Show help message and exit.
  --debug               Show tracebacks on errors.
  --url <orchestrator-url>
                        The base url of the orchestrator rest interface.
                        Alternative the environment variable ORCHESTRATOR_URL
                        can be used.

Commands:
  complete       print bash completion command (cliff)
  dep create     Create a deployment.
  dep delete     Show details about an existing deployment.
  dep list       List existing deployments at orchestrator.
  dep show       Show details about an existing deployment.
  dep template   Get template used for a given deployment.
  dep update     Update an existing deployment.
  deployment create  Create a deployment.
  deployment delete  Show details about an existing deployment.
  deployment list  List existing deployments at orchestrator.
  deployment show  Show details about an existing deployment.
  deployment template  Get template used for a given deployment.
  deployment update  Update an existing deployment.
  help           print detailed help for another command (cliff)
  resources list  List Resources for a given deployment.
  resources show  Show details about a resource for a given deployment.
  test           Test if the given URL is pointing to an orchestrator.

作为API使用

除了作为cli应用程序之外,orpy还可以用作库:

>>> from orpy.client import client
>>> orpy = client.OrpyClient(
...     url=ORCHESTRATOR_URL,
...     token=ORCHESTRATOR_TOKEN)
>>> deployments = orpy.deployments.list()
>>> deployments[0]
<Deployment cloudProviderName=provider-BARI, createdBy={u'subject': u'de28e179-ec86-4915-a748-7a37f8d80311', u'issuer': u'https://iam.deep-hybrid-datacloud.eu/'}, creationTime=2019-05-27T11:31+0000, links=[{u'href': u'https://paas.cloud.cnaf.infn.it/orchestrator/deployments/11e98073-06f3-6797-9258-0242ac140005', u'rel': u'self'}, {u'href': u'https://paas.cloud.cnaf.infn.it/orchestrator/deployments/11e98073-06f3-6797-9258-0242ac140005/resources', u'rel': u'resources'}, {u'href': u'https://paas.cloud.cnaf.infn.it/orchestrator/deployments/11e98073-06f3-6797-9258-0242ac140005/template', u'rel': u'template'}], outputs={}, physicalId=11e98073-06f3-6797-9258-0242ac140005, status=CREATE_FAILED, statusReason=Error while checking the deployment status; nested exception is feign.RetryableException: mesos.ui.sav.sk executing GET https://mesos.ui.sav.sk/marathon/v2/groups/11e98073-06f3-6797-9258-0242ac140005, task=NONE, updateTime=2019-05-29T02:05+0000, uuid=11e98073-06f3-6797-9258-0242ac140005>
>>> deployments[0].status
CREATE_FAILED
>>>

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

推荐PyPI第三方库


热门话题
java Thumbnailator库将图像转换为cmyk   Java反射从目录中的类运行测试   JavaEclipseJDT编译器说方法未定义,但EclipseIDE没有   重构如何重构一行重复的java代码   java Eclipse:使用删除线文本呈现自定义注释   java问题与ArrayList复制数据   java如何在swagger中传递访问令牌?   使用另一个java文件运行java文件时出错   java为什么谷歌云存储生成的上传链接在成功上传后不会失效?   java将我的客户端PC重定向到默认登录页面   java hibernate c3p0配置mysql问题   java和java之间的区别。尼奥。文件文件和java。伊奥。文件   列出java循环并向映射中添加值   java为什么OJ报告这段代码的运行时错误?