rlane/rbvmomi — Issue #7: RbVmomi::Fault: InvalidRequest: Not initialized: vim.TaskFilterSpec.TimeOption timeType
Author: jbbarth
Created: 2011-10-24 12:22:04+00:00
State: open

Hi there,

First thanks for this great gem, I use it every day for 1 or 2 months and even if the vmware API is a bit complicated, the gem does a great job so far !

Today I'm trying to list all the tasks that happened in the last day or so. Here's the script :

```ruby
%w(trollop rbvmomi rbvmomi/trollop json).each{|f| require f}
VIM = RbVmomi::VIM
vim = VIM.connect(:host=>"XXXXXXX",:port=>443,:insecure=>true,:user=>"xxxxxxx",:password=>"xxxxxxx")
filter = VIM::TaskFilterSpec.new(:time => VIM::TaskFilterSpecByTime.new(:beginTime => DateTime.now - 1))
tm = vim.serviceContent.taskManager.CreateCollectorForTasks(:filter => filter)
```

But it fails with the following error message :

```
RbVmomi::Fault: InvalidRequest: Not initialized: vim.TaskFilterSpec.TimeOption timeType
from /usr/local/rvm/gems/ruby-1.9.2-p290@vmware/gems/rbvmomi-1.4.0/lib/rbvmomi/connection.rb:47:in `parse_response'
from /usr/local/rvm/gems/ruby-1.9.2-p290@vmware/gems/rbvmomi-1.4.0/lib/rbvmomi/connection.rb:71:in `call'
from /usr/local/rvm/gems/ruby-1.9.2-p290@vmware/gems/rbvmomi-1.4.0/lib/rbvmomi/basic_types.rb:187:in `_call'
from /usr/local/rvm/gems/ruby-1.9.2-p290@vmware/gems/rbvmomi-1.4.0/lib/rbvmomi/basic_types.rb:69:in `block (2 levels) in init'
from (irb):12
from /usr/local/rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `

'
```

Any idea about this exception ? A hint to collect tasks < 24hrs ?

Thanks