-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Group support to the Monitoring API #2035
Conversation
|
||
You can get a specific group based on it's ID as follows:: | ||
|
||
>>> group = client.fetch_group('1001') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
params['interval.endTime'] = _format_timestamp(end_time) | ||
|
||
if start_time is not None: | ||
params['interval.startTime'] = _format_timestamp(start_time) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
OK I made it to the bottom. Review finished. |
Thanks for the comments @dhermes and @jgeewax. I have replied to some of the comments - and plan to address the rest in a follow up commit. An outstanding question - since This naming convention will also apply to the method |
self.filter = filter_string | ||
self.is_cluster = is_cluster | ||
|
||
if group_id: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I just submitted commits to address the outstanding comments. |
@supriyagarg I think all concerns have been addressed right? Before merging, can you clean up the commits? In particular |
Users can now fetch and list Stackdriver groups, and list a group's members.
Also allow a user to specify either the group ID or name to initilize it. The client class now has a factory constructor groups.
The fully qualified names are set by the class based on client.project. Also, the property Group.id can only be set during initialization now.
This commit makes the code consistent with the update to the helper function _datetime_to_rfc3339.
* Renamed some of the methods of gcloud.monitoring.Groups that get data from the API: * parent -> fetch_parent * members -> list_members * children -> list_children * ancestors -> list_ancestors * descendants -> list_descendants * Renamed / deleted some helper methods * group_id_from_name -> _group_id_from_name * _group_name_from_id -> _group_name_from_id * _init_from_dict -> _set_properties_from_dict * delete path_helper * Minimized the payload while checking if a group exists. * Updated the docstrings to be more consistent. Especially added examples where the group ID is not an integer.
8b21885
to
5dfa1be
Compare
@dhermes: That is correct. I just cleaned up the commits to remove the |
This change allows users to both read and write Stackdriver groups. It allows users to: