[gateway-controller] Notify on-prem APIM of deploy/undeploy status via notify-api-deployment-status#1302
Closed
YasasRangika wants to merge 217 commits intowso2:feature-on-prem-apim-connectionfrom
Closed
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Gateway-controller now notifies the on-prem APIM's internal API when API deploy or undeploy events are processed, so deployment stats (deployedGatewayCount, failedGatewayCount) and revision state stay in sync with the Synapse flow.
Changes
1. New
notifyDeploymentStatusand request typesdeploymentStatusAckPayload/deploymentStatusAckItem: JSON payload aligned with APIMGatewayDeploymentStatusAcknowledgmentListDTO(gatewayId, apiId, deploymentStatus, action, revisionId, timeStamp; tenantDomain left empty — APIM resolves org from gatewayId).notifyDeploymentStatus(apiID, revisionID, status, action string):{getRestAPIBaseURL()}/notify-api-deployment-statuswith api-key auth and JSON body.bytes.NewReader(body)for the request body (addedbytesimport).2. Deploy event – success and failure notification
handleAPIDeployedEvent:fetchAndDeployAPI: callsnotifyDeploymentStatus(apiID, deploymentID, "FAILURE", "DEPLOY")so APIM can increment failedGatewayCount.notifyDeploymentStatus(apiID, deploymentID, "SUCCESS", "DEPLOY")so deployedGatewayCount is updated (same idea as Synapse DeploymentStatusNotifier).3. Undeploy event – success notification
handleAPIUndeployedEvent: After updating the xDS snapshot, callsnotifyDeploymentStatus(apiID, "", "SUCCESS", "UNDEPLOY")so deployment stats reflect the undeploy.Context
APIM’s internal API exposes
POST /notify-api-deployment-statusso gateways can report deploy/undeploy results. APIM uses these acks to updateAM_GW_REVISION_DEPLOYMENTand deployment stats. Without these calls, platform gateways would not update deployedGatewayCount/failedGatewayCount like Synapse gateways do.Testing