google-apps-utils

command module
v0.0.0-...-2e3a7d5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2016 License: MIT Imports: 17 Imported by: 0

README

google-apps-utils

MIT License

Google Apps for Work の管理者用ユーティリティコマンドです

Installation

google-apps-utils をインストールします

$ export GOPATH=/path/to/your/gopath
$ export PATH=$GOPATH/bin:$PATH
$ go get -u github.com/yagihiro/google-apps-utils

管理 API を有効にします

https://support.google.com/a/answer/60757

以下のドキュメントの "Step 1: Turn on the Directory API" を参考にして client_secret.json を入手します

https://developers.google.com/admin-sdk/directory/v1/quickstart/go

以下のパスに client_secret.json を置きます

$HOME/.google-apps-utils/client_secret.json

実行します

$ google-apps-utils --help

Run

ユーザー一覧を表示

ドメインに所属する全ユーザーリストをターミナルに表示します。

$ google-apps-utils list
ユーザーを追加

ドメインにユーザーを追加します。ターミナルに初期パスワードが表示されるので、primaryemail と合わせてユーザーにお伝えください。

$ google-apps-utils create -g givenname -f familyname -e primaryemail
グループ一覧を表示

ドメインに所属する全グループリストをターミナルに表示します。

$ google-apps-utils grouplist
グループを追加

ドメインにグループを追加します。

$ google-apps-utils groupcreate -e email -d description -n name
グループのメンバーを表示

ドメインに所属するグループのメンバーを一覧表示します

$ google-apps-utils groupmemberlist -k groupKey
グループメンバーを追加

ドメインに所属するグループにメンバーを追加します。

$ google-apps-utils groupmembercreate -k groupKey -e email -r role
トークンのリセット

ローカルにキャッシュ済みのトークンをリセットします。

$ google-apps-utils reset

Files

  • $HOME/.google-apps-utils/client_secret.json
    • OAuth Client Secret です
    • 詳細は こちら を参照してください
  • $HOME/.google-apps-utils/token.json
    • OAuth token のキャッシュファイルです

開発者向け

依存しているライブラリをインストールします

$ export GOPATH=xxx
$ go get golang.org/x/net/context
$ go get golang.org/x/oauth2
$ go get golang.org/x/oauth2/google
$ go get google.golang.org/api/admin/directory/v1
$ go get google.golang.org/api/admin/reports/v1
$ go get github.com/urfave/cli

Reference

License

MIT License

Author

Hiroki Yagita

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL