Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] Web Services question

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] Web Services question


Chronological Thread 
  • From: Julio Polo <>
  • To: "Black, Carey M." <>, "" <>
  • Subject: Re: [grouper-users] Web Services question
  • Date: Mon, 14 Aug 2017 16:18:29 -1000
  • Ironport-phdr: 9a23:p8w4kRT5Hq7Inaab60lT8SxDJtpsv+yvbD5Q0YIujvd0So/mwa6ybRGN2/xhgRfzUJnB7Loc0qyN4vCmATRIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSijewZbB/IA+qoQnNq8IbnZZsJqEtxxXTv3BGYf5WxWRmJVKSmxbz+MK994N9/ipTpvws6ddOXb31cKokQ7NYCi8mM30u683wqRbDVwqP6WACXWgQjxFFHhLK7BD+Xpf2ryv6qu9w0zSUMMHqUbw5Xymp4rx1QxH0ligIKz858HnWisNuiqJbvAmhrAF7z4LNfY2ZKOZycqbbcNgHR2ROQ9xRWjRDDYOyb4UBAekPM/tGoYbhvFYBtweyCBO2Ce/z1jNFhHn71rA63eQ7FgHG2RQtEdYTsHTQrdX1M7oZX/qyzKnMyjXIcvRb2TXg6IjMcxAhpuqBXbJqfsvf00YvFgLFgk+OpoP4IjOYz+IAuHWV4epnUOKgkW8nqwdprziuwMcslpfGhpgTyl/a6SV13pw5KsOlR05mZ9OvDZhetzmCOodoQ84uX2NltSM0yrAFopG3YC0HxZs7yxLDdvCKdpSH7g7iWeuUJDp0mnxodbK5ih2v60av0Pf8WdOx0FtSripKjN3MtncV2hzW8MeHS/998l6g2TaIywzf8+5FLV46mKfbMZIhzbkwlp0csUTHACD6gln5jKiTdkk8++io7froYqn+q5OCNoJ4lgPzP6EgmsG8Gus0Lg0DUmeH9eigybHu+FH2TKlLg/Azl6TVrp7XKMQDqq68GQBV04Ij6xilDzeh1dQVhXsHLE9BeBKGiIjkIFHOL+r2DPilglSskS1nyO7bMb38GpnNNGTMkK/9fbZh7E5R0AUzzcpY55JJErEOPujzVlbstNzDEBA5KRe0zv3jCNV8zYMeRXmPDrGDPKPTt1+I+vwgI/OKZIALpDbxNeIp6ODzgn8kyhchevzj958eY3P8Vt9vOUiIKV+qyJ9VG2MDtQl4FbaxoFqZTHhea2vkG+p26Ss8FZqrF8LeXY23m5SA2ju2BJtbejoAB1yRWz+8eJ+DRu8BcmePOcJ7iRQFU6SsUYksyUvouQPnnelJNO3Rrw8FsZPknOBy4+qbwRMv8T1zJ8SUzGiMTid5kn5eFGx+57x2vUEokgTL6qN/mfENUIULv/4=

For A, you can do something like this (replace with your own Grouper version and attribute name/value, of course):

POST /grouper-ws/servicesRest/xml/v2_2_002/attributeAssignments

<WsRestGetAttributeAssignmentsRequest>
  <attributeAssignType>group</attributeAssignType>
  <wsAttributeDefNameLookups>
  <WsAttributeDefNameLookup>
   <name>path:to:your:attribute:name:here</name>
   <uuid></uuid>
  </WsAttributeDefNameLookup>
  </wsAttributeDefNameLookups>
  <theValue>theAttributeValueYouWantHere</theValue>
  <attributeDefValueType>string</attributeDefValueType>
  <includeAssignmentsOnAssignments>T</includeAssignmentsOnAssignments>
 </WsRestGetAttributeAssignmentsRequest>

For B, D and E, I would generally let my XML parser weed those out for me.  Are you writing your own XML parsing?  It might be easier to discard those unwanted items if you use JSON.  I don't know if there's a way to ask Grouper to return less data like you specified.  Let's see what the experts say about this.

