我是Cloud Foundry的新手。我想在Cloud Foundry中使用Python自动化应用程序部署和服务绑定。使用python自动化CloudFoundry部署
对于部署在Cloud Foundry中我们将使用命令(Cloud Foundry的CLI)喜欢的应用程序:
cf push redis-sample-app
cf create-service redis shared-vm service-example-redis
cf bind-service redis-sample-app service-example-redis
cf restage redis-sample-app
现在我不想使用CLI为此,我只想写一个Python/Ruby /(任何语言)脚本,它将完成所有的事情。
我已经试过谷歌,并最终与Python cloudfoundry
模块,但它不清楚继续下去。我的任务是否有任何API,如访问EC2的boto
。我曾尝试下面的代码在Python:
from cloudfoundrty import CloudFoundryInterface
cf=CloudFoundryInterface(target="api.end.point",username="myusername",password="mypwd")
cf.login()
它显示错误:
`File "C:\Python27\lib\site-packages\requests\models.py", line 398, in full_url
raise MissingSchema("Invalid URL %r: No schema supplied" % url)
MissingSchema: Invalid URL u'users/kishorekumarnetala%40gmail.com/tokens': No schema supplied`
其实我的终点是https://开头的API。 run.pivotal.io和我只在我的Python脚本中使用该链接,但它显示相同的错误。 我听说首先我们必须拿认证令牌,我不知道如何让令牌访问。我只有选择使用Python,这是我的实际任务 – kishore
'api.run.pivotal.io'仍然缺少一个方案。你需要添加'https'。 –
在上面的评论中成为链接,我只在我的代码中使用https。但结果是一样的,实际上这就是API端点。 – kishore