gami

41 views
Skip to first unread message

Adam Morris

unread,
Jun 30, 2015, 2:24:37 PM6/30/15
to google-ap...@googlegroups.com
Hi everyone,

I have spent about a week now working on a mini project that expands on existing gam codebase to implement some things that I need for my google domain. I have significantly refactored it, and am calling it "gami" for "GAM Improved' so that, for example the command:

gami info group it.committee

outputs the following:

{
 
"errors": {},
 
"results": {
   
"adminCreated": true,
   
"allowExternalMembers": false,
   
"allowGoogleCommunication": false,
   
"allowWebPosting": true,
   
"archiveOnly": false,
   
"customReplyTo": "",
   
"defaultMessageDenyNotificationText": "",
   
"description": "AC, AM, GD, JC, SH",
   
"directMembersCount": 4,
   
"email": "it.com...@example.com",
   
"etag": "\"MO4FtId2-yiZq_-3TpU3AZTf2Ak/FjWLjnkDuCOsw3twVz2HCV7NgSQ\"",
   
"id": "02dlolyb3m3n0ki",
   
"includeInGlobalAddressList": true,
   
"isArchived": true,
   
"kind": "admin#directory#members",
   
"maxMessageBytes": 5242880,
   
"members": [
     
{
       
"email": "som...@example.com",
       
"etag": "\"MO4FtId2-yiZq_-3TpU3AZTf2Ak/3mIPo-EodoUfsd2AXuoCvb-AZME\"",
       
"id": "104842762600829236047",
       
"kind": "admin#directory#member",
       
"role": "MEMBER",
       
"type": "USER"
     
},
     
{
       
"email": "someo...@example.com",
       
"etag": "\"MO4FtId2-yiZq_-3TpU3AZTf2Ak/fWU1GaZMWKA_G2IJIMh65cAWuPs\"",
       
"id": "118378022930353221774",
       
"kind": "admin#directory#member",
       
"role": "MEMBER",
       
"type": "USER"
     
},
   
],
   
"membersCanPostAsTheGroup": false,
   
"messageDisplayFont": "DEFAULT_FONT",
   
"messageModerationLevel": "MODERATE_NONE",
   
"name": "IT Committee",
   
"nonEditableAliases": [
     
"it.com...@example.com"
   
],
   
"replyTo": "REPLY_TO_IGNORE",
   
"sendMessageDenyNotification": false,
   
"showInGroupDirectory": false,
   
"spamModerationLevel": "MODERATE",
   
"whoCanContactOwner": "ANYONE_CAN_CONTACT",
   
"whoCanInvite": "ALL_MEMBERS_CAN_INVITE",
   
"whoCanJoin": "CAN_REQUEST_TO_JOIN",
   
"whoCanLeaveGroup": "ALL_MEMBERS_CAN_LEAVE",
   
"whoCanPostMessage": "ALL_IN_DOMAIN_CAN_POST",
   
"whoCanViewGroup": "ALL_IN_DOMAIN_CAN_VIEW",
   
"whoCanViewMembership": "ALL_IN_DOMAIN_CAN_VIEW"
 
},
 
"warnings": {}
}

That is, it returns a json with a full description of the (raw) results, and any errors or warnings that occurred along the way.

Also, you can import a helper function and run this command without having to do system calls, and it returns a python dictionary. Also, it has bash completion.

At the moment, it only works for certain commands, and it's by no means ready for prime time, nor would I plan on using it for production anytime soon. So consider it a proof of concept:


What I'm wondering is, how important are these features to the outside world? Does Jay have any comment on this? What do other people think?

Adam

Logan Hansen

unread,
Jul 2, 2015, 10:50:39 AM7/2/15
to google-ap...@googlegroups.com
Any particular reason for creating a full fork, rather than just submitting patches? In the long run, I'd expect patches to the main branch would get more support...

Adam Morris

unread,
Jul 2, 2015, 2:05:43 PM7/2/15
to google-ap...@googlegroups.com
>Any particular reason for creating a full fork, rather than just submitting patches? In the long run, I'd expect patches to the main branch would get more support...

The features that I have in mind, for example, being importable, and outputting a json, require significant refactoring in order to happen. I am more than happy to provide patches and improvements to existing codebase, but more importantly, I want it to work for my own given parameters. :)

The commands themselves have not changed, so that the end-user does not have to learn different commands. 

Would appreciate further input.

Adam
Reply all
Reply to author
Forward
0 new messages