Pattern acl api, Group and member api – Google Search Appliance Policy ACL API Developers Guide User Manual
Page 14

Google Search Appliance: Policy ACL API Developer’s Guide
Policy ACL API Developer’s Guide
14
In the constructor that follows, replace myUserId and myPassword with your Admin Console
authentication information:
GsaService service = new GsaService(gsaAddr, "myUserId", "myPassword");
Pattern ACL API
The code in the sections that follow specifies the URL pattern for a rule.
Creating an ACL Rule
To create an ACL rule:
GsaEntry entry = new GsaEntry();
entry.AddGsaContent("urlPattern", "http://example.com");
entry.AddGsaContent("acl", "group:testGroup user:john");
service.InsertEntry("policyAcls", entry);
Retrieving ACL Rules
To retrieve all ACL rules:
GsaFeed feed = service.GetFeed("policyAcls");
To retrieve an ACL rule for a URL pattern:
GsaEntry entry = service.GetEntry("policyAcls", "http://example.com");
Updating an ACL Rule
To update an ACL rule:
GsaEntry entry = new GsaEntry();
entry.AddGsaContent("urlPattern", "http://abc2.com");
entry.AddGsaContent("acl", "group:testGroup user:john");
service.UpdateEntry("policyAcls", "http://example.com", entry);
Deleting an ACL Rule
To delete an ACL rule:
service.DeleteEntry("policyAcls", "http://example.com");
Group and Member API
The code in the sections that follow specifies which users and groups are allowed to access a URL
pattern that you set in the pattern ACL API.