P_C
Contributor
Contributor

Only Admins can get vCenter version using REST?

Hello, 
I am trying to fetch cVenter 7.0 version using following REST API: 

GET https://{{vc}}/rest/appliance/system/version

This works well when I am using Administrator privileges.

But is throws error when using a user with Read-Only role. I have seen this issue on vCenter 6.7 and 7.0 both. 

Error I get for a read only user is as follows: 

{
    'type':'com.vmware.vapi.std.errors.unauthorized',
    'value':{
        'messages':
        [{
            'args':[],
            'default_message':'Unable to authorize user',
            'id':'vapi.security.authorization.invalid'
        ]}
    }
}

My question here is, do we need Administrator privilege only to fetch vCenter version using REST?

Is there any alternative to this to detect vCenter version without using credentials or with read-only privilege?

 

 

Labels (4)
0 Kudos
1 Reply
sonisi
VMware Employee
VMware Employee

Hi, based on the below document

https://developer.vmware.com/docs/vsphere-automation/latest/appliance/api/appliance/system/version/g...


we can infer that vmware-api-session-id is a required Header parameter when trying to get vCenter version using REST


Thanks,
Sidharth

0 Kudos