Skip to content

Instantly share code, notes, and snippets.

@chelnak
Last active August 29, 2015 14:11
Show Gist options
  • Save chelnak/7d92a75161f817d72dd4 to your computer and use it in GitHub Desktop.
Save chelnak/7d92a75161f817d72dd4 to your computer and use it in GitHub Desktop.
vRA LeaseAboutToExpire.xslt date
<!-- This bit goes after <xsl:template match="/"> -->
<xsl:variable name="dd">
<xsl:value-of select="substring(//VirtualMachineEx/Expires, 9,2)" />
</xsl:variable>
<xsl:variable name="mm">
<xsl:value-of select="substring(//VirtualMachineEx/Expires, 6,2)" />
</xsl:variable>
<xsl:variable name="yyyy">
<xsl:value-of select="substring(//VirtualMachineEx/Expires, 1,4)" />
</xsl:variable>
<xsl:variable name="time">
<xsl:value-of select="substring(//VirtualMachineEx/Expires, 12,5)" />
</xsl:variable>
<!--
As I was only interested in changing notification for single machine
deployments at this time I put the following after <xsl:otherwise>
-->
The lease for Virtual Machine <xsl:value-of select="//VirtualMachineEx/Name"/> will expire on
<xsl:value-of select="$dd" />/<xsl:value-of select="$mm" />/<xsl:value-of select="$yyyy" />
at <xsl:value-of select="$time" />.
<!--
You will get the following output:
The lease for Virtual Machine VM-01 will expire on 09/12/2014 at 12:00
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment