Skip to content

Instantly share code, notes, and snippets.

@0xIslamTaha
Last active September 2, 2018 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xIslamTaha/e7e402e824a9311d023fdf2baa154d7d to your computer and use it in GitHub Desktop.
Save 0xIslamTaha/e7e402e824a9311d023fdf2baa154d7d to your computer and use it in GitHub Desktop.
import requests
from jumpscale import j
client_id = ''
client_secret = ''
zt_nw_id = ''
farmer_id = ''
ipxe_url = 'ipxe: https://bootstrap.gig.tech/ipxe/development/{}/development%20farmer_id={}'.format(zt_nw_id, farmer_id)
data_new = requests.post('https://itsyou.online/v1/oauth/access_token?grant_type=client_credentials&client_id=%s&client_secret=%s&response_type=id_token' % (client_id, client_secret))
jwt = data_new.text
ovc_data={"account": "xtremx",
"address": "be-g8-3.demo.greenitglobe.com",
"jwt_": jwt,
"location": "be-g8-3",
"port": 443,
"space":""}
print(' [*] GET OVC client')
ovccl = j.clients.openvcloud.get(data=ovc_data)
account = ovccl.account_get('xtremx')
cs_name = str(uuid.uuid4()).replace('-','')[:10]
print( ' [*] cs name : {}'.format(cs_name))
cs = account.space_get(cs_name)
# Create zOS machine
vm_name = str(uuid.uuid4()).replace('-','')[:10]
print( ' [*] vm name : {}'.format(vm_name))
vm_zos = cs.machine_create(name=vm_name, memsize=8, disksize=10, datadisks=[50], image='ipxe boot',
authorize_ssh=False, userdata=ipxe_url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment