Versions Compared

Key

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

...

  • Accepts multiple groups or subjects or membershipIds (or combination) etc, attribute definitions, actions, etc to assign
  • Documentation: SOAP (click on assignAttributesBatch), REST (click on assignAttributesBatch)
  • REST request (colon is escaped to %3A):
    • POST /grouper-ws/servicesRest/v2_1_002/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)

Example

Make multiple assignments in a batch

Expand


Code Block
[mchyzer@flash pennGroupsClient-2.6.0]$ java -jar grouperClient-2.6.13.jar --operation=assignAttributesBatchWs --entry_0_attributeAssignType=any_mem --entry_0_attributeAssignOperation=assign_attr --entry_0_nameOfAttributeDefName=test:testAttestation:testAttr --entry_0_ownerMembershipAnySubjectIdentifier=mchyzer --entry_0_ownerMembershipAnyGroupName=test:testGroup1 --entry_0_attributeAssignValueOperation=assign_value --entry_0_values0System=hey --entry_1_attributeAssignType=any_mem --entry_1_attributeAssignOperation=assign_attr --entry_1_nameOfAttributeDefName=test:testAttestation:testAttr --entry_1_ownerMembershipAnySubjectIdentifier=kwilso --entry_1_ownerMembershipAnyGroupName=test:testGroup2 --entry_1_attributeAssignValueOperation=assign_value --entry_1_values0System=there --debug=true
Reading resource: grouper.client.properties, from: /home/mchyzer/grouper/pennGroupsClient-2.6.0/grouper.client.properties
WebService: connecting as user: 'abc123.upenn.edu'
WebService: connecting to URL: 'https://server.whatever.edu/grouperWs/servicesRest/2.6.13/attributeAssignments'

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

POST /grouperWs/servicesRest/2.6.13/attributeAssignments HTTP/1.1
Connection: close
Authorization: Basic xxxxxxxxxxxxxxxx
User-Agent: Jakarta Commons-HttpClient/3.1
Host: grouperWs.apps.upenn.edu:-1
Content-Length: 779
Content-Type: application/json; charset=UTF-8

{
  "WsRestAssignAttributesBatchRequest":{
    "wsAssignAttributeBatchEntries":[
      {
        "attributeAssignType":"any_mem",
        "wsAttributeDefNameLookup":{
          "name":"test:testAttestation:testAttr"
        },
        "attributeAssignOperation":"assign_attr",
        "values":[
          {
            "valueSystem":"hey"
          }
        ]
        ,
        "attributeAssignValueOperation":"assign_value",
        "wsOwnerMembershipAnyLookup":{
          "wsGroupLookup":{
            "groupName":"test:testGroup1"
          },
          "wsSubjectLookup":{
            "subjectIdentifier":"mchyzer"
          }
        }
        
      },
      {
        "attributeAssignType":"any_mem",
        "wsAttributeDefNameLookup":{
          "name":"test:testAttestation:testAttr"
        },
        "attributeAssignOperation":"assign_attr",
        "values":[
          {
            "valueSystem":"there"
          }
        ]
        ,
        "attributeAssignValueOperation":"assign_value",
        "wsOwnerMembershipAnyLookup":{
          "wsGroupLookup":{
            "groupName":"test:testGroup2"
          },
          "wsSubjectLookup":{
            "subjectIdentifier":"kwilso"
          }
        }
      }
    ]
  }
}

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



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

HTTP/1.1 200 OK
Date: Sat, 17 Sep 2022 14:09:53 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 4504
Connection: close
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips
Strict-Transport-Security: max-age=15768000
X-Grouper-resultCode: SUCCESS
X-Grouper-success: T
X-Grouper-resultCode2: NONE

{
  "WsAssignAttributesBatchResults":{
    "resultMetadata":{
      "success":"T",
      "resultCode":"SUCCESS",
      "resultMessage":"Success for: clientVersion: 2.6.13, includeSubjectDetail: false, actAsSubject: null, subjectAttributeNames: null\n, paramNames: \n, params: null\n, wsAssignAttributeBatchEntries: 0. wsAssignAttributeBatchEntry: attributeAssignOperation: assign_attr, attributeAssignType: any_mem, attributeAssignValueOperation: assign_value, values: 0. valueSystem: hey, , wsAttributeDefNameLookup: WsAttributeDefNameLookup[pitAttributeDefNames=[],name=test:testAttestation:testAttr], wsOwnerMembershipAnyLookup: WsMembershipAnyLookup[\n  wsGroupLookup=WsGroupLookup[pitGroups=[],groupName=test:testGroup1],\n  wsSubjectLookup=WsSubjectLookup[subjectIdentifier=mchyzer]],"
    },
    "wsAssignAttributeBatchResultArray":[
      {
        "wsAttributeAssignValueResults":[
          {
            "deleted":"F",
            "wsAttributeAssignValue":{
              "id":"46ddf78f20f74103b4ae5e34d206aefa",
              "valueSystem":"hey"
            },
            "changed":"T"
          }
        ]
        ,
        "resultMetadata":{
          "success":"T",
          "resultCode":"SUCCESS",
          "resultMessage":", Found 1 results."
        },
        "deleted":"F",
        "wsAttributeAssigns":[
          {
            "attributeAssignDelegatable":"FALSE",
            "ownerMemberSourceId":"pennperson",
            "disallowed":"F",
            "createdOn":"2022/09/17 10:08:51.811",
            "enabled":"T",
            "attributeAssignType":"any_mem",
            "attributeDefId":"4f7796d2aacf4688bb177fc668be699f",
            "lastUpdated":"2022/09/17 10:08:51.811",
            "attributeAssignActionId":"531b0bee1a5d47d38fce853423ba8612",
            "ownerGroupName":"test:testGroup1",
            "id":"01bc86f79b2d4ff59e7c15fc6fda2102",
            "wsAttributeAssignValues":[
              {
                "id":"46ddf78f20f74103b4ae5e34d206aefa",
                "valueSystem":"hey"
              }
            ]
            ,
            "ownerGroupId":"87f3010b795349ad89d2b52f9067f325",
            "ownerMemberSubjectId":"10021368",
            "ownerMemberId":"c5c8ef55-76be-4b0d-9910-9efbf465cff3",
            "attributeDefName":"test:testAttestation:testDef",
            "attributeDefNameName":"test:testAttestation:testAttr",
            "attributeAssignActionName":"assign",
            "attributeDefNameId":"f1aa75834d2248d0999c469875bfe08d",
            "attributeAssignActionType":"immediate"
          }
        ]
        ,
        "valuesChanged":"T",
        "changed":"F"
      },
      {
        "wsAttributeAssignValueResults":[
          {
            "deleted":"F",
            "wsAttributeAssignValue":{
              "id":"303a307e169e45a193ccde9d53d11923",
              "valueSystem":"there"
            },
            "changed":"T"
          }
        ]
        ,
        "resultMetadata":{
          "success":"T",
          "resultCode":"SUCCESS",
          "resultMessage":", Found 1 results."
        },
        "deleted":"F",
        "wsAttributeAssigns":[
          {
            "attributeAssignDelegatable":"FALSE",
            "ownerMemberSourceId":"pennperson",
            "disallowed":"F",
            "createdOn":"2022/09/17 10:08:52.224",
            "enabled":"T",
            "attributeAssignType":"any_mem",
            "attributeDefId":"4f7796d2aacf4688bb177fc668be699f",
            "lastUpdated":"2022/09/17 10:08:52.224",
            "attributeAssignActionId":"531b0bee1a5d47d38fce853423ba8612",
            "ownerGroupName":"test:testGroup2",
            "id":"7c8ce4895dc647179525287970ed75f4",
            "wsAttributeAssignValues":[
              {
                "id":"303a307e169e45a193ccde9d53d11923",
                "valueSystem":"there"
              }
            ]
            ,
            "ownerGroupId":"29946725aa514e0cb7bb4864625cfda0",
            "ownerMemberSubjectId":"89505485",
            "ownerMemberId":"632371c4be434c68b1f27bf546aca6e3",
            "attributeDefName":"test:testAttestation:testDef",
            "attributeDefNameName":"test:testAttestation:testAttr",
            "attributeAssignActionName":"assign",
            "attributeDefNameId":"f1aa75834d2248d0999c469875bfe08d",
            "attributeAssignActionType":"immediate"
          }
        ]
        ,
        "valuesChanged":"T",
        "changed":"F"
      }
    ]
    ,
    "wsAttributeDefs":[
      {
        "attributeDefType":"attr",
        "assignToAttributeDef":"F",
        "assignToStemAssignment":"F",
        "extension":"testDef",
        "assignToMemberAssignment":"F",
        "assignToEffectiveMembership":"F",
        "uuid":"4f7796d2aacf4688bb177fc668be699f",
        "assignToImmediateMembershipAssignment":"F",
        "assignToEffectiveMembershipAssignment":"F",
        "assignToStem":"F",
        "assignToGroupAssignment":"F",
        "assignToMember":"F",
        "multiAssignable":"F",
        "valueType":"string",
        "name":"test:testAttestation:testDef",
        "assignToAttributeDefAssignment":"F",
        "idIndex":"10544",
        "multiValued":"F",
        "assignToGroup":"F",
        "assignToImmediateMembership":"F"
      }
    ]
    ,
    "responseMetadata":{
      "serverVersion":"2.6.13",
      "millis":"272"
    },
    "wsGroups":[
      {
        "extension":"testGroup1",
        "displayName":"test:testGroup1",
        "uuid":"87f3010b795349ad89d2b52f9067f325",
        "enabled":"T",
        "displayExtension":"testGroup1",
        "name":"test:testGroup1",
        "typeOfGroup":"group",
        "idIndex":"500713"
      }
    ]
    ,
    "wsAttributeDefNames":[
      {
        "attributeDefId":"4f7796d2aacf4688bb177fc668be699f",
        "displayExtension":"testAttr",
        "extension":"testAttr",
        "displayName":"test:testAttestation:testAttr",
        "name":"test:testAttestation:testAttr",
        "attributeDefName":"test:testAttestation:testDef",
        "idIndex":"68544",
        "uuid":"f1aa75834d2248d0999c469875bfe08d"
      }
    ]
    ,
    "wsSubjects":[
      {
        "sourceId":"pennperson",
        "success":"T",
        "name":"Chris Hyzer",
        "resultCode":"SUCCESS",
        "id":"10021368"
      }
    ]
  }
}

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