Example #1
0
import sys
# Asagidaki islem cloudeos.py ust dizinde oldugundan,
# buradan direkt olarak ice aktarabilmek icindir.
sys.path.append("..")

from cloudeos import API

cloudeos = API("username", "password")

name = "MySSHKey"
public_key = "public_key"  #direkt yazilabilir veya varsa dosyadan okutulabilir

ssh_key = cloudeos.create_sshKey(name, public_key)

print(ssh_key)
Example #2
0
import sys
# Asagidaki islem cloudeos.py ust dizinde oldugundan,
# buradan direkt olarak ice aktarabilmek icindir.
sys.path.append("..")

from cloudeos import API


cloudeos = API("username", "password")

balance = cloudeos.get_balance()

print(balance)
Example #3
0
import sys
# Asagidaki islem cloudeos.py ust dizinde oldugundan,
# buradan direkt olarak ice aktarabilmek icindir.
sys.path.append("..")

from cloudeos import API

cloudeos = API("username", "password")

account_detail = cloudeos.get_accountDetail()

print(account_detail)
Example #4
0
import sys
# Asagidaki islem cloudeos.py ust dizinde oldugundan,
# buradan direkt olarak ice aktarabilmek icindir.
sys.path.append("..")

from cloudeos import API

cloudeos = API("username", "password")

ssh_keys = cloudeos.get_sshkeys()

print(ssh_keys)
Example #5
0
import sys
# Asagidaki islem cloudeos.py ust dizinde oldugundan,
# buradan direkt olarak ice aktarabilmek icindir.
sys.path.append("..")

from cloudeos import API

# Api Token gerekmez
regions = API.get_regions()

for region in regions:
	if region["status"]: # Kullanimda olanlari listelemek icindir
		print("Name: {}\nCountry: {}\nslug: {}\n\n".format(
			region["name"], region["country"], region["slug"]
		))
Example #6
0
import sys
# Asagidaki islem cloudeos.py ust dizinde oldugundan,
# buradan direkt olarak ice aktarabilmek icindir.
sys.path.append("..")

from cloudeos import API

# Api Token gerekmez
packages = API.get_packages()

for package in packages:
    print(package)  #Json Format
Example #7
0
import sys
# Asagidaki islem cloudeos.py ust dizinde oldugundan,
# buradan direkt olarak ice aktarabilmek icindir.
sys.path.append("..")

from cloudeos import API

cloudeos = API("username", "password")

name = "MyServer"
region = "ist1"
package = "eos1"
image = "ubuntu-16-04-x64"
ssh_keys = "MySSHKey Fingerprint"  #key olusturulmussa veya istege bagli olarak get_sshkeys() fingerprint degeri

create = cloudeos.create_server(name,
                                region,
                                package,
                                image,
                                ssh_keys=ssh_keys)

print(create)
Example #8
0
import sys
# Asagidaki islem cloudeos.py ust dizinde oldugundan,
# buradan direkt olarak ice aktarabilmek icindir.
sys.path.append("..")

from cloudeos import API


cloudeos = API("username", "password")

servers = cloudeos.list_all_servers()

print(servers)
Example #9
0
import sys
# Asagidaki islem cloudeos.py ust dizinde oldugundan,
# buradan direkt olarak ice aktarabilmek icindir.
sys.path.append("..")

from cloudeos import API


cloudeos = API("username", "password")

id = "12231" # ornek

destroy = cloudeos.destroy_server(id)

print(destroy)