Skip to content

Instantly share code, notes, and snippets.

@embano1
Created February 4, 2021 08:56
Show Gist options
  • Select an option

  • Save embano1/3b1b4338e157deaae41187a45f01f6bc to your computer and use it in GitHub Desktop.

Select an option

Save embano1/3b1b4338e157deaae41187a45f01f6bc to your computer and use it in GitHub Desktop.
CloudEvents XML pretty print representation
# DrsPoweredOnEvent
{'attributes': {'specversion': '1.0', 'id': '8583', 'source': '10.161.153.226', 'type': 'com.vmware.vsphere.DrsVmPoweredOnEvent', 'datacontenttype': 'application/xml', 'time': '2021-02-04T08:53:57.182999Z', 'eventclass': 'event'}, 'data': b'<DrsVmPoweredOnEvent><key>8583</key><chainId>8577</chainId><createdTime>2021-02-04T08:53:57.182999Z</createdTime><userName>VSPHERE.LOCAL\\Administrator</userName><datacenter><name>vcqaDC</name><datacenter type="Datacenter">datacenter-2</datacenter></datacenter><computeResource><name>cls</name><computeResource type="ClusterComputeResource">domain-c7</computeResource></computeResource><host><name>10.161.139.167</name><host type="HostSystem">host-27</host></host><vm><name>test-01</name><vm type="VirtualMachine">vm-56</vm></vm><fullFormattedMessage>DRS powered On test-01 on 10.161.139.167 in vcqaDC</fullFormattedMessage><template>false</template></DrsVmPoweredOnEvent>'}
# EventEx
{'attributes': {'specversion': '1.0', 'id': '8574', 'source': '10.161.153.226', 'type': 'com.vmware.vsphere.com.vmware.sso.LoginSuccess', 'datacontenttype': 'application/xml', 'time': '2021-02-04T08:53:35.243Z', 'eventclass': 'eventex'}, 'data': b'<EventEx><key>8574</key><chainId>8574</chainId><createdTime>2021-02-04T08:53:35.243Z</createdTime><userName>administrator@vsphere.local</userName><fullFormattedMessage>Successful login administrator@vsphere.local from 10.93.146.250 at 02/04/2021 08:51:35 UTC in SSO</fullFormattedMessage><eventTypeId>com.vmware.sso.LoginSuccess</eventTypeId><severity>info</severity><arguments><key>userIp</key><value>10.93.146.250</value></arguments><arguments><key>description</key><value>User administrator@vsphere.local@10.93.146.250 logged in with response code 200</value></arguments><arguments><key>userName</key><value>administrator@vsphere.local</value></arguments><arguments><key>timestamp</key><value>02/04/2021 08:51:35 UTC</value></arguments><arguments><key>_sourcehost_</key><value>sc-rdops-vm13-dhcp-153-226.eng.vmware.com</value></arguments></EventEx>'}
# Login
{'attributes': {'specversion': '1.0', 'id': '8571', 'source': '10.161.153.226', 'type': 'com.vmware.vsphere.UserLoginSessionEvent', 'datacontenttype': 'application/xml', 'time': '2021-02-04T08:52:24.214999Z', 'eventclass': 'event'}, 'data': b'<UserLoginSessionEvent><key>8571</key><chainId>8571</chainId><createdTime>2021-02-04T08:52:24.214999Z</createdTime><userName>VSPHERE.LOCAL\\vpxd-extension-43413451-668b-446e-98b1-03bb2d8ce192</userName><fullFormattedMessage>User VSPHERE.LOCAL\\vpxd-extension-43413451-668b-446e-98b1-03bb2d8ce192@127.0.0.1 logged in as VMware vim-java 1.0</fullFormattedMessage><ipAddress>127.0.0.1</ipAddress><userAgent>VMware vim-java 1.0</userAgent><locale>en</locale><sessionId>522f8af8-171f-0a30-c286-1fce6c23d065</sessionId></UserLoginSessionEvent>'}
# VmReconfiguredEvent
{'attributes': {'specversion': '1.0', 'id': '8595', 'source': '10.161.153.226', 'type': 'com.vmware.vsphere.VmReconfiguredEvent', 'datacontenttype': 'application/xml', 'time': '2021-02-04T08:56:21.108Z', 'eventclass': 'event'}, 'data': b'<VmReconfiguredEvent><key>8595</key><chainId>8594</chainId><createdTime>2021-02-04T08:56:21.108Z</createdTime><userName>VSPHERE.LOCAL\\Administrator</userName><datacenter><name>vcqaDC</name><datacenter type="Datacenter">datacenter-2</datacenter></datacenter><computeResource><name>cls</name><computeResource type="ClusterComputeResource">domain-c7</computeResource></computeResource><host><name>10.161.139.167</name><host type="HostSystem">host-27</host></host><vm><name>test-01</name><vm type="VirtualMachine">vm-56</vm></vm><fullFormattedMessage>Reconfigured test-01 on 10.161.139.167 in vcqaDC.  &#xA; &#xA;Modified:  &#xA; &#xA;config.hardware.numCPU: 2 -&gt; 1; &#xA;&#xA;config.hardware.numCoresPerSocket: 2 -&gt; 1; &#xA;&#xA;config.hardware.memoryMB: 4096 -&gt; 2048; &#xA;&#xA;config.cpuAllocation.shares.shares: 2000 -&gt; 1000; &#xA;&#xA;config.memoryAllocation.shares.shares: 40960 -&gt; 20480; &#xA;&#xA; Added:  &#xA; &#xA; Deleted:  &#xA; &#xA;config.extraConfig(&#34;cpuid.coresPerSocket&#34;): (key = &#34;cpuid.coresPerSocket&#34;, value = &#34;2&#34;); &#xA;&#xA;</fullFormattedMessage><template>false</template><configSpec><changeVersion>2021-01-26T17:14:15.982886Z</changeVersion><createDate>2021-01-25T15:43:18.217732Z</createDate><numCPUs>1</numCPUs><numCoresPerSocket>1</numCoresPerSocket><memoryMB>2048</memoryMB></configSpec><configChanges><modified>config.hardware.numCPU: 2 -&gt; 1; &#xA;&#xA;config.hardware.numCoresPerSocket: 2 -&gt; 1; &#xA;&#xA;config.hardware.memoryMB: 4096 -&gt; 2048; &#xA;&#xA;config.cpuAllocation.shares.shares: 2000 -&gt; 1000; &#xA;&#xA;config.memoryAllocation.shares.shares: 40960 -&gt; 20480; &#xA;&#xA;</modified><deleted>config.extraConfig(&#34;cpuid.coresPerSocket&#34;): (key = &#34;cpuid.coresPerSocket&#34;, value = &#34;2&#34;); &#xA;&#xA;</deleted></configChanges></VmReconfiguredEvent>'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment