-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor create/delete dataset entry
- Loading branch information
1 parent
3b19c3f
commit b4bb92c
Showing
3 changed files
with
33 additions
and
22 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
package datasetIngestor | ||
|
||
import ( | ||
"log" | ||
"net/http" | ||
"strings" | ||
) | ||
|
||
func DeleteDatasetEntry(client *http.Client, APIServer string, datasetId string, accessToken string) { | ||
// note: this function is unused in cmd after a change in datasetIngestor command | ||
func DeleteDatasetEntry(client *http.Client, APIServer string, datasetId string, accessToken string) error { | ||
req, err := http.NewRequest("DELETE", APIServer+"/Datasets/"+strings.Replace(datasetId, "/", "%2F", 1)+"?access_token="+accessToken, nil) | ||
if err != nil { | ||
return err | ||
} | ||
// fmt.Printf("Request:%v\n",req) | ||
resp, err := client.Do(req) | ||
// fmt.Printf("resp %v %v\n",resp.Body,resp.StatusCode) | ||
if err != nil { | ||
log.Fatal(err) | ||
return err | ||
} | ||
defer resp.Body.Close() | ||
return nil | ||
} |