-
Notifications
You must be signed in to change notification settings - Fork 259
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
Add the /apis endpoint call with expand false flag #2985
base: choreo
Are you sure you want to change the base?
Conversation
53002a1
to
aa16e1f
Compare
…it is the startup. The JMS/ASB event's details are used to populate the necessary maps(api-metadata) APIList object is not passed to the enforcer now, instead of that EnforcerAPI's lifecycle state is used. Any API within the api metadata map should be kept only if the API is a default API or API is in blocked state. If the API becomes unblocked, it is removed from the map. During the startup also only blocked and default versioned APIs are pulled.
aa16e1f
to
f3ac1b8
Compare
mgwSwagger.LifeCycleState = blockedStatus | ||
return | ||
} | ||
mgwSwagger.LifeCycleState = nonBlockedStatus |
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.
Leave the lifecycleState as it is.
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.
Changed the lifecycle status to be published.
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.
Reverted to previous state as we cannot decide whether the API is in created or published state when deployed for the first time. (Cannot depend on the API.yaml to populate this field)
...nforcer/src/main/java/org/wso2/choreo/connect/enforcer/admin/handlers/APIRequestHandler.java
Outdated
Show resolved
Hide resolved
@@ -20,117 +20,20 @@ | |||
|
|||
import org.wso2.choreo.connect.enforcer.common.CacheableEntity; | |||
|
|||
import java.util.ArrayList; |
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.
Remove the API.java as it remains unused.
...cer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/models/admin/APIInfo.java
Outdated
Show resolved
Hide resolved
...r/src/main/java/org/wso2/choreo/connect/enforcer/subscription/SubscriptionDataStoreImpl.java
Show resolved
Hide resolved
...r/src/main/java/org/wso2/choreo/connect/enforcer/subscription/SubscriptionDataStoreImpl.java
Outdated
Show resolved
Hide resolved
apiInfo.setTier(api.getApiTier()); | ||
apiInfo.setVersion(api.getApiVersion()); | ||
apiInfo.setProvider(api.getApiProvider()); | ||
apiInfo.setApiUUID(api.getAPIConfig().getUuid()); |
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.
Extends on BasicAPIInfo
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.
We had to remove tier as the BasicAPIInfo class already contains the policy. Since this is just used for troubleshooting I guess it is fine.
Purpose
Since the /apis endpoint call was a costly operation (due to API Manager DB operations), this was removed from the choreo branch. As a result of that, switching an API to Blocked Lifecycle state did not function.
With this PR, the /apis endpoint call will be added again. Hence the fore-mentioned limitation will be removed.
In this case, the /apis endpoint will be called with the query parameter expand=false so that it would return default APIs and blocked APIs only. This call is made during the startup. Then onwards, the blocked APIs and default APIs are identified using message events.
Issues
Fixes #2857
Automation tests
Tested environments
Not Tested
Maintainers: Check before merge