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

[RESOURCE] databricks_sql_endpoint #498

Merged
merged 11 commits into from
Feb 11, 2021
Merged

[RESOURCE] databricks_sql_endpoint #498

merged 11 commits into from
Feb 11, 2021

Conversation

nfx
Copy link
Contributor

@nfx nfx commented Feb 10, 2021

Addresses #457

@nfx nfx requested a review from alexott February 10, 2021 15:37
@nfx nfx linked an issue Feb 10, 2021 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Feb 10, 2021

Codecov Report

Merging #498 (8c94285) into master (b721635) will decrease coverage by 0.43%.
The diff coverage is 62.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #498      +/-   ##
==========================================
- Coverage   80.80%   80.37%   -0.44%     
==========================================
  Files          76       77       +1     
  Lines        6382     6502     +120     
==========================================
+ Hits         5157     5226      +69     
- Misses        847      891      +44     
- Partials      378      385       +7     
Impacted Files Coverage Δ
identity/scim.go 100.00% <ø> (ø)
identity/users.go 90.32% <0.00%> (-6.23%) ⬇️
internal/qa/testing.go 71.68% <3.12%> (-8.97%) ⬇️
identity/resource_group.go 58.33% <15.38%> (-9.47%) ⬇️
sqlanalytics/resource_sql_endpoint.go 93.65% <93.65%> (ø)
access/resource_permissions.go 71.42% <100.00%> (+0.66%) ⬆️
common/azure_auth.go 82.47% <100.00%> (+0.36%) ⬆️
common/azure_cli_auth.go 92.18% <100.00%> (-2.98%) ⬇️
common/http.go 85.71% <100.00%> (-0.11%) ⬇️
compute/resource_job.go 84.42% <100.00%> (ø)
... and 4 more

Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

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

looks good. Are you planning to add the doc for endpoint later?

docs/resources/permissions.md Outdated Show resolved Hide resolved
@nfx
Copy link
Contributor Author

nfx commented Feb 10, 2021

@georgeteo this is the PR

sqlanalytics/resource_sql_endpoint.go Outdated Show resolved Hide resolved
sqlanalytics/resource_sql_endpoint.go Outdated Show resolved Hide resolved
sqlanalytics/resource_sql_endpoint.go Outdated Show resolved Hide resolved
@nfx nfx changed the title [RESOURCE][WIP] databricks_sql_endpoint [RESOURCE] databricks_sql_endpoint Feb 11, 2021
@nfx nfx requested a review from alexott February 11, 2021 13:31
@nfx nfx added this to the v0.3.1 milestone Feb 11, 2021
@nfx nfx self-assigned this Feb 11, 2021
Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

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

the documentation needs to be updated about max_num_clusters

docs/resources/sql_endpoint.md Outdated Show resolved Hide resolved
sqlanalytics/acceptance/sql_endpoint_test.go Outdated Show resolved Hide resolved
sqlanalytics/resource_sql_endpoint.go Show resolved Hide resolved
@nfx nfx requested a review from alexott February 11, 2021 15:22
Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

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

lgtm

@nfx nfx merged commit 67c7713 into master Feb 11, 2021
@nfx nfx deleted the sql-endpoint branch February 11, 2021 15:25
}

// Create ...
func (a SQLEndpointsAPI) Create(se *SQLEndpoint, timeout time.Duration) error {

Choose a reason for hiding this comment

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

Technically, CreateEndpoint and EditEndpoint are different proto messages from the EndpointInfo returned by GetEndpoint or ListEndpoints.

So far, the fields have mirrored them 1:1 but is not necessarily true in the future.

if err != nil {
return err
}
return a.waitForRunning(se.ID, timeout)

Choose a reason for hiding this comment

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

FYI: This may take a couple minutes b/c we wait for the Spark cluster to be running.


// Edit ...
func (a SQLEndpointsAPI) Edit(se SQLEndpoint) error {
return a.client.Post(a.context, fmt.Sprintf("/sql/endpoints/%s/edit", se.ID), se, nil)

Choose a reason for hiding this comment

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

FYI: Edit supports patch/incremental update. It's fine if you treat it as a post.

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] Add support for SQL Endpoints
3 participants