Giter VIP home page Giter VIP logo

agm's People

Contributors

alexwennerberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

daallgeier

agm's Issues

--body parameter is broken

Unable to parse a JSON string as a parameter as the body. e.g.

agm drive files create -u $me --media_body "$1" --body "{'name': '$1', 'mimeType': 'application/vnd.google-apps.spreadsheet'}"

dns issue

File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/httplib2/init.py", line 1524, in _conn_request
conn.connect()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/httplib2/init.py", line 1305, in connect
sock.connect((self.host, self.port))
socket.gaierror: [Errno 8] nodename nor servname provided, or not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/bin/agm", line 10, in
sys.exit(cli())
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/agm/agm.py", line 179, in cli
raise e
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/agm/agm.py", line 166, in cli
run(fully_parsed_args)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/agm/agm.py", line 240, in run
requests, scopes=scopes, keyfile=args.get("keyfile")
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/agm/executor.py", line 147, in multithread_execute_requests
chunk_responses += [future.result()] # Doesnt actually return anything
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/agm/executor.py", line 160, in execute_requests
keyfile=keyfile,
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/agm/google_auth.py", line 170, in build
service = self.get_service_account_service()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/agm/google_auth.py", line 118, in get_service_account_service
service = self.attempt_authorization(self.keyfile, scope)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/agm/google_auth.py", line 137, in attempt_authorization
service = apiclient.discovery.build(self.name, self.version, http=http)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/googleapiclient/discovery.py", line 224, in build
requested_url, discovery_http, cache_discovery, cache, developerKey)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/googleapiclient/discovery.py", line 274, in _retrieve_discovery_doc
resp, content = http.request(actual_url)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/oauth2client/transport.py", line 175, in new_request
redirections, connection_type)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/oauth2client/transport.py", line 282, in request
connection_type=connection_type)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/httplib2/init.py", line 1953, in request
cachekey,
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/httplib2/init.py", line 1618, in _request
conn, request_uri, method, body, headers
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/httplib2/init.py", line 1531, in _conn_request
raise ServerNotFoundError("Unable to find the server at %s" % conn.host)
httplib2.ServerNotFoundError: Unable to find the server at www.googleapis.com

Get directory user Error

While running the following: agm directory users get [email protected]
With These APIs in scope: https://www.googleapis.com/auth/admin.directory.user
https://www.googleapis.com/auth/admin.directory.user.readonly

I receive this error: Traceback (most recent call last):
File "/home/ktibbs/.local/bin/agm", line 11, in
sys.exit(cli())
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/agm.py", line 177, in cli
raise e
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/agm.py", line 165, in cli
run(fully_parsed_args)
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/agm.py", line 228, in run
list(map(docs.parse_scopes, args.get("scopes") or [])) or method.get_scopes()
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/docs.py", line 212, in get_scopes
return self.docs.get("scopes")
AttributeError: 'NoneType' object has no attribute 'get'

Release as importable package

While you can technically import parts of AGM for use in Python code, it's not really built for that and doesn't have a very good interface. Using things like the authenticator helpers and executor class could be useful for others using the Python SDK. I'd want to build out much more thorough testing though.

Unexpected Error when deleting calendar event

Unexpected error when running calendar delete command agm calendar events delete --calendarId [calendarId] --eventId [eventId] --user [User]

Error returned:

Unexpected error, please report to https://github.com/Cloudbakers/agm/issues Traceback (most recent call last): File "/home/octavian/.local/bin/agm", line 11, in <module> sys.exit(cli()) File "/home/octavian/.local/lib/python3.6/site-packages/agm/agm.py", line 177, in cli raise e File "/home/octavian/.local/lib/python3.6/site-packages/agm/agm.py", line 165, in cli run(fully_parsed_args) File "/home/octavian/.local/lib/python3.6/site-packages/agm/agm.py", line 238, in run executor.multithread_execute_requests(requests, scopes=scopes) File "/home/octavian/.local/lib/python3.6/site-packages/agm/executor.py", line 140, in multithread_execute_requests chunk_responses += [future.result()] # Doesnt actually return anything File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result return self.__get_result() File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result raise self._exception File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) File "/home/octavian/.local/lib/python3.6/site-packages/agm/executor.py", line 181, in execute_requests Batch(service, requests_chunk).execute() File "/home/octavian/.local/lib/python3.6/site-packages/agm/executor.py", line 263, in execute return batch.execute() File "/home/octavian/.local/lib/python3.6/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper return wrapped(*args, **kwargs) File "/home/octavian/.local/lib/python3.6/site-packages/googleapiclient/http.py", line 1490, in execute self._callback(request_id, response, exception) File "/home/octavian/.local/lib/python3.6/site-packages/agm/executor.py", line 285, in batch_callback request.callback(response) File "/home/octavian/.local/lib/python3.6/site-packages/agm/executor.py", line 113, in json_callback if not output.get("response", {}).get("nextPageToken"): AttributeError: 'str' object has no attribute 'get'

Event is still deleted successfully

List Calendar for user

When running command: agm calendar calendarList list --user [email protected]
I receive error: raceback (most recent call last):
File "/home/ktibbs/.local/bin/agm", line 11, in
sys.exit(cli())
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/agm.py", line 177, in cli
raise e
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/agm.py", line 165, in cli
run(fully_parsed_args)
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/agm.py", line 238, in run
executor.multithread_execute_requests(requests, scopes=scopes)
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/executor.py", line 140, in multithread_execute_requests
chunk_responses += [future.result()] # Doesnt actually return anything
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/executor.py", line 168, in execute_requests
if paged(service, request):
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/executor.py", line 198, in paged
resource = _get_resource(service, request.resources)
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/executor.py", line 241, in _get_resource
resource = getattr(resource, item)()
AttributeError: 'NoneType' object has no attribute 'calendarList

Request to improve warning message

If a scope isn't added/defined, a non-descriptive warning is presented which simply states the following:

agm.executor (163) - WARNING: Unable to authenticate user <user email address>

Parse body using Argparse

I want to be able to use argparse-style flags to send body parameters instead of passing a dictionary to --body

Listing users unexpected error

When running command: agm directory users list
Error: Traceback (most recent call last):
File "/home/ktibbs/.local/bin/agm", line 11, in
sys.exit(cli())
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/agm.py", line 177, in cli
raise e
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/agm.py", line 165, in cli
run(fully_parsed_args)
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/agm.py", line 230, in run
requests = get_list_of_requests(fully_parsed_args)
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/agm.py", line 252, in get_list_of_requests
version = request_cmd.get("version") or docs.get_preferred_version(service)
File "/home/ktibbs/.local/lib/python3.6/site-packages/agm/docs.py", line 61, in get_preferred_version
return versions[0]
IndexError: list index out of range

Have verified that the following API is enabled to utilize this command: https://www.googleapis.com/auth/admin.directory.user

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.