<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Custom Report -&amp;gt; HPE API and/or PowerShell in HPE OneView</title>
    <link>https://community.hpe.com/t5/hpe-oneview/custom-report-gt-hpe-api-and-or-powershell/m-p/7130535#M6183</link>
    <description>&lt;P&gt;Thanks &lt;a href="https://community.hpe.com/t5/user/viewprofilepage/user-id/1458"&gt;@ChrisLynch&lt;/a&gt;&amp;nbsp;! Oddly that doesn't provide any output for me. It doesn't error and does finish, but nothing in the console.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My pre-req command was just using Connect-OVMgmt to connect to my oneview appliance.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Apr 2021 18:44:38 GMT</pubDate>
    <dc:creator>gcj2021</dc:creator>
    <dc:date>2021-04-19T18:44:38Z</dc:date>
    <item>
      <title>Custom Report -&gt; HPE API and/or PowerShell</title>
      <link>https://community.hpe.com/t5/hpe-oneview/custom-report-gt-hpe-api-and-or-powershell/m-p/7130501#M6181</link>
      <description>&lt;P&gt;Hello - sucessfully pull in all server hardware using API, but the request now is to add the enclosure rack location as a column on the blade server report.&lt;/P&gt;&lt;P&gt;Since I can't create a custom report within OneView (we don't have global and won't be getting it), is there a way to create a custom report using the powershell commandlets?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 13:52:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/custom-report-gt-hpe-api-and-or-powershell/m-p/7130501#M6181</guid>
      <dc:creator>gcj2021</dc:creator>
      <dc:date>2021-04-19T13:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Report -&gt; HPE API and/or PowerShell</title>
      <link>https://community.hpe.com/t5/hpe-oneview/custom-report-gt-hpe-api-and-or-powershell/m-p/7130534#M6182</link>
      <description>&lt;P&gt;OneView Global Dashboard is a no-cost product that any OneView customer is entitled to download and use.&lt;/P&gt;&lt;P&gt;Rack information is an Index resource.&amp;nbsp; So, to get the rack information of servers, you can use the following to get the rack name associated with the server resource:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;# Index base URI
$baseUri = '/rest/index/associations?name=RACK_TO_PHYSICAL_DEVICE&amp;amp;childUri={0}'

# Get list of rack mount servers
$Servers = Get-OVServer | Where { $null -eq $_.locationUri }

ForEach ($server in $Servers) {

    $uri = $baseUri -f $server.uri

    # Get the resource association
    $indexResource = Send-OVRequest -Uri $uri

    # Get the rack
    $associatedRack = Send-OVRequest -Uri $indexResource.members[0].parentUri

    Write-Host $server.name "is associated with" $associatedRack.name

}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 19 Apr 2021 18:04:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/custom-report-gt-hpe-api-and-or-powershell/m-p/7130534#M6182</guid>
      <dc:creator>ChrisLynch</dc:creator>
      <dc:date>2021-04-19T18:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Report -&gt; HPE API and/or PowerShell</title>
      <link>https://community.hpe.com/t5/hpe-oneview/custom-report-gt-hpe-api-and-or-powershell/m-p/7130535#M6183</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.hpe.com/t5/user/viewprofilepage/user-id/1458"&gt;@ChrisLynch&lt;/a&gt;&amp;nbsp;! Oddly that doesn't provide any output for me. It doesn't error and does finish, but nothing in the console.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My pre-req command was just using Connect-OVMgmt to connect to my oneview appliance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 18:44:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/custom-report-gt-hpe-api-and-or-powershell/m-p/7130535#M6183</guid>
      <dc:creator>gcj2021</dc:creator>
      <dc:date>2021-04-19T18:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Report -&gt; HPE API and/or PowerShell</title>
      <link>https://community.hpe.com/t5/hpe-oneview/custom-report-gt-hpe-api-and-or-powershell/m-p/7130540#M6184</link>
      <description>&lt;P&gt;The code filters out BL and SY servers from the appliance.&amp;nbsp; Both of which have a different method of obtaining the rack information.&amp;nbsp; This code would work for those types of devices:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;# Index base URI
$baseUri = '/rest/index/associations?name=RACK_TO_PHYSICAL_DEVICE&amp;amp;childUri={0}'

# Get list of rack mount servers
$Servers = Get-OVServer | Where { $null -ne $_.locationUri }

ForEach ($server in $Servers) {

    # The locationUri value is the Enclosure resource's URI
    $uri = $baseUri -f $server.locationUri

    # Get the enclosure resource only for reporting purposes
    $enclosureResource = Send-OVRequest -Uri $server.locationUri

    # Get the resource association
    $indexResource = Send-OVRequest -Uri $uri

    # Get the rack
    $associatedRack = Send-OVRequest -Uri $indexResource.members[0].parentUri

    "{0} is associated with {1} enclosure, associated with {2} rack" -f $server.name, $enclosureResource.name, $associatedRack.name | Write-Host

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 19:02:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/custom-report-gt-hpe-api-and-or-powershell/m-p/7130540#M6184</guid>
      <dc:creator>ChrisLynch</dc:creator>
      <dc:date>2021-04-19T19:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Report -&gt; HPE API and/or PowerShell</title>
      <link>https://community.hpe.com/t5/hpe-oneview/custom-report-gt-hpe-api-and-or-powershell/m-p/7130542#M6185</link>
      <description>&lt;HR /&gt;&lt;P&gt;&lt;a href="https://community.hpe.com/t5/user/viewprofilepage/user-id/1458"&gt;@ChrisLynch&lt;/a&gt;&amp;nbsp; Perfecto! Thanks!!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 19:37:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/custom-report-gt-hpe-api-and-or-powershell/m-p/7130542#M6185</guid>
      <dc:creator>gcj2021</dc:creator>
      <dc:date>2021-04-19T19:37:02Z</dc:date>
    </item>
  </channel>
</rss>

