Hello! I would like to automate the execution of ...
# gooddata-platform
p
Hello! I would like to automate the execution of release/provision/rollout bricks via CI/CD (& also trigger user/user filter bricks following certain events in our system). How should I go about calling the API to run the bricks (and ensure completion before triggering the next brick)? Do you have some docs on how to proceed? Thanks!
1
v
I have the same question
m
Hi Philippe, Vincil, yes, this is for sure possible. (BTW @Vincil Bishop, I saw you were asking for GoodData.CN on other question so just FYI - these APIs are in the hosted GoodData Platform only. There is no data pipeline or LCM bricks in the GoodData.CN and the lifecycle management is handled the concept of parent workspaces and with APIs). OK so here is how to execute the schedule in the GoodData Platform: the API to execute is documented here. It has a lot of options as you can pass additional parameters or fine-tune various ADD execution params, but if all you want to do is execute the schedule as-is the same way as you would do in the UI all you need to do is:
Copy code
POST /gdc/projects/{projectId}/schedules/{scheduleId}/executions

{
  "execution":{}
}
where {projectID} is the ID of your workspace and {scheduleID} is ID of your schedule - you can easily find it - it is in the URL if you click on the schedule in in the Data Integration Console (it is the part after
/schedules/
in the URL). Once you execute this API, it puts your execution into the queue and it will return you a link to it with unique executionID. On that link you can easily check its status by calling GET on it. The link is in form of:
Copy code
GET /gdc/projects/{projectId}/schedules/{scheduleId}/executions/{executionID}
So you can poll for the execution result with some reasonable interval like once a minute or so. One of the properties there is
status
and it can be one of these: • SCHEDULED = waiting to be executed in the queue • RUNNING = being executed right now • ERROR = finished with error • WARNING = finished with warning • OK = finished with success You can also check each schedule and their last execution and last successfull execution without specifying the executionID by calling
Copy code
GET /gdc/projects/{projectId}/schedules/{scheduleId}
And finally, you can list history of executions of a particular schedule like this:
Copy code
GET /gdc/projects/{projectId}/schedules/{scheduleId}/executions
I hope this helps.
1
p
Hey Michal! Lovely, that indeed answers my question clearly 🙂
v
Thanks @Michal Hauzirek! I have figured out my issue...and we are stable and able to reliably promote models/objects between environments...so off to the races! Thanks!!!