HewlettPackard / POSH-HPEOneView

PowerShell language bindings library for HPE OneView.
http://hewlettpackard.github.io/POSH-HPEOneView/
125 stars 52 forks source link

Possibility to see Labels in Get-HPOVServer #23

Closed Anbeek closed 6 years ago

Anbeek commented 9 years ago

Within HP OneView 1.20 it is possible to add labels to the Server Hardware and the Server Profiles. Is it possibel to add the labels in the GET-HPOVServer and GET-HPOVProfile so that the command

[HPONEVIEW]: Administrator@131.224.76.100 PS C:\Users\a-anbeekc> get-hpovserver | ft -Property name,assetTag,description,labels,model,romVersion,serialnumber,mpmodel,mpFirmwareVersion,mpIpAddress,processorCount,licensingIntent -AutoSize

Done. server resource(s) found. name assetTag description labels model romVersion serialNumber mpModel mpFirmwareVersion mpIpAddress processorCount licensingIntent


sscc-be-am3-01, bay 1 [Unknown] ProLiant BL460c Gen8 I31 02/10/2014 CZ3350WDK5 iLO4 1.51 Jun 16 2014 131.224.72.202 2 OneView sscc-be-am3-01, bay 10 [Unknown] ProLiant BL460c Gen8 I31 02/10/2014 CZ3350WDKB iLO4 1.51 Jun 16 2014 131.224.72.211 2 OneView sscc-be-am3-01, bay 11 [Unknown] ProLiant BL460c Gen8 I31 02/10/2014 CZ3350WDKJ iLO4 1.51 Jun 16 2014 131.224.72.212 2 OneView

Also shows the Labels!

Best Regards,

Cees Anbeek RIVM The Netherlands

ChrisLynchHPE commented 9 years ago

Labels are not property within a resource object (i.e. Server Hardware). Labels are a globally managed resource. Displaying labels during the call would put extra API calls and add properties that are not part of the data model for resources.

Label support within the library is a missing feature, and one that we unfortunately do not have an easy solution at this time. We are still investigating how we can provide a good experience with managing labels from the PowerShell library.

Anbeek commented 9 years ago

Hi Cris, In our company we need some way to make reports and therefor we would like to use the labels and preferable with PowerShell. Another possibilty would be to use the description field in the ServerHardware. But I am not aware how to fill this field. Can you perhaps help me with this? It would be nice to have the labels implemented in a future release, but if there is another way to display an extra information field, as the description, it would help us very much. Best regards, Cees Anbeek

ChrisLynchHPE commented 9 years ago

The Description field is an property to the resource object. So use the Get-HPOV{resource} cmdlet, and then set a value to description (where available.) Then, you can use the Set-HPOVResource CMDLET to update the resource.

As for labels themselves, we can add some core cmdlets Get-HPOVLabel, Add-HPOVLabel, New-HPOVLabel, Remove-HPOVLabel. Showing labels with other resources isn't an ideal experience, as each resource would be multiple API calls. That would simply prolong return objects. Plus, a new property would be added to each resource object that otherwise doesn't exist in the API.

CermakPOI commented 8 years ago

How about using this thing in a similar way like VMWAare uses get get-View? Get-HPOVServerView

CermakPOI commented 8 years ago

I tried your suggestion with the description (Where can i see this in the OV-GUI?), but it throws an error.

PS Z:\> $Server = Get-HPOVServer -Name "Blade13P-Enc, bay 3"
PS Z:\> $server.description = "ESXHOST37P"
PS Z:\> Set-HPOVResource -resource $server
Set-HPOVResource : You are not allowed to modify these parameters: powerLock,serverProfileUri,. Confirm that the specified parameters may be modified and try the
request again.
At line:1 char:1
+ Set-HPOVResource -resource $server
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (URI:String) [Set-HPOVResource], ResourcePrivledgeException
    + FullyQualifiedErrorId : ResourcePrivledge,Set-HPOVResource

I don't want to modify the values powerLock,serverProfileUri,!

When can we expect the *label* cmdlets?

We would like to add custom information to the servers. Can is somehow set the asset Tag from within OV GUI or OV cmdlets?

ChrisLynchHPE commented 7 years ago

Labels have been added to Release 3.0.1293.3770 .

I'll be looking at adding support to the 2.00 library in a future release if folks would like it.

ChrisLynchHPE commented 6 years ago

Closing enhancement as the 2.00 library is no longer supported with the release of the 4.00 library.