Skip to content

Instantly share code, notes, and snippets.

@0xIslamTaha
Created December 6, 2018 09:33
Show Gist options
  • Save 0xIslamTaha/4f6686010fe43965dd16a65a2e125ff3 to your computer and use it in GitHub Desktop.
Save 0xIslamTaha/4f6686010fe43965dd16a65a2e125ff3 to your computer and use it in GitHub Desktop.
from jumpscale import j
key = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjPfKUsaFuaGJsnHvF3k0PbqQTr3GL2pNuddn/xQjsroF35ELJVEovAsd9IlsFWOmDWlL6B+JYFgj8g5IykklHCDfmTu6LcGXjdfAYVp+eXARmgoCJKxVyenSVHu6No9O1e+QKFvMJTiJXdl08fZD1Fd2kRetDRKAijCZ76pmB4/KwVFiJKCVVdsDW/0R+td0gNVJyCQyRTcWEPmBfGMW/JrvRCSHfxlLdqsD3txLOm9pHlQ/LmEwOP3bqEEpQU1jP32JbdAdreuD6BYB+YRp02yyU33gd1QbqIEgftcN+6TuZJOU3j2VRSiUQX8h5SjtWV1UXE15ELlIlhcFJYH6L root@islamtaha-TT'
node = j.clients.zos.get('e0d55e6af8cd', data={'host':'10.102.132.23'})
# Like vm template
data = {'configs': [{'content': key,
'name': 'ssh',
'path': '/root/.ssh/authorized_keys'}],
'cpu': 2,
'disks': [],
'flist': 'https://hub.grid.tf/tf-bootable/ubuntu:latest.flist',
'memory': 2048,
'mounts': [],
'name': 'xtremx_vm_0',
'nics': [{'id': 'af78bf9436aebe54',
'name': 'metcalfe',
'type': 'zerotier',
'ztClient': '9821c424de'}],
'ports': [],
'tags': []}
vm_sal = node.primitives.from_dict('vm', data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment