-
Notifications
You must be signed in to change notification settings - Fork 11
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
DataArts API implementation #651
Closed
+3,237
−149
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6064139
first dataart api implementation
sgmv 34d0b5c
small refactoring
sgmv 1acb1b9
codebase refactoring
sgmv ac0c954
fix url check and added documentation for the public methods
sgmv 1d62a9f
first dataart api implementation
sgmv de50109
Merge branch 'urlquery-refactoring' into dataarts-impl
sgmv 18e842e
Merge branch 'devel' into dataarts-impl
sgmv 4ce4239
Added api for link management.
sgmv 62f702e
Merge remote-tracking branch 'origin/dataarts-impl' into dataarts-impl
sgmv a1da112
merge fixes
sgmv ad47ef9
linter fixes
sgmv dd3075e
added api for links
sgmv 5eea9a1
added script api
sgmv caa7bae
added all factory apis
sgmv 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
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 |
---|---|---|
@@ -1,12 +1,31 @@ | ||
package cluster | ||
|
||
import "github.com/opentelekomcloud/gophertelekomcloud" | ||
import ( | ||
"github.com/opentelekomcloud/gophertelekomcloud" | ||
"github.com/opentelekomcloud/gophertelekomcloud/internal/build" | ||
"github.com/opentelekomcloud/gophertelekomcloud/internal/extract" | ||
) | ||
|
||
func Delete(client *golangsdk.ServiceClient, id string) (err error) { | ||
// DELETE /v1.1/{project_id}/clusters/{cluster_id} | ||
type KeepBackup struct { | ||
KeepBackup int `json:"keep_last_manual_backup"` | ||
type DeleteOpts struct { | ||
// KeepBackup Number of backup log files. Retain the default value 0. | ||
KeepBackup int `json:"keep_last_manual_backup"` | ||
} | ||
|
||
// Delete is used to delete a cluster. | ||
// Send request DELETE /v1.1/{project_id}/clusters/{cluster_id} | ||
func Delete(client *golangsdk.ServiceClient, id string, jsonOpts *DeleteOpts) (*JobId, error) { | ||
b, err := build.RequestBody(jsonOpts, "") | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
r, err := client.DeleteWithBody(client.ServiceURL(clustersEndpoint, id), b, nil) | ||
if err != nil { | ||
return nil, err | ||
} | ||
_, err = client.DeleteWithBody(client.ServiceURL("clusters", id), KeepBackup{KeepBackup: 0}, nil) | ||
return | ||
|
||
var resp *JobId | ||
err = extract.Into(r.Body, resp) | ||
|
||
return resp, err | ||
} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package cluster | ||
|
||
import ( | ||
golangsdk "github.com/opentelekomcloud/gophertelekomcloud" | ||
"github.com/opentelekomcloud/gophertelekomcloud/internal/extract" | ||
) | ||
|
||
// List Querying the Cluster List. | ||
// Send request GET /v1.1/{project_id}/clusters | ||
func List(client *golangsdk.ServiceClient) ([]*ClusterQuery, error) { | ||
|
||
raw, err := client.Get(client.ServiceURL(clustersEndpoint), nil, nil) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
var res []*ClusterQuery | ||
err = extract.IntoSlicePtr(raw.Body, &res, "clusters") | ||
return res, err | ||
} |
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.
maybe better to add xLang to CreateOpts as: