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

Get-IntersightViewServer - incorrectly matches more than one schema #83

Closed
Christophoclese opened this issue Nov 16, 2022 · 2 comments
Closed

Comments

@Christophoclese
Copy link

Describe the bug
A schema error occurs when attempting to retrieve a list of servers.

Get-IntersightViewServer: The JSON string `{"Count":1174,"ObjectType":"compute.Physical.List","Results":[{"AccountMoid":"5b46442d7a6a7a73646e5dc1","Adapters":[{"Moid":"6317860d6176752d310969d4","ObjectType":"adapter.Unit","Selector":""}],"AdminPowerState":"policy","AlarmSummary":{"Critical":0,"ObjectType":"compute.AlarmSummary","Warning":0},"Alerts":[],"Ancestors":[{"Moid":"5e66a55e6176752d30d88a26","ObjectType":"equipment.Chassis","Selector":""}],"AssetDeviceContractInformation":{"Contract":{"ContractNumber":"2852012"},"ContractStatus":"Active","ContractStatusReason":"","ContractUpdatedTime":"2022-11-14T11:26:40.597Z","Moid":"6317860d6265722d328491e6","ObjectType":"asset.DeviceContractInformation","ServiceDescription":"SNTC 24X7X4OS","ServiceEndDate":"2025-08-31T00:00:00Z","ServiceLevel":"C4P","ServiceStartDate":"2022-09-01T00:00:00Z"},"AssetTag":"","AvailableMemory":1572864,"BiosBootmode":null,"BiosPostComplete":false,"BiosTokenSettings":{"Moid":"631787ee6176752d3109b650","ObjectType":"bios.TokenSettings","Selector":""},"BiosUnits":[{"Moid":"6317860d6176752d310969c2","ObjectType":"bios.Unit","Selector":""}],"BiosVfSelectMemoryRasConfiguration":null,"Bmc":{"Moid":"6317860d6176752d310969ca","ObjectType":"management.Controller","RunningFirmware":[{"Moid":"6317860d6176752d310969d2","ObjectType":"firmware.RunningFirmware","Version":"4.1(33b)"}]},"Board":{"Moid":"6317860d6176752d310969c6","ObjectType":"compute.Board","StorageFlexUtilController":null},"BootCddDevices":[],"BootDeviceBootSecurity":null,"BootDeviceBootmode":null,"BootHddDevices":[],"BootIscsiDevices":[],"BootNvmeDevices":[],"BootPchStorageDevices":[],"BootPxeDevices":[],"BootSanDevices":[],"BootSdDevices":[],"BootUefiShellDevices":[],"BootUsbDevices":[],"BootVmediaDevices":[],"ChassisId":"1","ComputeServerSetting":null,"CondAlarm":[],"CondHclStatus":{"Moid":"6317861373736f2d3039378b","ObjectType":"cond.HclStatus","ServerReason":"Missing-Os-Driver-Info","Status":"Incomplete"},"CreateTime":"2022-09-06T17:40:29.644Z","DeviceMoId":"5e66a2eb6f72612d31e55855","Dn":"sys/chassis-1/blade-1","DomainGroupMoid":"5b46442e7a6a7a73646e5dff","EquipmentChassis":{"Moid":"5e66a55e6176752d30d88a26","ObjectType":"equipment.Chassis","Selector":""},"EquipmentIoExpanders":[],"FaultSummary":0,"FirmwareUpgrade":null,"GenericInventoryHolders":[{"Moid":"631789666176752d3109f16e","ObjectType":"inventory.GenericInventoryHolder","Selector":""}],"GraphicsCards":[],"HardwareUuid":"","InventoryDeviceInfo":null,"KvmIpAddresses":[{"Address":"10.13.238.115","Category":"Equipment","DefaultGateway":"10.13.236.1","Dn":"sys/chassis-1/blade-1/mgmt/ipv4-prof-addr","HttpPort":80,"HttpsPort":443,"KvmPort":2068,"KvmVlan":0,"Name":"Outband","ObjectType":"compute.IpAddress","Subnet":"255.255.252.0","Type":"VnicIpV4ProfDerivedAddr"},{"Address":"10.13.230.129","Category":"Equipment","DefaultGateway":"10.13.228.1","Dn":"sys/chassis-1/blade-1/mgmt/ipv4-pooled-addr","HttpPort":80,"HttpsPort":443,"KvmPort":2068,"KvmVlan":0,"Name":"Outband","ObjectType":"compute.IpAddress","Subnet":"255.255.252.0","Type":"VnicIpV4PooledAddr"}],"KvmServerStateEnabled":false,"KvmVendor":"","LocatorLed":{"Moid":"6317860d6176752d310969c4","ObjectType":"equipment.LocatorLed","OperState":"off"},"ManagementMode":"UCSM","MemoryArrays":[],"MemorySpeed":"2666","MgmtIdentity":null,"MgmtIpAddress":"10.13.238.115, 10.13.230.129","ModTime":"2022-11-05T04:38:29.856Z","Model":"UCSB-B480-M5","Moid":"6317860d6176752d310969c0","Name":"chducs100-1-1","NumAdaptors":1,"NumCpuCores":72,"NumCpuCoresEnabled":72,"NumCpus":4,"NumEthHostInterfaces":2,"NumFcHostInterfaces":2,"NumThreads":144,"ObjectType":"compute.Blade","OperPowerState":"on","OperReason":[],"OperState":"ok","Operability":"operable","Owners":["5b46442d7a6a7a73646e5dc1","5e66a2eb6f72612d31e55855"],"Parent":{"Moid":"5e66a55e6176752d30d88a26","ObjectType":"equipment.Chassis","Selector":""},"PciDevices":[],"PciNodes":[],"PermissionResources":[{"Moid":"5ddf19fd6972652d30bbf13a","ObjectType":"organization.Organization","Selector":""},{"Moid":"608adfaf6972652d3041bc26","ObjectType":"organization.Organization","Selector":""}],"PlatformType":"UCSFI","Presence":"equipped","PreviousFru":null,"Processors":[],"RegisteredDevice":{"ConnectionStatus":"Connected","ConnectionStatusLastChangeTime":"2022-11-13T02:32:25.528Z","DeviceHostname":["chducs100"],"Moid":"5e66a2eb6f72612d31e55855","ObjectType":"asset.DeviceRegistration","ParentConnection":null,"ReadOnly":false},"Revision":"0","Rn":"","ScaledMode":"none","Serial":"<redacted>","ServerHealth":"Healthy","ServerProfile":null,"ServerProfileWorkflowWorkflowInfo":null,"ServiceProfile":"<redacted>","SharedScope":"","SlotId":1,"StorageControllers":[],"StorageEnclosures":[],"Tags":[{"Key":"Intersight.LicenseTier","Value":"Essential"}],"TopSystem":{"Moid":"5e66a55c6176752d30d886e9","ObjectType":"top.System","Selector":""},"TotalCpu":216,"TotalMemory":1572864,"TunneledKvm":false,"UserLabel":"","Uuid":"ac9352b4-1629-11e6-0050-0000000000f1","Vendor":"Cisco Systems Inc","Vmedia":null,"WorkflowWorkflowInfo":[]}]}` incorrectly matches more than one schema (should be exactly one match): System.Collections.Generic.List`1[System.String]

To Reproduce
Steps to reproduce the behavior

$ApiParams = @{
    BasePath          = "https://intersight.com"
    ApiKeyId          = "<redacted>"
    ApiKeyFilePath    = "<redacted>"
    HttpSigningHeader = @("(request-target)", "Host", "Date", "Digest")
}
Set-IntersightConfiguration @ApiParams
Get-IntersightViewServer -Top 1

Version used

Get-InstalledModule -Name Intersight.PowerShell

Version              Name                                Repository           Description
-------              ----                                ----------           -----------
1.0.11.9235          Intersight.PowerShell               PSGallery            Intersight Powershell module provides th…

Expected behavior
A PowerShell object should be returned with the first server found in Intersight. The contents should match the response defined at https://www.intersight.com/apidocs/apirefs/api/v1/view/Servers/get/.

Additional context
Add any other context about the problem here.

@ThatWindowsGuy
Copy link

ThatWindowsGuy commented Jul 24, 2023

Any update on this, or workarounds?

Edit: In case someone else runs across this, you can gather the same information using the "Get-IntersightManagedObject" cmdlet

Get-IntersightManagedObject -ObjectType "view.Server" -filter "Name eq '$Blade'" | ConvertFrom-Json

@Christophoclese
Copy link
Author

Thanks for sharing your workaround @ThatWindowsGuy. I had forgotten about this and moved on. I ended up pivoting to Python where I encountered basically the same problem and discovered a very similar workaround: CiscoDevNet/intersight-python#30

@Ghufz Ghufz closed this as completed Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants