-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(satp-hermes): implement API1 endpoints #3605
feat(satp-hermes): implement API1 endpoints #3605
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good in general but I left a few suggestions for generic code quality improvement
...s/cactus-plugin-satp-hermes/src/main/typescript/blo/admin/get-healthcheck-handler-service.ts
Outdated
Show resolved
Hide resolved
throw error; | ||
} else { | ||
logger.error(`${fnTag}, Unexpected error: ${error.message}`); | ||
throw new Error("An unexpected error occurred while obtaining status."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AndreAugusto11 Very very new thing but on the main branch (as of 4 days ago) now you can use these constructs for chaining errors with their causes:
#3593
I'm not sure if the current base branch you are sending this PR against is up to date with main that recently, but just for at least future reference wanted to make note that you could soon (or maybe already) use the cause
property of the Error
built-in type as shown in the PR description of the PR linked above.
Just raising awareness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a neat feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RafaelAPB could you please confirm that this branch is not rebased with main? In that case, I woud defer this change to a future PR when merging/rebasing with main
...s/cactus-plugin-satp-hermes/src/main/typescript/blo/admin/get-healthcheck-handler-service.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM apart from a few minor issues. Please make sure to incorporate @petermetz 's feedback as well
packages/cactus-plugin-satp-hermes/src/main/typescript/web-services/healthcheck-endpoint.ts
Show resolved
Hide resolved
packages/cactus-plugin-satp-hermes/src/main/typescript/gol/satp-manager.ts
Outdated
Show resolved
Hide resolved
@AndreAugusto11 can you please solve conflicts? |
436daec
to
1209a3d
Compare
Implemented the following endpoints, with some initial tests: * healthcheck: responds if SATP Hermes is on * get status: retrieve the status of a SATP session * get integrations: retrieves data about each supported network, or other external system Signed-off-by: André Augusto <[email protected]>
1209a3d
to
1374b89
Compare
@RafaelAPB @petermetz thanks a lot for the comments and suggestions. I have applied them and updated the PR. The main changes were related to passing the log Level instead of the Logger itself and creating an Enum for the gateway status. Also, updated the open API specification to be consistent with the new Enum |
Thank you very much, great work |
Implemented the following endpoints, with some initial tests: