Skip to content

Commit

Permalink
Fix elastic url to be fully qualified
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Sloka <[email protected]>
  • Loading branch information
stevesloka committed Apr 27, 2018
1 parent eabce26 commit 8e8e126
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func CreateSnapshotRepository(elasticURL, s3BucketName, username, password strin
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{Transport: tr}
url := fmt.Sprintf("%s/_snapshot/%s", elasticURL, s3BucketName)
url := fmt.Sprintf("https://%s:9200/_snapshot/%s", elasticURL, s3BucketName)
body := fmt.Sprintf("{ \"type\": \"s3\", \"settings\": { \"bucket\": \"%s\", \"server_side_encryption\": \"true\" } }", s3BucketName)
req, err := http.NewRequest("PUT", url, strings.NewReader(body))

Expand Down Expand Up @@ -91,7 +91,7 @@ func CreateSnapshot(elasticURL, s3BucketName, username, password string) error {
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{Transport: tr}
url := fmt.Sprintf("%s/_snapshot/%s/snapshot_%s?wait_for_completion=true", elasticURL, s3BucketName, fmt.Sprintf(time.Now().Format("2006-01-02-15-04-05")))
url := fmt.Sprintf("https://%s:9200/_snapshot/%s/snapshot_%s?wait_for_completion=true", elasticURL, s3BucketName, fmt.Sprintf(time.Now().Format("2006-01-02-15-04-05")))

req, err := http.NewRequest("PUT", url, nil)
if err != nil {
Expand Down

0 comments on commit 8e8e126

Please sign in to comment.