我想使用REST API Openshift创建应用程序我使用smarterclayton cartridge执行此curl命令:
curl -k -X POST https://openshift.redhat.com/broker/rest/domains/jhaopenshift/applications
--user "user@gmail.com:passwd"
--data "name=myapp&cartridge=https://github.com/smarterclayton/openshift-cdk-cart/blob/master/metadata/manifest.yml&scale=false"
但我仍然有无效的墨盒错误:
{
"api_version":1.6,
"data":null,
"messages":[{"exit_code":109,
"field":"cartridge",
"index":null,
"severity":"error",
"text":"Invalid cartridge 'https://github.com/smarterclayton/openshift-cdk-cart/blob/master/metadata/manifest.yml' specified."}],
"status":"unprocessable_entity",
"supported_api_versions":[1.0,1.1,1.2,1.3,1.4,1.5,1.6],
"type":null,"version":"1.6"
}
和-H'接受:application / xml'选项我明白了:
curl: (6) Could not resolve host: Accept
curl: (6) Could not resolve host: POST
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
root@localhost and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.15 (Red Hat) Server at openshift.redhat.com Port 80</address>
</body></html>
如何修复此错误的任何想法?
答案 0 :(得分:1)
这应该有效:
curl -k -X POST https://openshift.redhat.com/broker/rest/domains/jhaopenshift/applications --user "user:pass" --data "name=myapp&cartridge[url]=https://cartreflect-claytondev.rhcloud.com/reflect?github=smarterclayton/openshift-cdk-cart&scale=false"
你需要在cartridge参数之后提供[url],你还需要指向包含Source-Url元素的manifest.yml文件,或者使用盒式反射器指向部分github url格式为user / repo