Skip to main content

GSuite Admin API Exporter

Project description

GSuite Exporter

This package handles exporting data from the GSuite Admin APIs to a destination.

The following GSuite Admin APIs are currently supported:

The following destinations are currently supported:

Requirements

  • A GSuite Admin account
  • A service account with:
  • On the service account's project:
    • Enable the Identity and Access Management (IAM) API.
  • On the destination project:
    • Enable the Admin Reports API.

Collectors

To collect data from the Admin SDK APIs, you need to grant extra permissions to your service account:

Exporters

Stackdriver Logging

To use the Stackdriver Logging exporter, you need to grant extra IAM roles to your service account:

  • roles/logging.viewer on the destination project
  • roles/logging.logWriter on the destination project

Installation

pip install gsuite-exporter

Usage

The GSuite Exporter can be used either using the command-line interface or as a Python library.

Using the CLI

An example sync from the Admin Reports API to Stackdriver Logging for the 'login' application looks like:

gsuite-exporter
  --credentials-path='/path/to/service/account/credentials.json'
  --admin-user='<your_gsuite_admin>@<your_domain>'
  --api='report_v1'
  --applications='login drive token'
  --project-id='<logging_project>'
  --exporter='stackdriver_exporter.StackdriverExporter'

The credentials_path variable is optional and you can use Application Default Credentials instead.

Using as a library

An example sync from the Admin Reports API to Stackdriver Logging looks like:

from gsuite_exporter.cli import sync_all

sync_all(
    credentials_path=/path/to/service/account/credentials.json,
    admin_user='<user>@<domain>',
    api='reports_v1',
    applications=['login', 'drive', 'token'],
    project_id='<project-id>',
    exporter_class='stackdriver_exporter.StackdriverExporter'
)

More examples are available using the library functions under the examples/ directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gsuite-exporter-0.0.2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

gsuite_exporter-0.0.2-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file gsuite-exporter-0.0.2.tar.gz.

File metadata

  • Download URL: gsuite-exporter-0.0.2.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for gsuite-exporter-0.0.2.tar.gz
Algorithm Hash digest
SHA256 da3c56f16884df8d157e8b40ee75bbe4150dc3fdb605e20d8cac8dddce5ff91a
MD5 bb7bd968ab41c0ef054dd17c3c46b3f6
BLAKE2b-256 466d20c321cc8f2c8b79cff0bf4a7a790693b0c50a1474da4efaff46e216a900

See more details on using hashes here.

Provenance

File details

Details for the file gsuite_exporter-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: gsuite_exporter-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for gsuite_exporter-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dcaf42174727a714f7969a2ca814d40ef628019d0e0b258c5e2cb5ef2a1944b3
MD5 5ebacf2055ed531a8263fd044be97542
BLAKE2b-256 7718dc419853ed4516e238326c800193883563ef7675d69e5162cab38795c129

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page