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

Add ContentLibraryItem as an opaque object #35

Merged
merged 1 commit into from May 15, 2023

Conversation

agrare
Copy link
Member

@agrare agrare commented Feb 28, 2023

Similar issue to #29 but the VMware VIM API returns an object which has no representation in the WSDL (tisk tisk). The previous issue was returning a "Managed Object" where this is returning a "Data Object".

$ diff vmodl-master.yml vmodl-new.yml 
76048a76049
>   - ContentLibraryItem
79875a79877,79878
>   kind: opaque
> ContentLibraryItem:

Fixes #34

@agrare agrare added the bug Something isn't working label Feb 28, 2023
@agrare agrare changed the title Add ContentLibraryItem as a blank data object Add ContentLibraryItem as an opaque object Feb 28, 2023
@agrare
Copy link
Member Author

agrare commented Feb 28, 2023

>> vim.serviceContent.taskManager.recentTask.last.info
D, [2023-02-28T13:48:32.691667 #28354] DEBUG -- : Request:
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body><RetrieveProperties xmlns="urn:vim25"><_this type="PropertyCollector">propertyCollector</_this><specSet xsi:type="PropertyFilterSpec"><propSet xsi:type="PropertySpec"><type>TaskManager</type><pathSet>recentTask</pathSet></propSet><objectSet xsi:type="ObjectSpec"><obj type="TaskManager">TaskManager</obj></objectSet></specSet></RetrieveProperties></env:Body></env:Envelope>
D, [2023-02-28T13:48:32.776537 #28354] DEBUG -- : Response (in 0.085 s)
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<RetrievePropertiesResponse xmlns="urn:vim25"><returnval><obj type="TaskManager">TaskManager</obj><propSet><name>recentTask</name><val xsi:type="ArrayOfManagedObjectReference"><ManagedObjectReference type="Task" xsi:type="ManagedObjectReference">task-247820</ManagedObjectReference><ManagedObjectReference type="Task" xsi:type="ManagedObjectReference">task-247821</ManagedObjectReference><ManagedObjectReference type="Task" xsi:type="ManagedObjectReference">task-247822</ManagedObjectReference></val></propSet></returnval></RetrievePropertiesResponse>
</soapenv:Body>
</soapenv:Envelope>

D, [2023-02-28T13:48:32.777106 #28354] DEBUG -- : Request:
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body><RetrieveProperties xmlns="urn:vim25"><_this type="PropertyCollector">propertyCollector</_this><specSet xsi:type="PropertyFilterSpec"><propSet xsi:type="PropertySpec"><type>Task</type><pathSet>info</pathSet></propSet><objectSet xsi:type="ObjectSpec"><obj type="Task">task-247822</obj></objectSet></specSet></RetrieveProperties></env:Body></env:Envelope>
D, [2023-02-28T13:48:32.805231 #28354] DEBUG -- : Response (in 0.028 s)
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<RetrievePropertiesResponse xmlns="urn:vim25"><returnval><obj type="Task">task-247822</obj><propSet><name>info</name><val xsi:type="TaskInfo"><key>task-247822</key><task type="Task">task-247822</task><descriptionId>com.vmware.content.LibraryItem.UploadContent</descriptionId><entity type="ContentLibraryItem">clibitem-5254</entity><entityName>cp4ai-ia-vsphere-3-6-2.x86_64</entityName><state>running</state><cancelled>false</cancelled><cancelable>true</cancelable><progress>60</progress><reason xsi:type="TaskReasonUser"><userName>Administrator</userName></reason><queueTime>2023-02-28T18:46:36.163347Z</queueTime><startTime>2023-02-28T18:46:36.25975Z</startTime><eventChainId>19105364</eventChainId><activationId>11089764-2bfc-42d9-81c1-4b1e50df917d</activationId></val></propSet></returnval></RetrievePropertiesResponse>
</soapenv:Body>
</soapenv:Envelope>

Traceback (most recent call last):
       16: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/deserialization.rb:101:in `traverse_data'
       15: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/deserialization.rb:101:in `each'
       14: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/deserialization.rb:114:in `block in traverse_data'
       13: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/deserialization.rb:83:in `deserialize'
       12: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/deserialization.rb:101:in `traverse_data'
       11: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/deserialization.rb:101:in `each'
       10: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/deserialization.rb:119:in `block in traverse_data'
        9: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/deserialization.rb:83:in `deserialize'
        8: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/deserialization.rb:101:in `traverse_data'
        7: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/deserialization.rb:101:in `each'
        6: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/deserialization.rb:119:in `block in traverse_data'
        5: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/deserialization.rb:80:in `deserialize'
        4: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/type_loader.rb:66:in `get'
        3: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/type_loader.rb:66:in `synchronize'
        2: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/type_loader.rb:69:in `block in get'
        1: from /home/agrare/.gem/ruby/2.7.6/gems/rbvmomi2-3.6.0/lib/rbvmomi/type_loader.rb:104:in `make_type'
RuntimeError (unknown VMODL type ContentLibraryItem)

@agrare
Copy link
Member Author

agrare commented Feb 28, 2023

With this fix:

>> pp vim.serviceContent.taskManager.recentTask.last.info; nil
TaskInfo(
  activationId: "11089764-2bfc-42d9-81c1-4b1e50df917d",
  cancelable: true,
  cancelled: false,
  completeTime: 2023-02-28 18:49:50.015351 UTC,
  descriptionId: "com.vmware.content.LibraryItem.UploadContent",
  entity: ContentLibraryItem("clibitem-5254"),
  entityName: "cp4ai-ia-vsphere-3-6-2.x86_64",
  eventChainId: 19105364,
  key: "task-247822",
  locked: [],
  queueTime: 2023-02-28 18:46:36.163347 UTC,
  reason: TaskReasonUser( userName: "Administrator" ),
  startTime: 2023-02-28 18:46:36.25975 UTC,
  state: "success",
  task: Task("task-247822")
)
>> pp vim.serviceContent.taskManager.recentTask.last.info.entity; nil
ContentLibraryItem("clibitem-5254")
>> vim.serviceContent.taskManager.recentTask.last.info.entity.class.name
=> "RbVmomi::VIM::ContentLibraryItem"
>> vim.serviceContent.taskManager.recentTask.last.info.entity.class.wsdl_name
=> "ContentLibraryItem"

@agrare
Copy link
Member Author

agrare commented Mar 6, 2023

cc @Fryguy

@agrare
Copy link
Member Author

agrare commented May 15, 2023

Ping @Fryguy

@Fryguy Fryguy merged commit 137ef79 into ManageIQ:master May 15, 2023
@agrare agrare deleted the add_content_library_item branch May 15, 2023 13:36
agrare added a commit that referenced this pull request May 15, 2023
Fixed
- Fix unknown VMODL type ContentLibraryItem (#35)

Added
- Add ManageIQ/bundler-inject (#31)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RbVmomi deserialization fails on managed object type ContentLibraryItem
2 participants