Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Accepts multiple groups or subjects or memberhipIds (or combination) etc, attribute definitions, actions, etc to assign
  • Documentation: SOAP (click on assignAttributes), REST (click on assignAttributes)
  • REST request (colon is escaped to %3A):
    • POST /grouper-ws/servicesRest/v1_6_000/assignAttributes
  • (see documentation above for details): Request object, response object
  • Response codes overall
  • Returns an overall status
  • Samples (all files without "Lite" in them, click on "download" to see files)
  • Samples with value assignment

Assign attribute to any membership (doesnt have to be direct)

Code Block
WebService: connecting to URL: 'http://localhost:8080/grouper-ws/servicesRest/2.6.0/attributeAssignments'

################ REQUEST START (indented) ###############

POST /grouper-ws/servicesRest/2.6.0/attributeAssignments HTTP/1.1
Connection: close
Authorization: Basic xxxxxxxxxxxxxxxx
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:8080
Content-Length: 311
Content-Type: application/json; charset=UTF-8

{
  "WsRestAssignAttributesRequest":{
    "attributeAssignOperation":"assign_attr",
    "attributeAssignType":"any_mem",
    "wsAttributeDefNameLookups":[
      {
        "name":"test:attr"
      }
    ]
    ,
    "wsOwnerMembershipAnyLookups":[
      {
        "wsGroupLookup":{
          "groupName":"etc:wsGroup"
        },
        "wsSubjectLookup":{
          "subjectId":"GrouperSystem",
          "subjectSourceId":"g:isa"
        }
      }
    ]
  }
}

################ REQUEST END ###############



################ RESPONSE START (indented) ###############

HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=xxxxxxxxxxxx; HttpOnly
X-Grouper-resultCode: SUCCESS
X-Grouper-success: T
X-Grouper-resultCode2: NONE
Content-Type: application/json;charset=UTF-8
Content-Length: 2253
Date: Tue, 11 Oct 2022 17:45:37 GMT
Connection: close

{
  "WsAssignAttributesResults":{
    "resultMetadata":{
      "success":"T",
      "resultCode":"SUCCESS",
      "resultMessage":", Found 1 results."
    },
    "wsMemberships":[
    ]
    ,
    "wsStems":[
    ]
    ,
    "wsAttributeDefs":[
      {
        "attributeDefType":"attr",
        "assignToAttributeDef":"F",
        "assignToStemAssignment":"F",
        "extension":"attrDef",
        "assignToMemberAssignment":"F",
        "assignToEffectiveMembership":"F",
        "uuid":"77c905289a374962b779a74d579cb2cd",
        "assignToImmediateMembershipAssignment":"F",
        "assignToEffectiveMembershipAssignment":"F",
        "assignToStem":"F",
        "assignToGroupAssignment":"F",
        "assignToMember":"F",
        "multiAssignable":"F",
        "valueType":"marker",
        "name":"test:attrDef",
        "assignToAttributeDefAssignment":"F",
        "idIndex":"10080",
        "multiValued":"F",
        "assignToGroup":"F",
        "assignToImmediateMembership":"F"
      }
    ]
    ,
    "responseMetadata":{
      "serverVersion":"2.6.0",
      "millis":"653"
    },
    "wsGroups":[
      {
        "extension":"wsGroup",
        "displayName":"etc:wsGroup",
        "description":"wsGroup",
        "uuid":"bd7831a9c01e435bba1a628f0feef150",
        "enabled":"T",
        "displayExtension":"wsGroup",
        "name":"etc:wsGroup",
        "typeOfGroup":"group",
        "idIndex":"10068"
      }
    ]
    ,
    "wsAttributeDefNames":[
      {
        "attributeDefId":"77c905289a374962b779a74d579cb2cd",
        "displayExtension":"attr",
        "extension":"attr",
        "displayName":"test:attr",
        "name":"test:attr",
        "attributeDefName":"test:attrDef",
        "idIndex":"10298",
        "uuid":"16c46d4aca6c4ef7aaf02209a31c3242"
      }
    ]
    ,
    "wsAttributeAssignResults":[
      {
        "deleted":"F",
        "wsAttributeAssigns":[
          {
            "attributeAssignDelegatable":"FALSE",
            "ownerMemberSourceId":"g:isa",
            "disallowed":"F",
            "createdOn":"2022/10/11 13:45:36.844",
            "enabled":"T",
            "attributeAssignType":"any_mem",
            "attributeDefId":"77c905289a374962b779a74d579cb2cd",
            "lastUpdated":"2022/10/11 13:45:36.844",
            "attributeAssignActionId":"de9ea3d237cb4fe09124791f43fc9b31",
            "ownerGroupName":"etc:wsGroup",
            "id":"bdb45214baad436c8402630e6571f059",
            "ownerGroupId":"bd7831a9c01e435bba1a628f0feef150",
            "ownerMemberSubjectId":"GrouperSystem",
            "ownerMemberId":"585c7be534fe4926bbe9c571a36d2e22",
            "attributeDefName":"test:attrDef",
            "attributeDefNameName":"test:attr",
            "attributeAssignActionName":"assign",
            "attributeDefNameId":"16c46d4aca6c4ef7aaf02209a31c3242",
            "attributeAssignActionType":"immediate"
          }
        ]
        ,
        "valuesChanged":"F",
        "changed":"T"
      }
    ]
    ,
    "wsSubjects":[
      {
        "sourceId":"g:isa",
        "success":"T",
        "name":"GrouperSysAdmin",
        "resultCode":"SUCCESS",
        "id":"GrouperSystem"
      }
    ]
  }
}

