-
Notifications
You must be signed in to change notification settings - Fork 77
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
Unmarshal of QueryResultRecordsType for OrgVdcStorageProfileRecord #373
Comments
As i understood - it is a different types, which should be implemented both: |
I really hope that we can resolve this issue before 2.12 release. |
With my PR we have working query for adminOrgVdcStorageProfile, but query for orgVdcStorageProfile not working at all on 10.0 and 10.2.2 |
Sounds like it - yes. We have a few structures like that. In some cases (when all the fields are the same) we simply link the same struct with multiple tags.
Can you share what error/problem you hit? |
There is no error, just no results - QueryResultRecords with const QtOrgVdcStorageProfile = "orgVdcStorageProfile" // StorageProfile of VDC
func QueryOrgVdcStorageProfileByID(vcdCli *VCDClient, id string) ([]*types.QueryResultOrgVdcStorageProfileRecordType, error) {
results, err := vcdCli.QueryWithNotEncodedParams(nil, map[string]string{
"type": types.QtOrgVdcStorageProfile,
"filter": fmt.Sprintf("id==%s", url.QueryEscape(id)),
"filterEncoded": "true",
})
if err != nil {
return nil, err
}
return results.Results.OrgVdcStorageProfileRecord, nil
} |
Same with adminOrgVdcStorageProfile - working well https://github.com/vmware/go-vcloud-director/pull/375/files#diff-685384fc951a61f02cd5dfe54a0e3f6a4bce0a94b23589ce46f74cecdf550163R979-R990 |
Are you able to see what query it actually calls inside logs:
|
|
Querying with same id and type 'adminOrgVdcStorageProfile' working well. |
I understood - as provider admin i cant query non admin objects without And, you already have constant for this header - https://github.com/vmware/go-vcloud-director/blob/v2.11.0/types/v56/constants.go#L350 In result - code in my PR working well, i will open another issue for adding support of |
Hi!
On struct QueryResultRecordsType you have element OrgVdcStorageProfileRecord with same xml unmarshal tag.
https://github.com/vmware/go-vcloud-director/blob/v2.11.0/types/v56/types.go#L2137
But vCloud returns xml element AdminOrgVdcStorageProfileRecord with same content.
In result - i have
1
qty in total with empty OrgVdcStorageProfileRecordI want to send PR, but i don't know what you want to do:
And i want to add:
adminOrgVdcStorageProfile
The text was updated successfully, but these errors were encountered: