Skip to content

Create Start Script

POST
/notebooks/init-script/
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"
}'

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.

project_id
required
integer

Project ID

active_iam
integer

Active IAM ID (To access contact person account) Find your Active IAM ID here

location
required
string
Allowed values: Delhi Chennai

Location

Media typeapplication/json
object
name

The name of the start script

string
init_script

The start script content

string

Example generated

{
"name": "example",
"init_script": "example"
}

Start script created successfully

Media typeapplication/json
object
code
integer
message
string
data
object
id
integer
name
string
init_script
string
created_by
object
id
integer
name
string
email
string
username
string
errors
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": {}
}