Skip to content

Commit 83b6cd3

Browse files
authored
Merge pull request #25 from civo/dev
Merge dev to master
2 parents 28808d0 + f2ad3c6 commit 83b6cd3

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

civo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .civo import Civo
22

3-
__version__ = '1.0.3'
3+
__version__ = '1.0.4'
44
__author__ = 'Alejandro JNM <alejandrojnm@gmail.com>'
55
__all__ = []

civo/intances.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def read(filename):
1515

1616
setup(
1717
name="civo",
18-
version="1.0.3",
18+
version="1.0.4",
1919
url="https://github.com/civo/client-python",
2020
license='MIT License',
2121
author="Alejandro JNM",

0 commit comments

Comments
 (0)