Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIOS Option 'CbsCmnApbdis' shown as 'int value__' with '_0' and '_1' as values instead of integers '0' and '1' #180

Open
knoll-nc opened this issue Jan 2, 2025 · 2 comments

Comments

@knoll-nc
Copy link

knoll-nc commented Jan 2, 2025

Describe the bug
When setting or getting the value an integer is expected. However, the interger is not set and not received.

To Reproduce
Create a new BIOS policy:

PS C:\> New-IntersightBiosPolicy -Name "amd-test" -CbsCmnApbdis _1

ClassId                        : BiosPolicy
ObjectType                     : BiosPolicy
[...]
C1autoUnDemotion               : PlatformDefault
CbsCmnApbdis                   : _1
CbsCmnCpuAvx512                : PlatformDefault 
[...] 

Read it:

PS C:\> (get-IntersightBiosPolicy -Name "amd-test").CbsCmnApbdis
_1 

Tested it with a value of 1 which didn't result in any error, but the value was just platform default:

PS C:\> New-IntersightBiosPolicy -Name "amd-test2" -CbsCmnApbdis 1

ClassId                        : BiosPolicy
ObjectType                     : BiosPolicy
[...]
C1autoUnDemotion               : PlatformDefault
CbsCmnApbdis                   : PlatformDefault
CbsCmnCpuAvx512                : PlatformDefault 
[...] 

Read it:

PS C:\> (get-IntersightBiosPolicy -Name "amd-test2").CbsCmnApbdis
PlatformDefault 

Did the same via UI and had a look at the browser inspection network tab:

CbsCmnApbdis: "1"

Read it via PS:

PS C:\> (get-IntersightBiosPolicy -Name "amd-test3").CbsCmnApbdis
_1 

Version used

  • PSVersion: 7.4.6
  • Intersight PowerShell Version: 1.0.11.2024112619

Expected behavior
values of 0 and 1 instead of _0 and _1

@Ghufz
Copy link
Collaborator

Ghufz commented Jan 3, 2025

C# has a restriction where enum names cannot start with a number. To accommodate the actual value of 1, the enum name is prefixed with an underscore, resulting in _1

@knoll-nc
Copy link
Author

knoll-nc commented Jan 3, 2025

Thanks for your reply.
This is not related to the documentation:
https://cdn.intersight.com/components/an-apidocs/1.0.11-20241126194850025/model/intersight-openapi-v3-1.0.11-20241126194850025.json

11_25_44

Additionally, when only values of _0 and _1 are supported, why can we put in 1 without receiving any error? It looks like this is a valid input, however the value is not set.

If it's not possible to have 0 and 1, going for enabled and disabled would be a better way to work around it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants