Skip to content

Commit

Permalink
Merge pull request #57 from squaredup/work/ss/update-query-api
Browse files Browse the repository at this point in the history
Update Query to New Graph Query Endpoint
  • Loading branch information
shaswot77 authored Apr 23, 2024
2 parents e8134cf + 31fbe68 commit 3774cab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions internal/provider/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func (c *SquaredUpClient) doRequest(req *http.Request) ([]byte, error) {

req.Header.Add("User-Agent", fmt.Sprintf("SquaredUp-Terraform-Provider/%s", c.version))

if req.Body != nil {
req.Header.Add("Content-Type", "application/json")
}

res, err := c.httpClient.Do(req)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/client_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (c *SquaredUpClient) GetNodes(dataSourceId string, nodeName string, nodeSou
return nil, err
}

req, err := http.NewRequest("POST", c.baseURL+"/api/query", strings.NewReader(string(reqBody)))
req, err := http.NewRequest("POST", c.baseURL+"/api/graph/query", strings.NewReader(string(reqBody)))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 3774cab

Please sign in to comment.