Show feedback to user as part of Building Block run
complete
Jelle den Burger
complete
We now support this using the building block run API! The feedback put in there will be shown to application teams in the panel.
https://docs.meshcloud.io/api/index.html#mesh_buildingblockrun
S
Sergi Domingo Basora
Great feature!
Jelle den Burger I have one question: checking the API docs, I don't see a way to retrieve runs for a certain Building Block. Is it possible someway? Potential use case: fetch the latest / ongoing run for a specific Building Block (given the BB ID) and then update that run using the meshBuildingBlockRun endpoint.
Jelle den Burger
Sergi Domingo Basora Hi Sergi, we have thought about this. I just realized it is missing from the documentation (we will add it in the next update) but for the time being I can tell you how it works.
First of all, you need to mark your Building Block as Asynchronous. You do so under "Implementation -> Execution Mode -> Asynchronous".
After you can actually find the Run ID via an automatically injected Terraform variable. These look like this:
variable "meshstack_building_block_run_b64" {
type = string
description = "The base64 encoded JSON of the Building Block Run object."
default = "%s"
}
variable "meshstack_building_block_id" {
type = string
default = "%s"
}
variable "meshstack_building_block_run_id" {
type = string
default = "%s"
}
I assume in your case you'd want to use the
meshstack_building_block_run_id
variable and get the run IDS
Sergi Domingo Basora
Jelle den Burger Thanks Jelle. I was aware of Asynchronous execution and the Terraform variable for the run ID. However, my question was in a different direction:
Suppose I have some different Building Blocks, which can be listed in the API. Using the Building Block endpoints, I can retrieve information from them -- for example, I can list their their outputs, show their metadata, etc. However, I cannot fetch the list of their runs, so I have no relationship between the Building Block IDs and its Run IDs.
I'd just like to ask the API "what are the runs of my Building Block?" and get the list of runs.
Sure, whenever a Terraform run is executed, I can store the
meshstack_building_block_run_id
variable in some internal system and "link" each Building Block to their IDs. But I need to do that in a database or something myself, and I would like the API to provide this data instead.Jelle den Burger
Sergi Domingo Basora I see. Yeah this is sadly not possible right now as there is no list/get endpoint for building block runs.
What use case do you have in mind to make this work using this potential API?
S
Sergi Domingo Basora
Jelle den Burger Right now, I am just exploring, but some things came into my mind
- Batch update the status of several Building Blocks in one go (by listing the BBs and getting the list of runs that are pending)
- Make my automations be able to provide status just by having the BB ID instead of needing to pass it the run ID
- Detect if a Building Block run was the first run, or if it was re-run by an admin (by fetching the list of runs for that BB)
- Get statistics of Building Block runs, for example, list all runs that failed / were stuck in progress
Jelle den Burger
Sergi Domingo Basora: I think these are very valuable insights. I will put them into a new feature request so we can keep track! I created it on your behalf.
S
Sergi Domingo Basora
Jelle den Burger Thank you Jelle!