Palbase Machines · API
/machines/{name}/test-users/{user}/templates/{template}Write a template for a test user
Has the machine's program write a template for a test user this machine made with one (POST /machines/{name}/test-users) — answered from what was kept when it wrote that template for that user before, the machine not asked again (again: true). That answer says the commit whose program wrote it (commit), the commit the machine serves now (serving_commit), and when they differ what that means (note): a template is written once for a user, a new test user has the serving code's data. 409 build_in_progress, nothing written, while the machine's newest build is on its way and the template was not written before. 429 quota_exceeded when the project's machines are not run now and the template was not written before. 404 when the user is no test user this machine made with a template: a test user is the machine's that made it, another machine of the project neither writes for it nor deletes it.
Called by your server, with the project's secret key.
Path
namestring · requiredThe machine's name: lowercase letters, digits and dashes, starting with a letter and not ending with a dash, 32 at most.userstring · requiredThe test user's id, as the users made with a template were answered.templatestring · requiredThe template's name, as the machine's program names it (@TestUserTemplate): lowercase letters, digits, _ and -, starting with a letter, 64 at most.curl -X POST "https://<your-ref>.palbase.studio/machines/<name>/test-users/<user>/templates/<template>" \
-H "apikey: $PALBASE_SECRET_KEY"Responses
200What became of the template
400Validation failed or a required field is missing
401Missing or invalid API key
403Not the project's secret key
404The project has no machine of this name
409build_in_progress: the machine's newest build is on its way and no test user was made, nor a template written — build names it (its id, commit and state; requested while a build of the head is asked for), retry_after when to ask again; or test_users_refused: auth makes no more test users for the project
429Over the project's request limit, or its machine time for this period is used up
503Temporarily unavailable; retrying is safe after Retry-After
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation TemplateTestUser of machines's contract.