Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Modify User Agent on Discovery Service Class for Python #656

Closed
@enriquejosepadilla

Description

@enriquejosepadilla

Hello,

We are using the discovery service in our cli tool and would like to modify the user agent string as a way for concord to collect data from the api calls made by our tool.

I tried this bit of code L53 to L60:

https://github.com/GoogleCloudPlatform/django-cloud-deploy/blob/master/django_cloud_deploy/cloudlib/project.py#L53

but when making print statements of the http request it shows the following L104 to 117:

---Creating GCP Project Call1-----
------Printing info for http call-------
headers: {'accept': 'application/json', 'accept-encoding': 'gzip, deflate', 'user-agent': 'google-api-python-client/1.7.5 (gzip)', 'content-type': 'application/json', 'content-length': '108'}
body: {"name": "Django Project", "projectId": "doesntmatter", "parent": {"id": "blabla", "type": "folder"}}
uri: https://cloudresourcemanager.googleapis.com/v1/projects?alt=json
---Finished GCP Project Call-----

I modified the http.py execute method within the google-api-python-client for the print statements.

Metadata

Metadata

Assignees

Labels

type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions