-
Notifications
You must be signed in to change notification settings - Fork 42
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 DataPlane API Support #936
Merged
Merged
Changes from 33 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
0ed887f
WIP
hectorcast-db 773ea11
Generate
hectorcast-db 2407299
Test
hectorcast-db dc6b882
Test2
hectorcast-db 9d12135
singular
hectorcast-db 75345a3
Client getter
hectorcast-db be639ae
DP method
hectorcast-db ecd2bc0
Request
hectorcast-db c361d9d
CP client
hectorcast-db ff60fc1
delete stuff
hectorcast-db a12d718
cleanup
hectorcast-db 338b481
Method WIP
hectorcast-db d71d58f
more gen
hectorcast-db ef348a1
finish method
hectorcast-db 5e30cb1
Clean interface
hectorcast-db bb425d5
Tests
hectorcast-db ae97970
Error hadnling
hectorcast-db 579f6b5
Fixes
hectorcast-db e8b0d3c
fixes 2
hectorcast-db bb5d618
Cleanup
hectorcast-db c161714
c2
hectorcast-db 6eb4951
Rename
hectorcast-db 2a4517d
Move
hectorcast-db e86f899
Extract description generation and tag
hectorcast-db b7c8d4d
Remove safeguards
hectorcast-db 4d11f28
Merge branch 'generate-dataplane-code' into dataplane-support
hectorcast-db 3827a83
fixes
hectorcast-db b163d9c
Generate
hectorcast-db 3007351
Remove old file
hectorcast-db b728c49
Update spec
hectorcast-db bbc2d72
Generate from master
hectorcast-db f1b393c
Merge branch 'main' into dataplane-support
hectorcast-db d3547b7
Generate
hectorcast-db c59391b
Delete endpoints
hectorcast-db c5cfd49
Cleanup
hectorcast-db 5a4837b
More cleanup
hectorcast-db 3554e86
Fixes
hectorcast-db ef5c86a
Merge branch 'main' into dataplane-support
hectorcast-db c0bc3d5
Regenerate
hectorcast-db d33b531
Fixes
hectorcast-db 438bbe2
Formatting
hectorcast-db 7a90930
Regenerate
hectorcast-db 008945c
Make field private
hectorcast-db 6607dfd
Remove file
hectorcast-db File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
fc26589775a1c48b14211cd11b6903d1b4ed071c | ||
f9166063cb5a6677c83877de2a2bb95c82958dd5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,25 +14,12 @@ type WorkspaceClient struct { | |
Config *config.Config | ||
apiClient *httpclient.ApiClient | ||
|
||
{{range .Services}}{{if and (not .IsAccounts) (not .HasParent) (not .IsDataPlane)}} | ||
{{range .Services}}{{if and (not .IsAccounts) (not .HasParent) }} | ||
{{.Comment " // " 80}} | ||
{{.Name}} {{.Package.Name}}.{{.Name}}Interface | ||
{{end}}{{end}} | ||
} | ||
|
||
// Returns a new OAuth scoped to the authorization details provided. | ||
// It will return an error if the CredentialStrategy does not support OAuth tokens. | ||
// | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need this on the WorkspaceClient, but the Client itself. |
||
// **NOTE:** Experimental: This API may change or be removed in a future release | ||
// without warning. | ||
func (a *WorkspaceClient) GetOAuthToken(ctx context.Context, authorizationDetails string) (*credentials.OAuthToken, error) { | ||
originalToken, err := a.Config.GetToken() | ||
if err != nil { | ||
return nil, err | ||
} | ||
return a.apiClient.GetOAuthToken(ctx, authorizationDetails, originalToken) | ||
} | ||
|
||
var ErrNotWorkspaceClient = errors.New("invalid Databricks Workspace configuration") | ||
|
||
// NewWorkspaceClient creates new Databricks SDK client for Workspaces or | ||
|
@@ -61,11 +48,21 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { | |
if err != nil { | ||
return nil, err | ||
} | ||
{{range .Services}}{{if and (not .IsAccounts) (not .HasParent) (.HasDataPlaneMethods) (not .IsDataPlane)}} | ||
{{.CamelName}} := {{.Package.Name}}.New{{.Name}}(databricksClient) | ||
{{- end}}{{end}} | ||
return &WorkspaceClient{ | ||
Config: cfg, | ||
apiClient: apiClient, | ||
{{range .Services}}{{if and (not .IsAccounts) (not .HasParent) (not .IsDataPlane)}} | ||
{{range .Services}}{{if and (not .IsAccounts) (not .HasParent) (not .IsDataPlane) (not .HasDataPlaneMethods)}} | ||
{{.Name}}: {{.Package.Name}}.New{{.Name}}(databricksClient), | ||
{{- end}}{{end}} | ||
{{- end -}} | ||
{{if and (not .IsAccounts) (not .HasParent) (not .IsDataPlane) (.HasDataPlaneMethods)}} | ||
{{.Name}}: {{.CamelName}}, | ||
{{- end -}} | ||
{{if and (not .IsAccounts) (not .HasParent) .IsDataPlane}} | ||
{{.Name}}: {{.Package.Name}}.New{{.Name}}(databricksClient, {{.ControlPlaneService.CamelName}}), | ||
{{- end -}} | ||
{{end}} | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would this case happen? Is this a bug in the API definition? Or is it possible that some model serving endpoints support direct-to-dataplane access and others don't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DataPlane access needs to be enabled on a resource level. If you call this method for a Model which is not "optimized" (their flag for DataPlane), this field won't be set (the endpointURL does not exists)