################ RESPONSE END ###############


Assign value example

Code Block
If this is an assignment on an assignment, you first need to query to get the attribute assign id where the value is


[mchyzer@flash pennGroupsClient-2.3.0]$ java -jar grouperClient.jar --operation=getAttributeAssignmentsWs --attributeAssignType=group --includeAssignmentsOnAssignments=true --ownerGroupNames=a:b:c:groupName --debug=true

POST /grouperWs/servicesRest/v2_3_000/attributeAssignments HTTP/1.1
Connection: close
Authorization: Basic xxxxxxxxxxxxxxxx
User-Agent: Jakarta Commons-HttpClient/3.1
Host: grouperws.apps.upenn.edu:-1
Content-Length: 321
Content-Type: text/xml; charset=UTF-8

<WsRestGetAttributeAssignmentsRequest>
  <attributeAssignType>group</attributeAssignType>
  <wsOwnerGroupLookups>
    <WsGroupLookup>
      <groupName>a:b:c:groupName</groupName>
    </WsGroupLookup>
  </wsOwnerGroupLookups>
  <includeAssignmentsOnAssignments>T</includeAssignmentsOnAssignments>
</WsRestGetAttributeAssignmentsRequest>

################ RESPONSE START (indented) ###############

HTTP/1.1 200 OK
Date: Mon, 23 Apr 2018 12:43:25 GMT
Set-Cookie: JSESSIONID=xxxxxxxxxxxx; Path=/grouperWs
X-Grouper-resultCode: SUCCESS
X-Grouper-success: T
X-Grouper-resultCode2: NONE
Content-Type: text/xml;charset=UTF-8
Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked
Set-Cookie: BIGipServerPFA-grouperws_pool=3810792620.20480.0000; expires=Mon, 23-Apr-2018 18:43:26 GMT; path=/; Httponly; Secure

<WsGetAttributeAssignmentsResults>
    <WsAttributeDefName>
      <idIndex>12892</idIndex>
      <extension>legacyAttribute_grouperLoaderQuartzCron</extension>
      <displayExtension>legacyAttribute_grouperLoaderQuartzCron</displayExtension>
      <displayName>etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron</displayName>
      <name>etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron</name>
      <uuid>ff79e20c06314ee380bb492def9de796</uuid>
      <attributeDefId>ef7039cf58b34783b6b012cc4799073e</attributeDefId>
      <attributeDefName>etc:legacy:attribute:legacyAttributeDef_grouperLoader</attributeDefName>
    </WsAttributeDefName>
    <WsAttributeAssign>
      <disallowed>F</disallowed>
      <attributeAssignActionType>immediate</attributeAssignActionType>
      <attributeAssignDelegatable>FALSE</attributeAssignDelegatable>
      <attributeAssignActionId>d459f64e432e4820a4b79de775fd0ab1</attributeAssignActionId>
      <attributeAssignActionName>assign</attributeAssignActionName>
      <attributeAssignType>group_asgn</attributeAssignType>
      <attributeDefNameId>ff79e20c06314ee380bb492def9de796</attributeDefNameId>
      <attributeDefNameName>etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron</attributeDefNameName>
      <attributeDefId>ef7039cf58b34783b6b012cc4799073e</attributeDefId>
      <attributeDefName>etc:legacy:attribute:legacyAttributeDef_grouperLoader</attributeDefName>
      <wsAttributeAssignValues>
        <WsAttributeAssignValue>
          <id>285dd3e3e3bf4f78955a67395de7e8df</id>
          <valueSystem>0 15 7 * * ?</valueSystem>
        </WsAttributeAssignValue>
      </wsAttributeAssignValues>
      <createdOn>2016/07/09 23:06:37.253</createdOn>
      <enabled>T</enabled>
      <id>781992a9dc0e4b58a0202e9b24e94f87</id>
      <lastUpdated>2016/07/09 23:06:37.253</lastUpdated>
      <ownerAttributeAssignId>ddf1e57538af4b3aaf4b0673b5803511</ownerAttributeAssignId>
    </WsAttributeAssign>
  </wsAttributeAssigns>
  <resultMetadata>
    <resultCode>SUCCESS</resultCode>
    <resultMessage>, Found 11 results.  </resultMessage>
    <success>T</success>
  </resultMetadata>
  <responseMetadata>
    <resultWarnings></resultWarnings>
    <millis>590</millis>
    <serverVersion>2.3.0</serverVersion>
  </responseMetadata>
  <wsGroups>
    <WsGroup>
      <extension>groupName</extension>
      <typeOfGroup>group</typeOfGroup>
      <displayExtension>groupName</displayExtension>
      <displayName>a:b:c:groupName</displayName>
      <name> a:b:c:groupName </name>
      <uuid>d836336699e24404a442a1cfb2027a6c</uuid>
      <idIndex>194760</idIndex>
    </WsGroup>
  </wsGroups>
  <wsStems/>
  <wsMemberships/>
  <wsSubjects/>
</WsGetAttributeAssignmentsResults>


####################################################
Then assign the value:


[mchyzer@flash pennGroupsClient-2.3.0]$ java -jar grouperClient.jar --operation=assignAttributesWs --attributeAssignOperation=assign_attr --attributeAssignType=group_asgn --ownerAttributeAssignUuids=ddf1e57538af4b3aaf4b0673b5803511 --attributeDefNameNames=penn:etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron --attributeAssignValueOperation=replace_values --values0System="0 16 7 * * ?" --debug=true

################ REQUEST START (indented) ###############

POST /grouperWs/servicesRest/v2_3_000/attributeAssignments HTTP/1.1
Connection: close
Authorization: Basic xxxxxxxxxxxxxxxx
User-Agent: Jakarta Commons-HttpClient/3.1
Host: grouperws.apps.upenn.edu:-1
Content-Length: 707
Content-Type: text/xml; charset=UTF-8

<WsRestAssignAttributesRequest>
  <attributeAssignOperation>assign_attr</attributeAssignOperation>
  <attributeAssignValueOperation>replace_values</attributeAssignValueOperation>
  <wsOwnerAttributeAssignLookups>
    <WsAttributeAssignLookup>
      <uuid>ddf1e57538af4b3aaf4b0673b5803511</uuid>
    </WsAttributeAssignLookup>
  </wsOwnerAttributeAssignLookups>
  <values>
    <WsAttributeAssignValue>
      <valueSystem>0 16 7 * * ?</valueSystem>
    </WsAttributeAssignValue>
  </values>
  <attributeAssignType>group_asgn</attributeAssignType>
  <wsAttributeDefNameLookups>
    <WsAttributeDefNameLookup>
      <name>penn:etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron</name>
    </WsAttributeDefNameLookup>
  </wsAttributeDefNameLookups>
</WsRestAssignAttributesRequest>

################ REQUEST END ###############

################ RESPONSE START (indented) ###############

HTTP/1.1 200 OK
Date: Mon, 23 Apr 2018 13:09:14 GMT
Set-Cookie: JSESSIONID=xxxxxxxxxxxx; Path=/grouperWs
X-Grouper-resultCode: SUCCESS
X-Grouper-success: T
X-Grouper-resultCode2: NONE
Content-Type: text/xml;charset=UTF-8
Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked
Set-Cookie: BIGipServerPFA-grouperws_pool=3861124268.20480.0000; expires=Mon, 23-Apr-2018 19:09:15 GMT; path=/; Httponly; Secure

