[ https://issues.apache.org/jira/browse/BEAM-14130?focusedWorklogId=750636&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-750636 ]
ASF GitHub Bot logged work on BEAM-14130: ----------------------------------------- Author: ASF GitHub Bot Created on: 31/Mar/22 00:22 Start Date: 31/Mar/22 00:22 Worklog Time Spent: 10m Work Description: VictorPlusC commented on a change in pull request #17127: URL: https://github.com/apache/beam/pull/17127#discussion_r839066001 ########## File path: sdks/python/apache_beam/runners/interactive/messaging/interactive_environment_inspector.py ########## @@ -136,6 +137,38 @@ def get_pcoll_data(self, identifier, include_window_info=False): return dataframe.to_json(orient='table') return {} + @as_json + def list_clusters(self): + """Retrieves information for all clusters as a json. + + The json object maps a unique obfuscated identifier of a cluster to + the corresponding cluster_name, project, region, master_url, dashboard, + and pipelines. Furthermore, copies the mapping to self._clusters. + """ + from apache_beam.runners.interactive import interactive_environment as ie + clusters = ie.current_env().clusters + all_cluster_data = {} + for master_url in clusters.master_urls: + cluster_metadata = clusters.master_urls[master_url] + project = cluster_metadata.project_id + region = cluster_metadata.region + name = cluster_metadata.cluster_name + + all_cluster_data[obfuscate(project, region, name)] = { + 'cluster_name': name, + 'project': project, + 'region': region, + 'master_url': master_url, + 'dashboard': clusters.master_urls_to_dashboards[master_url], + 'pipelines': clusters.master_urls_to_pipelines[master_url] + } + self._clusters = all_cluster_data + return all_cluster_data + + def get_cluster_data(self): Review comment: Responded in a previous comment - I've refactored the code to hide the obfuscated id now. Thanks! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@beam.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 750636) Time Spent: 40.5h (was: 40h 20m) > Implement Jupyterlab extension for managing Dataproc clusters > ------------------------------------------------------------- > > Key: BEAM-14130 > URL: https://issues.apache.org/jira/browse/BEAM-14130 > Project: Beam > Issue Type: New Feature > Components: runner-py-interactive > Reporter: Victor Chen > Assignee: Victor Chen > Priority: P2 > Time Spent: 40.5h > Remaining Estimate: 0h > > - Adds an additional option under the Interactive Beam Jupyterlab extension > to enable users to manage Interactive Beam clusters -- This message was sent by Atlassian Jira (v8.20.1#820001)