Skip to content

Commit

Permalink
Merge pull request #447 from jihoon-seo/210406-Add-URL-encoding-for-S…
Browse files Browse the repository at this point in the history
…pider-image-lookup-API-call

Add URL encoding for Spider image lookup API call
  • Loading branch information
seokho-son authored Apr 6, 2021
2 parents 9f280d6 + 959d46d commit 7ba5e86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/core/mcir/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package mcir
import (
"encoding/json"
"fmt"
"net/url"
"os"
"strconv"

Expand Down Expand Up @@ -348,7 +349,7 @@ func LookupImage(connConfig string, imageId string) (SpiderImageInfo, error) {

if os.Getenv("SPIDER_CALL_METHOD") == "REST" {

url := common.SPIDER_REST_URL + "/vmimage/" + imageId
url := common.SPIDER_REST_URL + "/vmimage/" + url.QueryEscape(imageId)

// Create Req body
type JsonTemplate struct {
Expand Down
2 changes: 1 addition & 1 deletion test/official/6.image/registerImageWithId.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
source ../common-functions.sh
getCloudIndex $CSP

curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NS_ID/resources/image?action=registerWithInfo -H 'Content-Type: application/json' -d \
curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NS_ID/resources/image?action=registerWithId -H 'Content-Type: application/json' -d \
'{
"connectionName": "'${CONN_CONFIG[$INDEX,$REGION]}'",
"name": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
Expand Down

0 comments on commit 7ba5e86

Please sign in to comment.