Software Development Kit (SDK) and API Discussions

how to provide group name for group-member-list-iter-start

HASMIK_HAYRAPETYAN
2,814 Views

Hi,

I have DFM 4.0 Server and use it's API to retrieve members of specific group using group-member-list-iter-start/next/end command.

For this command, according to the documentation, I have to specify either groups or type or both. I want to get all members of a group, so I specify group name only.

This is what I do:

1   NaElement input = new NaElement("group-member-list-iter-start");

2   input.addNewChild("object-name-or-id", "lunsGroup");

3   NaElement output = server.invokeElem(input);

4   String records = output.getChildContent("records");

5   if (!records.equals("0")) {

6   String tag = output.getChildContent("tag");

7   input = new NaElement("group-member-list-iter-next");

8   input.addNewChild("maximum", records);

9   input.addNewChild("tag", tag);

10 output = server.invokeElem(input);

11}

But I get exception on line 3 - "netapp.manage.NaAPIFailedException: You must specify type when listing objects in global group. (errno=13001)"

It seems it can't get provided group name if it speaks about global group and requires to specify type.

Did I provide group name on line 2 in a wrong way? If so, then how can I do that correctly?

Regards,

Hasmik

1 ACCEPTED SOLUTION

HASMIK_HAYRAPETYAN
2,814 Views

I found the answer.

I was adding group names in a wrong way.

Here is the right one:

1.   NaElement input = new NaElement("group-member-list-iter-start");

2.   NaElement groups = new NaElement("groups");

3.   groups.addNewChild("group", "lunsGroup");

4.   input.addChildElem(groups);

5.   NaElement output = server.invokeElem(input);

6.   String records = output.getChildContent(DFMOperationConstants.DFM_RECORDS);

7.   if (!records.equals("0")) {

8.   String tag = output.getChildContent(DFMOperationConstants.DFM_TAG);

9.   input = new NaElement("group-member-list-iter-next");

10. input.addNewChild(DFMOperationConstants.DFM_MAXIMUM, records);

11. input.addNewChild(DFMOperationConstants.DFM_TAG, tag);

12. output = server.invokeElem(input);

13. }

View solution in original post

1 REPLY 1

HASMIK_HAYRAPETYAN
2,815 Views

I found the answer.

I was adding group names in a wrong way.

Here is the right one:

1.   NaElement input = new NaElement("group-member-list-iter-start");

2.   NaElement groups = new NaElement("groups");

3.   groups.addNewChild("group", "lunsGroup");

4.   input.addChildElem(groups);

5.   NaElement output = server.invokeElem(input);

6.   String records = output.getChildContent(DFMOperationConstants.DFM_RECORDS);

7.   if (!records.equals("0")) {

8.   String tag = output.getChildContent(DFMOperationConstants.DFM_TAG);

9.   input = new NaElement("group-member-list-iter-next");

10. input.addNewChild(DFMOperationConstants.DFM_MAXIMUM, records);

11. input.addNewChild(DFMOperationConstants.DFM_TAG, tag);

12. output = server.invokeElem(input);

13. }

Public