Skip to content
Jean-Sébastien Sevestre edited this page Nov 16, 2018 · 2 revisions

The SDK can also be used with a CLI. Check lumapps_api_client/lib.py for more details

Required parameter

--auth JSON file that contains auth information of a service account or web auth

  • Service account (the file you download from GCP should do as-is)

      {
        "type": "service_account",
        "project_id": "gbl-imt-ve-lifepulse-dev",
        "private_key_id": ...,
        ...
      }
    
  • Web auth

      {
        "token_uri": "https://accounts.google.com/o/oauth2/token",
        "client_id": "...",
        "client_secret": "...",
        "refresh_token": "..."
      }
    
  • Bearer

      {
        "bearer": "Bearer F9VDFcF5YIb3dGaU="
        OR
        "bearer": "F9VDFcF5YIb3dGaU="
      }
    

Optional parameter

--api JSON file with three parameters (example contains default values)

{
    "base_url": "https://lumsites.appspot.com",
    "name": "lumsites",
    "version": "v1"
}

--user The user email to use for delegation (only with service account auth)

Usage examples

List API methods

lac --auth web_auth.json

List methods beginning with 'comm'

lac --auth web_auth.json comm

Get list of 'instances'

lac --auth web_auth.json instance list

Get arguments for 'template list'

lac --auth web_auth.json template list -h

Get list of 'templates'

lac --auth web_auth.json template list instance=6724836101455872