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

Added databricks_job data resource #1509

Merged
merged 18 commits into from
Sep 30, 2022
Merged

Added databricks_job data resource #1509

merged 18 commits into from
Sep 30, 2022

Conversation

edmondop
Copy link
Contributor

@edmondop edmondop commented Jul 30, 2022

Retrieves the settings of databricks_job by name or by id. Complements the feature of the databricks_jobs data source.

Example Usage

Getting the existing cluster id of specific databricks_job by name or by id:

data "databricks_job" "this" {
  job_name = "My job"
}
output "cluster_id" {
  value     = data.databricks_job.job_settings.existing_cluster_id
  sensitive = false
}

Attribute Reference

This data source exports the following attributes:

Related Resources

The following resources are used in the same context:

@nfx nfx linked an issue Jul 30, 2022 that may be closed by this pull request
@nfx nfx self-requested a review July 30, 2022 06:54
Copy link
Contributor

@nfx nfx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left naming requirements in the PR. Look at the recent merged PRs that were adding data sources:

  • PR name must be compliant - it goes to release notes almost unchanged. In a current shape I have to change it a bit.
  • Look at recently added cluster “singular” data source.

provider/provider.go Outdated Show resolved Hide resolved
jobs/data_queryable_job.go Outdated Show resolved Hide resolved
docs/data-sources/queryable_job.md Outdated Show resolved Hide resolved
docs/data-sources/queryable_job.md Outdated Show resolved Hide resolved
docs/data-sources/queryable_job.md Outdated Show resolved Hide resolved
docs/data-sources/queryable_job.md Outdated Show resolved Hide resolved
jobs/data_queryable_job.go Outdated Show resolved Hide resolved
jobs/data_queryable_job.go Outdated Show resolved Hide resolved
Copy link
Contributor

@nfx nfx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plus other renames required

jobs/data_job.go Outdated Show resolved Hide resolved
jobs/data_job.go Outdated Show resolved Hide resolved
jobs/data_job_test.go Outdated Show resolved Hide resolved
jobs/data_job_test.go Show resolved Hide resolved
jobs/data_job_test.go Outdated Show resolved Hide resolved
jobs/data_job_test.go Outdated Show resolved Hide resolved
@edmondop edmondop changed the title [DRAFT]: Adding an additional Terraform data source to query jobs by any of the API parameters Adding an additional Terraform data source to query jobs by any of the API parameters Sep 2, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 2, 2022

Codecov Report

Merging #1509 (b59c138) into master (10dd11a) will increase coverage by 0.46%.
The diff coverage is 86.36%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1509      +/-   ##
==========================================
+ Coverage   89.57%   90.04%   +0.46%     
==========================================
  Files         135      136       +1     
  Lines       10825    10847      +22     
==========================================
+ Hits         9697     9767      +70     
+ Misses        737      690      -47     
+ Partials      391      390       -1     
Impacted Files Coverage Δ
jobs/data_job.go 85.71% <85.71%> (ø)
provider/provider.go 95.30% <100.00%> (+0.03%) ⬆️
exporter/util.go 82.32% <0.00%> (+3.86%) ⬆️
exporter/importables.go 90.68% <0.00%> (+5.25%) ⬆️

@edmondop edmondop marked this pull request as ready for review September 2, 2022 00:30
@edmondop edmondop requested a review from nfx September 2, 2022 00:38
Copy link
Contributor

@nfx nfx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consistency issues, suggested fixed whenever they're applicable

README.md Outdated Show resolved Hide resolved
docs/data-sources/job.md Outdated Show resolved Hide resolved
docs/data-sources/job.md Outdated Show resolved Hide resolved
docs/data-sources/job.md Outdated Show resolved Hide resolved
docs/data-sources/job.md Outdated Show resolved Hide resolved
jobs/data_job_test.go Outdated Show resolved Hide resolved
jobs/data_job_test.go Outdated Show resolved Hide resolved
jobs/data_job_test.go Outdated Show resolved Hide resolved
jobs/data_job_test.go Outdated Show resolved Hide resolved
jobs/data_job_test.go Outdated Show resolved Hide resolved
@nfx nfx changed the title Adding an additional Terraform data source to query jobs by any of the API parameters Added databricks_job data resource Sep 2, 2022
@nfx nfx self-assigned this Sep 2, 2022
@edmondop edmondop requested a review from nfx September 14, 2022 20:16
@nfx nfx enabled auto-merge (squash) September 30, 2022 17:17
@nfx nfx merged commit 0a81d78 into databricks:master Sep 30, 2022
@nfx nfx mentioned this pull request Sep 30, 2022
nkvuong pushed a commit that referenced this pull request Oct 6, 2022
Example: Getting the existing cluster id of specific databricks_job by name or by id:

```
data "databricks_job" "this" {
  job_name = "My job"
}
output "cluster_id" {
  value     = data.databricks_job.job_settings.existing_cluster_id
  sensitive = false
}
```

Co-authored-by: Serge Smertin <259697+nfx@users.noreply.github.com>
michael-berk pushed a commit to michael-berk/terraform-provider-databricks that referenced this pull request Feb 15, 2023
Example: Getting the existing cluster id of specific databricks_job by name or by id:

```
data "databricks_job" "this" {
  job_name = "My job"
}
output "cluster_id" {
  value     = data.databricks_job.job_settings.existing_cluster_id
  sensitive = false
}
```

Co-authored-by: Serge Smertin <259697+nfx@users.noreply.github.com>
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.

[FEATURE] data source databricks_job
5 participants