Using this as input: -
I started by using a REST client within Chrome ( called Restlet ): -
with this JSON as input: -
{
"rule":"Node.js Server Rule",
"hosts":["wlpn.uk.ibm.com"],
"variables": [
{ "name":"applicationPackage","value":"helloworld-1.0.0.tgz" },
{ "name":"serverName", "value":"Server1" },
{ "name":"clusterName", "value":"Cluster1" },
{ "name":"keystorePassword", "value":"passw0rd" },
{ "name":"applicationDir", "value":"/home/wasadmin/" }
]
}
"rule":"Node.js Server Rule",
"hosts":["wlpn.uk.ibm.com"],
"variables": [
{ "name":"applicationPackage","value":"helloworld-1.0.0.tgz" },
{ "name":"serverName", "value":"Server1" },
{ "name":"clusterName", "value":"Cluster1" },
{ "name":"keystorePassword", "value":"passw0rd" },
{ "name":"applicationDir", "value":"/home/wasadmin/" }
]
}
to deploy a Node.JS server via this URL ( POST ): -
I went one step further and used this JSON: -
to undeploy the same.
I then translated that into command-line commands (!) using Curl: -
curl -d "@deploy.json" -H "Content-Type: application/json" -X POST https://wlpc.uk.ibm.com:9443/ibm/api/collective/v1/deployment/deploy --insecure -i -u wasadmin:passw0rd
and: -
curl -d "@undeploy.json" -H "Content-Type: application/json" -X POST https://wlpc.uk.ibm.com:9443/ibm/api/collective/v1/deployment/undeploy --insecure -i -u wasadmin:passw0rd
deploy.json
{
"rule":"Node.js Server Rule",
"hosts":["wlpn.uk.ibm.com"],
"variables": [
{ "name":"applicationPackage","value":"helloworld-1.0.0.tgz" },
{ "name":"serverName", "value":"Server1" },
{ "name":"clusterName", "value":"Cluster1" },
{ "name":"keystorePassword", "value":"passw0rd" },
{ "name":"applicationDir", "value":"/home/wasadmin/" }
]
}
undeploy.json
Next I need to do the same to start and stop my servers …..
No comments:
Post a Comment