Software Development Kit (SDK) and API Discussions

perf-object-get-instances ignoring arguments

This has been discussed in other threads (https://communities.netapp.com/thread/1405). I have been teaching myself Ruby and have found that no matter how I try to pass arguments to perf-object-get-instances it will always ignore the counters and instances arguements. For instance, when looking at aggregate performance I have been trying to get the API to return on the total_transfers counter on one aggregate. The following snippet will restrict the output to aggr0, but returns all the counters for that aggregate.

aggr_perf = s.invoke("perf-object-get-instances", "objectname", "aggregate", "instances", "aggr0", "counters", "total_transfers")

aggr_perf.child_get("instances").child_get("instance-data").child_get("counters").children_get.each do |counter|

  puts counter.child_get_string("name") + " ==> " + counter.child_get_string("value")

end

Perhaps I'm coding this incorrectly?

3 REPLIES

Re: perf-object-get-instances ignoring arguments

rle Netapp Alumni

Hi Mathew -

The invoke method doesn't take array inputs.  Please use zexplorer for testing and code generation.  Also the example perf_operatioin.rb in the SDK code example directory is helpful.  In the meantime, the code below should help.

pogi = NaElement.new("perf-object-get-instances");

pogi.child_add_string("objectname", "aggregate");

counters = NaElement.new("counters");

counters.child_add_string("counter", "total_transfers");

pogi.child_add(counters);

instances = NaElement.new("instances");

instances.child_add_string("instance", "aggr0");

Regards,

   - Rick -

pogi.child_add(instanes);

aggr_perf = s.invoke_elem(pogi);


Re: perf-object-get-instances ignoring arguments

Rick,

Thanks for your post. It pointed me in the right direction, so I was able to code something in Perl. I wrote it up here: https://communities.netapp.com/thread/24839

It's probably too late for the original poster, but I'm adding this comment in case it helps someone else when they search the web site.

Thanks,

Chris

Re: perf-object-get-instances ignoring arguments

rle Netapp Alumni

Thanks Chris for an excellent post.  I will put it in my blog.

Regards,

   - Rick -

Forums