为什么我可以通过仪表板导入功能而不是通过 Jelastic API 安装此 Jelastic 清单?

Why can I install this Jelastic manifest through the dashboard import function but not throuhg the Jelastic API?

我有以下非常简单的清单:

type: install
name: very simple manifest

onInstall:
  - log: installing manifest

我可以从 Jelastic Dashboard 安装它。主菜单中有一个导入功能,我可以在其中复制/粘贴清单内容并安装它。在 Jelastic 控制台中,我可以看到

[15:36:38 manifest.settings]: BEGIN INSTALLATION: very simple manifest
[15:36:39 manifest.settings]: BEGIN HANDLE EVENT: {"topic":"application/install","envAppid":""}
[15:36:39 manifest.settings:1]:> installing manifest
[15:36:39 manifest.settings]: END HANDLE EVENT: application/install
[15:36:39 manifest.settings]: END INSTALLATION: very simple manifest

并且 Jelastic 仪表板确认安装。

现在,当我做同样的事情时,但通过 Jelastic REST API,即使用端点

http://my-jelastic-provide.com/1.0/marketplace/jps/REST/install

有相关数据,然后,安装不上。相反,我收到了奇怪的错误消息

Can\'t find environment by domain [jelasticclient-master-0954606]

其中 jelasticclient-master-0954606 是我设置的 envName

但是,如果我将我的清单更改为例如

type: install
name: very simple manifest

nodes:
  count: 1
  cloudlets: 4
  nodeGroup: cp
  image: alpine:latest
skipNodeEmails: true

onInstall:
  - log: installing manifest

然后就可以完美安装了。我错过了什么?

我正在使用 Jelastic v6.0.2。

您的“非常简单的清单”不假定要传递任何环境名称。 这就是为什么当您传递它时会收到错误消息“无法按域 [domain-name] 找到环境”(示例 1)。

当你在清单中有“节点”参数时(如你的第二个例子),你不应该传递任何环境名称(Example2)或者应该传递现有的环境名称(响应在示例 3 中)。

示例 1:

curl -X POST 'https://jca.host-domain/1.0/marketplace/jps/rest/install' \
-d 'envName=jelasticclient-master-0954606' \
-d session=*** \    
-d skipNodeEmails=1 \
-d ownerUid=UID \
--data-urlencode 'jps={ "type": "install", "name": "very simple manifest", "onInstall": [ { "log": "installing manifest" } ] }'

响应是:

{"result":11,"response":{"result":11,"source":"JEL","error":"domain [jelasticclient-master-0954606] doesn't exist"},"source":"JEL","error":"domain [jelasticclient-master-0954606] doesn't exist"}

不传递环境名称时(Example2),

curl -X POST 'https://jca.host-domain/1.0/marketplace/jps/rest/install' \
-d session=*** \    
-d skipNodeEmails=1 \
-d ownerUid=UID \
--data-urlencode 'jps={ "type": "install", "name": "very simple manifest", "onInstall": [ { "log": "installing manifest" } ] }'

响应是

{"result":0,"uniqueName":"3c819586-2ef7-4691-9faa-d3059459d20e","response":{"result":0,"uniqueName":"3c819586-2ef7-4691-9faa-d3059459d20e","successText":"","appid":""},"appid":"","successText":""}

当envName=jelasticclient-master-0954606的环境已经存在时,Example1同一个请求的响应如下(Example3)

{"result":0,"uniqueName":"b52a8db9-8850-4b66-958a-3dee3345b923","response":{"result":0,"uniqueName":"b52a8db9-8850-4b66-958a-3dee3345b923","successText":"","appid":"7b0c465f6c9573b8d8ce3ed59591781b"},"appid":"7b0c465f6c9573b8d8ce3ed59591781b","successText":""}

换句话说,如果你在部署这个“非常简单的清单”时传递了环境名称,这个清单就像一个附加组件一样安装,因为它没有“nodes”参数但是没有现有的环境“jelasticclient” -master-0954606”安装这个“附加组件”。