For C, that's controlled by a combination of your Grouper properties and the XML you send (though this might have changed in newer versions, I really don't know).  You might find this old post helpful: 

https://lists.internet2.edu/sympa/arc/grouper-users/2015-09/msg00105.html

-julio

On Mon, Aug 14, 2017 at 10:22 AM, Black, Carey M. <> wrote:
I am trying to figure out if I can "fine tune" the retunes from the Grouper web services and I am not yet finding how to do what I want to do.
        ( I am guessing that some or all of this is already possible. And that I am just not seeing how to do it. )
        NOTE: My example below is an "XML format" but that is not a requirement. Just a convenient way to communicate an example.

So let me try to express what I want to do.

Web service call to grouper to:
        1) query grouper based on: the intersection of a specific subject and groups that have a custom attribute with a specific value.
        2) get a list of group attributes and/or group details that are desired in the return.



I have found this and it works for the search by "a specific subject" requirement:
.... /servicesRest/v2.3_000/subjects/

<WsRestGetGroupsRequest>
  <subjectLookups>
    <WsSubjectLookup>
      <subjectIdentifier>0123456789</subjectIdentifier>
    </WsSubjectLookup>
  </subjectLookups>
  <enabled>T</enabled>
  <includeGroupDetail>F</includeGroupDetail>
  <includeSubjectDetail>F</includeSubjectDetail>
</WsRestGetGroupsRequest>



However,
A) I cannot find a way to ask for an attribute to have a specific value on the group(s) as well.
B) I cannot find a way to only get specific details about the groups back.
C) I would also like to limited/control the attributes that are returned about the subject.
D) I would like to suppress the resultsMetaData block as well.
E) I would like to suppress the responseMetadata block as well.

Am I not seeing how to do these things, or are these features not available at this time?

Thanks in advance.






Details for the "However"s:

A) I cannot find a way to ask for an attribute to have a specific value on the group(s) as well.

I picture something like the following to be possible:
<findGroupsWithAttributeValue>
  <attributeName>custom_attribute_on_group</attributeName>
  <attributeValue>A_value_to_find</attributeValue>
</findGroupsWithAttributeValue>



B) I cannot find a way to only get specific details about the groups back.
        I want to limit the message size return/complexity.

Currently all of these values are returned:
"
<WsGroup>
        <extension>value</extension>
        <typeOfGroup>group</typeOfGroup>
        <displayExtension>value</displayExtension>
        <displayName>value_looks_like_path</displayName>
        <name> value_looks_like_path </name>
        <uuid>a_uuid_value</uuid>
        <idIndex>a_int_value</idIndex>
</WsGroup>
"

What I would like to be able to do is to supply a list of data elements that I want back and only get those.
Example: add something to the WsRestGetGroupsRequest element like:
         <getGroupAttrs>extension,uuid,custom_attribute_on_group</getGroupAttrs>

And have the return look like this for that call:
"
<WsGroup>
        <extension>value</extension>
        <uuid>a_uuid_value</uuid>
        <custom_attribute_on_group>a_int_value</custom_attribute_on_group>
</WsGroup>
"


C) I would also like to limited/control the attributes that are returned about the subject.
Currently all of these values are returned:
"
<wsSubject>
        <identifierLookup>subbject_value</identifierLookup>
        <resultCode>SUCCESS</resultCode>
        <success>T</success>
        <id>subject_id_value</id>
        <name>subject_name_string</name>
        <sourceId>source_ID</sourceId>
</wsSubject>
"

What I would like to be able to do is to supply a list of data elements that I want back and only get those.
Example: add something to the WsRestGetGroupsRequest element like:
         <getSubjectAttrs></getSubjectAttrs>   <-- returns no data about the subject
         <getSubjectAttrs>id,name</getSubjectAttrs>   <-- returns only id and name


D) I would like to suppress the resultsMetaData block as well.
        Maybe add a <includeMetaDetail> =[T,F] like the includeGroupDetail flag?

E) I would like to suppress the responseMetadata block as well.
        Maybe add a <responseMetadata> =[T,F] like the includeGroupDetail flag?


--
Carey Matthew




Archive powered by MHonArc 2.6.19.

Top of Page