DX NetOps

 View Only
  • 1.  Query Component Detail Notes

    Posted Jul 07, 2017 04:08 PM

    Hi,

    I need to extract a information from CA Spectrum database about all assets.

    Someone know how to extract the field "Notes" present on OneClick Console: "Component Detail" | Information | "General Information"?


    Thanks a lot!



  • 2.  Re: Query Component Detail Notes

    Broadcom Employee
    Posted Jul 10, 2017 09:57 AM
      |   view attached

    You should be able to extract this using REST or modeling gateway…

    Cheers

    Jay



  • 3.  Re: Query Component Detail Notes

    Posted Oct 16, 2017 09:11 AM

    I actually need this to, someone any idea or query example? 



  • 4.  Re: Query Component Detail Notes

    Posted Oct 16, 2017 01:25 PM

    Use the RESTful API. I use powershell to query Spectrum.

    using namespace System.Data

    $DSTable = [DataTable]::new('Spectrum')

    $col01 = [DataColumn]::new('Name',[string])

    $col02 = [DataColumn]::new('Model',[string])

    $col03 = [DataColumn]::new('IP',[string])

    $col04 = [DataColumn]::new('Manufactuer',[string])

    $col05 = [DataColumn]::new('Firmware',[string])

    $col06 = [DataColumn]::new('Type',[string])

    $col07 = [DataColumn]::new('SN',[string])

    $col08 = [DataColumn]::new('Notes',[string])

    $DSTable.Columns.Add($col01)

    $DSTable.Columns.Add($col02)

    $DSTable.Columns.Add($col03)

    $DSTable.Columns.Add($col04)

    $DSTable.Columns.Add($col05)

    $DSTable.Columns.Add($col06)

    $DSTable.Columns.Add($col07)

    $DSTable.Columns.Add($col08)

    $username = 'user_name'

    $password = 'user_pwd'

    $auth = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(('{0}:{1}' -f $username,$password)))

    $url = 'https://youroneclickserver/spectrum/restful/devices?attr=0x1006e&attr=0x10000&attr=0x12d7f&attr=0x10032&attr=0x12de0&attr=0x23000e&attr=0x10030&attr=0x11564&throttlesize=6000'

     

    [xml]$results = Invoke-RestMethod -Uri $url -Headers @{authorization=('Basic {0}' -f $auth)} -TimeoutSec 90000

     

    $models = $results.'model-response-list'.'model-responses'.model

    foreach ($m in $models)

    {

    $name = $m.attribute[0].'#text'

    $model = $m.attribute[1].'#text'

    $ip = $m.attribute[2].'#text'

    try

    {

    $man = $m.attribute[3].'#text'.Replace(",","")

    }

    catch

    {

    $man = $m.attribute[3].'#text'

    }

    $firm = $m.attribute[4].'#text'

    $row = $DSTable.NewRow()

    if ($model -notmatch 'Pingable')

    {

    $row.name = $name

    $row.model = $model

    $row.ip = $ip

    $row.manufactuer = $man

    $row.firmware = $firm

    $row.type = $m.attribute[5].'#text'

    $row.sn = $m.attribute[6].'#text'

    $row.notes = $m.attribute[7].'#text'

     

    $DSTable.Rows.Add($row)

    }

     

    }

    $DSTable |Export-Csv D:\PSScripts\Stuff.csv -NoTypeInformation

     



  • 5.  Re: Query Component Detail Notes

    Posted Oct 17, 2017 02:17 AM

    I actually need a query i can use in Jaspersoft.



  • 6.  Re: Query Component Detail Notes

    Posted Nov 30, 2017 04:16 AM

    Why don't you use the existing Asset Domain? What type of report are you trying to create?



  • 7.  Re: Query Component Detail Notes

    Posted Nov 30, 2017 11:49 AM

    Hello...

     

    Hello, friend, you can see the contents of the field NOTES in the tab Locater / All Devices, in this tab you can see all your assets with the content of the field notes associated with it.

    And you can extrapolate to a CSV worksheet.