@@ -14,7 +14,7 @@ def __init__(self, headers, api_url):
1414
1515 def create (self , hostname : str , size : str , template_id : str , reverse_dns : str = None , region : str = None ,
1616 public_ip : str = 'create' , move_ip_from : str = None , count : int = 1 , network_id : str = None ,
17- snapshot_id : str = None , initial_user : str = None , ssh_key_id : str = None , tags : str = None ) -> dict :
17+ snapshot_id : str = None , initial_user : str = None , ssh_key_id : str = None , script : str = None , tags : str = None ) -> dict :
1818 # TODO: Pending check
1919 """
2020 Function to create instance
@@ -39,6 +39,9 @@ def create(self, hostname: str, size: str, template_id: str, reverse_dns: str =
3939 (optional; this will default to the template's default_username and fallback to "civo")
4040 :param ssh_key_id: the ID of an already uploaded SSH public key to use for login to the default user
4141 (optional; if one isn't provided a random password will be set and returned in the initial_password field)
42+ :param script: the contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your
43+ instance, read/write/executable only by root and then will be
44+ executed at the end of the cloud initialization
4245 :param tags: a space separated list of tags, to be used freely as required (optional)
4346 :return: objects json
4447 """
@@ -69,6 +72,9 @@ def create(self, hostname: str, size: str, template_id: str, reverse_dns: str =
6972 if ssh_key_id :
7073 payload ['ssh_key_id' ] = ssh_key_id
7174
75+ if script :
76+ payload ['script' ] = script
77+
7278 if initial_user :
7379 payload ['initial_user' ] = initial_user
7480
0 commit comments