Skip to content
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 cluster events CLI #238

Merged
merged 12 commits into from
Aug 5, 2019
Merged

Conversation

smurching
Copy link
Contributor

@smurching smurching commented Jun 27, 2019

Adds CLI for the cluster events REST API.

Example output (mimics the output format of the clusters UI by default):

$ databricks clusters events --cluster-id 0717-061054-beech1 --profile demo --limit 4
$ databricks clusters events --cluster-id 0717-061054-beech1 --profile demo --limit 4
2019-07-18 00:23:47 PDT  TERMINATING     {'reason': {'code': 'INACTIVITY', 'parameters': {'inactivity_duration_min': '60'}}}
2019-07-17 22:09:49 PDT  DRIVER_HEALTHY  {}
2019-07-17 22:09:32 PDT  RUNNING         {'current_num_workers': 0, 'target_num_workers': 0}
2019-07-17 22:07:13 PDT  STARTING        {'user': 'sid.murching@databricks.com'}

Full REST API JSON output is available by specifying --output json:

{
  "events": [
    {
      "cluster_id": "0717-061054-beech1",
      "timestamp": 1563434627634,
      "type": "TERMINATING",
      "details": {
        "reason": {
          "code": "INACTIVITY",
          "parameters": {
            "inactivity_duration_min": "60"
          }
        }
      }
    },
    {
      "cluster_id": "0717-061054-beech1",
      "timestamp": 1563426589300,
      "type": "DRIVER_HEALTHY",
      "details": {}
    },
    {
      "cluster_id": "0717-061054-beech1",
      "timestamp": 1563426572019,
      "type": "RUNNING",
      "details": {
        "current_num_workers": 0,
        "target_num_workers": 0
      }
    }
  ],
  "next_page": {
    "cluster_id": "0717-061054-beech1",
    "end_time": 1563434627634,
    "offset": 3,
    "limit": 3
  },
  "total_count": 16
}

@codecov-io
Copy link

codecov-io commented Jul 21, 2019

Codecov Report

Merging #238 into master will increase coverage by 0.22%.
The diff coverage is 96.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #238      +/-   ##
==========================================
+ Coverage   82.92%   83.14%   +0.22%     
==========================================
  Files          31       31              
  Lines        1991     2077      +86     
==========================================
+ Hits         1651     1727      +76     
- Misses        340      350      +10
Impacted Files Coverage Δ
setup.py 0% <ø> (ø) ⬆️
databricks_cli/clusters/cli.py 95.39% <100%> (+1.03%) ⬆️
databricks_cli/clusters/api.py 53.33% <50%> (-0.24%) ⬇️
databricks_cli/runs/cli.py 97.26% <0%> (-1.21%) ⬇️
databricks_cli/runs/api.py 57.14% <0%> (-1.2%) ⬇️
databricks_cli/cli.py 0% <0%> (ø) ⬆️
databricks_cli/dbfs/cli.py 0% <0%> (ø) ⬆️
databricks_cli/click_types.py 94.2% <0%> (+0.86%) ⬆️
databricks_cli/dbfs/api.py 60.55% <0%> (+8.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f4a05cb...39502fb. Read the comment docs.

@smurching smurching changed the title [WIP] Add cluster events CLI Add cluster events CLI Jul 21, 2019
@andrewmchen andrewmchen merged commit 6cf5b4d into databricks:master Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants