Skip to content

Instantly share code, notes, and snippets.

@rhopp
Created February 8, 2019 12:37
Show Gist options
  • Save rhopp/2c3851f53f55714337367f650b546082 to your computer and use it in GitHub Desktop.
Save rhopp/2c3851f53f55714337367f650b546082 to your computer and use it in GitHub Desktop.
#!/bin/bash
ACTIVE_TOKEN=<REPLACE WITH ACTUAL ACTIVE TOKEN>
for i in `seq 1 70`;
do
JSON=$(cat default.json | jq ".name=\"test$i\"")
echo $JSON | jq .name
curl -w "%{time_total}" -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ACTIVE_TOKEN" --data "$JSON" "<REPLACE WITH ACTUAL CHE SERVER URL>/api/workspace"
done
{
"environments":{
"replaced_name":{
"machines":{
"dev-machine":{
"installers":[
"org.eclipse.che.terminal",
"org.eclipse.che.ws-agent",
"org.eclipse.che.exec",
"org.eclipse.che.ls.java"
],
"attributes": {
"memoryLimitBytes": "2048"
},
"servers":{
"tomcat8-debug":{
"protocol":"http",
"port":"8000"
},
"codeserver":{
"protocol":"http",
"port":"9876"
},
"tomcat8":{
"protocol":"http",
"port":"8080"
}
}
}
},
"recipe":{
"content":"eclipse/ubuntu_jdk8",
"type":"dockerimage"
}
}
},
"defaultEnv": "replaced_name",
"projects": [],
"name": "replaced_name",
"attributes": {},
"temporary": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment