Closed jag3773 closed 6 years ago
@jag3773 how is this for the endpoint output?
{
"status": {
"3": "complete",
"uw.2": "incomplete",
"ts.2": "in-progress"
},
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"errors": {
"webhook": [],
"ts_v2_catalog": [{
"message": "some error",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"retries": 2
}],
"uw_v2_catalog": [],
"catalog": [],
"signing": []
}
}
@neutrinog Would it be easy enough to pivot the data so each catalog is at the top level?
For example:
{
"catalogs": [
{
"name": "3",
"status": "complete",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"errors": "none"
},
{
"name": "uw.2",
"status": "incomplete",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"errors": "none"
},
{
"name": "ts.2",
"status": "in-progress",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"errors": [
{
"message": "some error",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"retries": 2
}
]
}
]
}
we could. that's how I was originally going to do it. however we have two lambdas that don't fit that structure: signing, webhook
.
We could follow your structure and then add a global errors section that contains errors for those two lambdas.
What status information do we have for those extra 2 lambdas? If we renamed catalogs
to functions
would that suffice?
We don't have any status information for those two just errors. We collect status for the three APIs and report errors for five lambdas.
technically we could place webhook errors under the v3 catalog errors since everything first goes through the v3 api. However signing is used by all three and we don't currently have a way to determine which api it's running for.
we could mock the status for all of the lambdas. So the webhook and signing lambda would just have a status of either ok
or error
depending on the presence of errors. Then we can name catalogs
to functions
like you suggested. And the status for the three apis could also be simplified to ok
or error
. (complete
or in-progress
=> ok
)
@jag3773 what about this? I removed the status field since we can infer the status from the existence of errors. This does not indicate if a catalog is currently being built. Do we need that information?
{
"functions": [
{
"name": "3",
"lambda": "catalog",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"errors": []
},
{
"name": "uw.2",
"lambda": "uw_v2_catalog",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"errors": []
},
{
"name": "ts.2",
"lambda": "ts_v2_catalog",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"errors": [
{
"message": "some error",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"retries": 2
}
]
},
{
"name": "signing",
"lambda": "signing",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"errors": []
},
{
"name": "webhook",
"lambda": "webhook",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"errors": []
}
]
}
@neutrinog Yes, I would like a status field as that makes creating a monitoring check a lot easier.
I'd vote to mock the status field as "complete". That way I can create a simple check that errors if any of the function status fields != "complete".
can you provide a json sample?
{
"functions": [
{
"name": "3",
"status": "complete",
"lambda": "catalog",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"errors": []
},
{
"name": "uw.2",
"status": "complete",
"lambda": "uw_v2_catalog",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"errors": []
},
{
"name": "ts.2",
"status": "in-progress",
"lambda": "ts_v2_catalog",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"errors": [
{
"message": "some error",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"retries": 2
}
]
},
{
"name": "signing",
"status": "complete",
"lambda": "signing",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"errors": []
},
{
"name": "webhook",
"status": "complete",
"lambda": "webhook",
"timestamp": "2017-10-20T17:27:53.578223+00:00",
"errors": []
}
]
}
ah ok. like we had originally but the signing and webhook functions will always be "complete".
@jag3773 what do you think? https://dev-api.door43.org/v3/lambda/status
Perfect!
It's been deployed to production.
Great, looks good.
Story
As a publisher I want to know if there are problems with resources that have been pushed into the pipeline so that I know if they are actually in the catalog or not.
Notes
The intention is to have a /status endpoint which returns build status information in JSON format. We should get a status indication for each catalog:
3
,uw.2
,ts.2
. Further, if there are errors in theerrors
table those should also be provided in the response.First task is to fill out the specification below on what we can easily make happen.
Desired JSON Output Specification