curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/init-script/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "name": "string", "init_script": "string"}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/init-script/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "name": "string", "init_script": "string", },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/init-script/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "string", "init_script": "string" }),});console.log(await response.json());Creates a new startup script. Once attached to a VM, it runs as root with bash on every boot, not only the first. The scripts of a VM run one after another in the alphabetical order of their file names, which are initialize-<script ID>.sh and not the names you gave them. A script that fails does not stop the ones after it, and a script can still be running after the VM shows Running. The scripts sit in /opt/e2e/startup-scripts in the VM, read-only. The name is 3 to 50 characters of letters, digits, hyphens and underscores, starts with a letter, ends with a letter or digit, and is unique in the project. All the scripts of one VM together cannot exceed about 1 MiB.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Project ID
Active IAM ID (To access contact person account) Find your Active IAM ID here
Location
Request Bodyrequired
Section titled “Request Bodyrequired”object
The name of the start script
The start script content
Example generated
{ "name": "example", "init_script": "example"}Responses
Section titled “Responses”Start script created successfully
object
object
object
object
Example
{ "code": 201, "message": "Created Successfully", "data": { "id": 177, "name": "test-script-1", "init_script": "# !/bin/bash\nsudo apt update -y\n", "created_by": { "id": 12477, "name": "Raj Singh", "email": "test@gmail.com", "username": "test@gmail.com" } }, "errors": {}}