Ubuntu Pastebin

Paste from smoser at Thu, 12 May 2016 19:55:12 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
>>> from cloudinit.sources import DataSourceSmartOS as ds
>>> x = ds.jmc_client_factory()
>>> x
JoyentMetadataLegacySerialClient(device=/dev/ttyS1, timeout=60)
>>> x.list()
['user-script', 'user-data', 'root_authorized_keys', 'foo', 'base64_all', 'foo2', 'foo3', 'mykey']
>>> x.delete('base64_all')
'OK'
>>> x.list()
['user-script', 'user-data', 'root_authorized_keys', 'foo', 'foo2', 'foo3', 'mykey']
>>> x.put("mykey", "myval")
'OK'
>>> x.get("mykey")
'myval'
>>> x.get("noexist", "foo")
'foo'
>>> x.get_json("sdc:nics")
[{'nic_tag': 'external', 'gateways': ['8.12.42.1'], 'ip': '8.12.42.102', 'netmask': '255.255.255.0', 'ips': ['8.12.42.102/24'], 'vlan_id': 324, 'network_uuid': '992fc7ce-6aac-4b74-aed6-7b9d2c6c0bfe', 'model': 'virtio', 'mtu': 1500, 'gateway': '8.12.42.1', 'interface': 'net0', 'mac': '90:b8:d0:f5:e4:f5',
'primary': True}, {'nic_tag': 'sdc_overlay/16187209', 'gateways': ['192.168.128.1'], 'ip': '192.168.128.93', 'netmask': '255.255.252.0', 'ips': ['192.168.128.93/22'], 'vlan_id': 2, 'network_uuid': '4cad71da-09bc-452b-986d-03562a03a0a9', 'model': 'virtio', 'mtu': 8500, 'gateway': '192.168.128.1', 'interface':
'net1', 'mac': '90:b8:d0:a5:ff:cd'}]
Download as text