Skip to content

Commit

Permalink
Merge pull request #15 from CloudBoltSoftware/CMP-2795_support_update…
Browse files Browse the repository at this point in the history
…d_run_action_response

[CMP-2795] - Run Action API Response Update
  • Loading branch information
alexandre-a-rocha authored Jan 25, 2025
2 parents e6af043 + 994c491 commit 452feb3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cbclient/action_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

// SubmitAction runs an action on the CloudBolt resource or server
func (c *CloudBoltClient) SubmitAction(actionPath string, resourcePath string, parameters map[string]interface{}) (*CloudBoltJob, error) {
func (c *CloudBoltClient) SubmitAction(actionPath string, resourcePath string, parameters map[string]interface{}) (*CloudBoltRunActionResult, error) {
apiurl := c.baseURL
apiurl.Path = fmt.Sprintf("%srunAction/", actionPath)

Expand All @@ -33,7 +33,7 @@ func (c *CloudBoltClient) SubmitAction(actionPath string, resourcePath string, p
}

// We Decode the data because we already have an io.Reader on hand
var actionRes CloudBoltJob
var actionRes CloudBoltRunActionResult
json.NewDecoder(resp.Body).Decode(&actionRes)

return &actionRes, nil
Expand Down
11 changes: 11 additions & 0 deletions cbclient/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ type CloudBoltReferenceFields struct {
ID string `json:"id"`
}

type CloudBoltRunActionResult struct {
ResourceHref string `json:"resource"`
Results struct {
Job CloudBoltJob `json:"job"`
Order CloudBoltOrder `json:"order"`
Status string `json:"status"`
OutputMessage string `json:"outputMessage"`
ErrorMessage string `json:"errorMessage"`
} `json:"results"`
}

// New returns an initialized CloudBoltClient object.
// Accepts as input:
// - HTTP Protocol (protocol) e.g., "https"
Expand Down

0 comments on commit 452feb3

Please sign in to comment.