Skip to content

Attach Startup Scripts to Instance / VM

PUT
/notebooks/{Instance_id}/init-script/
curl --request PUT \
--url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/{Instance_id}/init-script/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"init_scripts_to_add": [
120
],
"init_scripts_to_remove": []
}'

Attaches startup scripts to an Instance or Virtual Machine, detaches them, or both in one request. The scripts run on every boot, in the alphabetical order of their file names, initialize-<script ID>.sh. IDs of scripts from another project are ignored.

Instance_id
required
integer

Instance ID

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
init_scripts_to_add

IDs of the startup scripts to attach.

Array<integer>

Example

[
120
]
init_scripts_to_remove

IDs of the startup scripts to detach.

Array<integer>

Example

[]

Start script updated 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": 200,
"message": "Success",
"data": {
"id": 177,
"name": "Instance-fds-25111112519",
"init_script": "# !/bin/bash\nsudo apt updafste -y\nfasdfasdf\n",
"created_by": {
"id": 12477,
"name": "Raj Singh",
"email": "test@gmail.com",
"username": "test@gmail.com"
}
},
"errors": {}
}