Closed frodopwns closed 7 years ago
Looks like the only attribute being requested is the name:
<volume-get-iter>
<desired-attributes>
<volume-attributes>
<volume-id-attributes>
<name></name>
</volume-id-attributes>
</volume-attributes>
</desired-attributes>
<max-records>4294967294</max-records>
<query>
<volume-attributes>
<volume-id-attributes>
<name>ecorson_test_volume*</name>
</volume-id-attributes>
</volume-attributes>
</query>
</volume-get-iter>
How can I get the other attributes?
Hi @frodopwns,
The zapi library in netappdvp isn't really designed to be used in a general purpose manor and isn't supported in such a capacity. It's a very limited subset of calls specifically tailored to netappdvp's needs.
The reason you're only getting the name back is because netappdvp only needs that field and it's puts less load on the server to filter the requests like that.
If you want to explore the API you'd be better off using the official NetApp Manageability SDK available for download at mysupport.netapp.com.
@adkerr
Understood. Thanks for the quick response. It does look like I can reuse some of your code and if I clone the Zapi runner I could add the attributes I'm looking for:
queryVolIdAttrs := azgo.NewVolumeIdAttributesType().SetName(azgo.VolumeNameType(prefix + "*"))
query := azgo.NewVolumeAttributesType().SetVolumeIdAttributes(*queryVolIdAttrs)
// Limit the returned data to only the FlexVol names
desiredVolIdAttrs := azgo.NewVolumeIdAttributesType().SetName("")
VolOtheratt := azgo.NewVolumeSpaceAttributesType().SetPercentageSizeUsed(0)
desiredAttributes := azgo.NewVolumeAttributesType().SetVolumeIdAttributes(*desiredVolIdAttrs)
desiredAttributes.SetVolumeSpaceAttributes(*VolOtheratt)
response, err = azgo.NewVolumeGetIterRequest().
SetMaxRecords(maxZapiRecords). // Is there any value in iterating?
SetQuery(*query).
SetDesiredAttributes(*desiredAttributes).
ExecuteUsing(d.zr)
If I use your SDK and want to use Golang, won't I still have to duplicate a lot of what you have already done here?
Yes, unfortunately go isn't officially supported in the sdk. :(
You can also get ALL attributes by removing the desired-attributes section entirely from your request.
PSH, Go is the future! Thanks for that tip...will come in handy.
Is your team going to be using this library or is it going to go away?
Afaik we're going to continue using this library for the foreseeable future
Awesome! I am building a POC for my company using this. I will happily chime in here if I find anything useful.
Thanks and have a great weekend!
Hello everyone!
I am using the go api in
netappdvp/apis/ontap/
to interact with a netpp ontap api. I can list volumes, create volumes, and delete them.Now I'd like to learn things about my volumes like space availability. I noticed there are some promising attributes in the Result that is returned from VolumeList but almost everything in there is a nil pointer. Is this expect behavior? If not can anyone point me toward a solution?
Here is a sample return from VolumeList (converted to json):