<WsAssignAttributesResults>
  <wsAttributeDefs>
    <WsAttributeDef>
      <idIndex>10046</idIndex>
      <extension>legacyAttributeDef_grouperLoader</extension>
      <name>etc:legacy:attribute:legacyAttributeDef_grouperLoader</name>
      <uuid>ef7039cf58b34783b6b012cc4799073e</uuid>
      <attributeDefType>attr</attributeDefType>
      <multiAssignable>F</multiAssignable>
      <multiValued>F</multiValued>
      <valueType>string</valueType>
      <assignToAttributeDef>F</assignToAttributeDef>
      <assignToAttributeDefAssignment>F</assignToAttributeDefAssignment>
      <assignToEffectiveMembership>F</assignToEffectiveMembership>
      <assignToEffectiveMembershipAssignment>F</assignToEffectiveMembershipAssignment>
      <assignToGroup>F</assignToGroup>
      <assignToGroupAssignment>F</assignToGroupAssignment>
      <assignToImmediateMembership>F</assignToImmediateMembership>
      <assignToImmediateMembershipAssignment>F</assignToImmediateMembershipAssignment>
      <assignToMember>F</assignToMember>
      <assignToMemberAssignment>F</assignToMemberAssignment>
      <assignToStem>F</assignToStem>
      <assignToStemAssignment>F</assignToStemAssignment>
    </WsAttributeDef>
  </wsAttributeDefs>
  <wsAttributeDefNames>
    <WsAttributeDefName>
      <idIndex>12892</idIndex>
      <extension>legacyAttribute_grouperLoaderQuartzCron</extension>
      <displayExtension>legacyAttribute_grouperLoaderQuartzCron</displayExtension>
      <displayName>etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron</displayName>
      <name>etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron</name>
      <uuid>ff79e20c06314ee380bb492def9de796</uuid>
      <attributeDefId>ef7039cf58b34783b6b012cc4799073e</attributeDefId>
      <attributeDefName>etc:legacy:attribute:legacyAttributeDef_grouperLoader</attributeDefName>
    </WsAttributeDefName>
  </wsAttributeDefNames>
  <wsAttributeAssignResults>
    <WsAssignAttributeResult>
      <wsAttributeAssignValueResults>
        <WsAttributeAssignValueResult>
          <changed>T</changed>
          <deleted>T</deleted>
          <wsAttributeAssignValue>
            <id>285dd3e3e3bf4f78955a67395de7e8df</id>
            <valueSystem>0 15 7 * * ?</valueSystem>
          </wsAttributeAssignValue>
        </WsAttributeAssignValueResult>
        <WsAttributeAssignValueResult>
          <changed>T</changed>
          <deleted>F</deleted>
          <wsAttributeAssignValue>
            <id>4b6c8b5df143448994ceaf6aed68856c</id>
            <valueSystem>0 16 7 * * ?</valueSystem>
          </wsAttributeAssignValue>
        </WsAttributeAssignValueResult>
      </wsAttributeAssignValueResults>
      <wsAttributeAssigns>
        <WsAttributeAssign>
          <disallowed>F</disallowed>
          <attributeAssignActionType>immediate</attributeAssignActionType>
          <attributeAssignDelegatable>FALSE</attributeAssignDelegatable>
          <attributeAssignActionId>d459f64e432e4820a4b79de775fd0ab1</attributeAssignActionId>
          <attributeAssignActionName>assign</attributeAssignActionName>
          <attributeAssignType>group_asgn</attributeAssignType>
          <attributeDefNameId>ff79e20c06314ee380bb492def9de796</attributeDefNameId>
          <attributeDefNameName>etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron</attributeDefNameName>
          <attributeDefId>ef7039cf58b34783b6b012cc4799073e</attributeDefId>
          <attributeDefName>etc:legacy:attribute:legacyAttributeDef_grouperLoader</attributeDefName>
          <wsAttributeAssignValues>
            <WsAttributeAssignValue>
              <id>4b6c8b5df143448994ceaf6aed68856c</id>
              <valueSystem>0 16 7 * * ?</valueSystem>
            </WsAttributeAssignValue>
          </wsAttributeAssignValues>
          <createdOn>2016/07/09 23:06:37.253</createdOn>
          <enabled>T</enabled>
          <id>781992a9dc0e4b58a0202e9b24e94f87</id>
          <lastUpdated>2016/07/09 23:06:37.253</lastUpdated>
          <ownerAttributeAssignId>ddf1e57538af4b3aaf4b0673b5803511</ownerAttributeAssignId>
        </WsAttributeAssign>
      </wsAttributeAssigns>
      <changed>F</changed>
      <valuesChanged>T</valuesChanged>
      <deleted>F</deleted>
    </WsAssignAttributeResult>
  </wsAttributeAssignResults>
  <resultMetadata>
    <resultCode>SUCCESS</resultCode>
    <resultMessage>, Found 1 results.  </resultMessage>
    <success>T</success>
  </resultMetadata>
  <responseMetadata>
    <resultWarnings></resultWarnings>
    <millis>1216</millis>
    <serverVersion>2.3.0</serverVersion>
  </responseMetadata>
  <wsGroups/>
  <wsStems/>
  <wsMemberships/>
  <wsSubjects/>
</WsAssignAttributesResults>


...