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": []}'import requests
response = requests.put( "https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/{Instance_id}/init-script/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "init_scripts_to_add": [ 120, ], "init_scripts_to_remove": [], },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/{Instance_id}/init-script/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "PUT", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "init_scripts_to_add": [ 120 ], "init_scripts_to_remove": [] }),});console.log(await response.json());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.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Instance_id
required
integer
Instance ID
Query Parameters
Section titled “Query Parameters”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
Location
Request Bodyrequired
Section titled “Request Bodyrequired”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
[]Responses
Section titled “Responses”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": {}}