Google Search Appliance Policy ACL API Developers Guide Manuale Utente Pagina 15

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 24
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 14
Google Search Appliance: Policy ACL API Developer’s Guide Policy ACL API Developer’s Guide 15
Creating a Group
To create a new group:
GsaEntry insertEntry = new GsaEntry();
insertEntry.Properties.Add(new PropertyElement("groupId", "testGroup"));
service.Insert(new Uri("http://Search_Appliance:8000/a/feeds/group/2.0/domain"),
insertEntry);
Retrieving Groups
To retrieve all groups:
GsaFeed resultFeed = service.Query(new FeedQuery("http://gsa.example.com:8000/a/
feeds/group/2.0/domain")) as GsaFeed
If the number of groups in the search appliance is more than 500, the result is represented in multiple
pages—you can access the next page as follows:
if ((next = feed.Links.FindService("next", null)) != null)
{
resultFeed = Query(new Uri(next.HRef.ToString())) as GsaFeed;
}
Deleting Members of a Group
To delete members of a group, use the following
DELETE
request:
DELETE http://Search_Appliance:8000/a/feeds/group/2.0/domain/groupId
Take note that this request only deletes members of a group, it does not delete the empty group.
Adding a Member to a Group
To add a member to a group:
GsaEntry insertEntry = new GsaEntry();
insertEntry.Properties.Add(new PropertyElement("memberId", "john"));
insertEntry.Properties.Add(new PropertyElement("memberType", "User"));
// Adds member user "john" to group "testGroup"
service.Insert(new Uri("http://Search_Appliance:8000/a/feeds/group/2.0/domain
/testGroup/member"), insertEntry);
Retrieving Group Members
To retrieve all members of group:
GsaFeed resultFeed = service.Query(new FeedQuery("http://Search_Appliance:8000/a
/feeds/group/2.0/domain/testGroup/member")) as GsaFeed
If the number of members in a group is more than 500, the result is represented in multiple pages—you
can access the next page as follows:
if ((next = feed.Links.FindService("next", null)) != null)
{
memberFeed = Query(new Uri(next.HRef.ToString())) as GsaFeed;
}
Vedere la pagina 14
1 2 ... 10 11 12 13 14 15 16 17 18 19 20 ... 23 24

Commenti su questo manuale

Nessun commento