-
Task
-
Resolution: Done
-
Normal
-
None
We have ported the capacity endpoints in swatch-contracts we should transfer the routing for the requests from swatch-api over to swatch-contracts.
The goal is that after this work goes live, if there are any issues then we can roll back to routing the traffic to swatch-api and everything will work properly.
Changes probably needed: swatch-api/deploy/clowdapp.yaml
https://github.com/RedHatInsights/rhsm-subscriptions/blob/169b8b0d6cd935e0549be40bf37205650a0a70ba/swatch-api/deploy/clowdapp.yaml#L359
The route should be rewritten to use /api/swatch-contracts/ instead of /api/rhsm-subscriptions/ since the clowdapp name will overwrite this portion of the route when deployed.
Public routes are generally "protected" by an opt-in check. We don't want to do this anymore. If we hit an API to get information for an org that's not opted in, there wouldn't be any data to retrieve anyway, and a response with "no" information in it is still valid. Since we eventually want to do away with opt-in all together (auto opt in all the things), there's not a good reason to continue to implement it.
Reference config:
location /api/rhsm-subscriptions/v1/subscriptions/billing_account_ids { rewrite ^/api/rhsm-subscriptions/v1/subscriptions/billing_account_ids$ /api/swatch-contracts/v1/subscriptions/billing_account_ids break; proxy_pass http://swatch-contracts; }
Done Criteria
- No change is made to swatch-api. All the capacity endpoints still work in swatch-api eve:n though they will not be used after this card.
- swatch-api-nginx-proxy routes the traffic for the capacity endpoints to the API endpoints on swatch-contracts
- Make sure iqe tests are still passing with this change. Previously we might have missed to copy feature functionalities at both places.
- Endpoints don't need to check for opt-in status, but any customer-facing endpoints need to have orgId validation for customer users (this looks like it's already done, see https://github.com/RedHatInsights/rhsm-subscriptions/blob/bfd93bd17f90ff0e1e62dfc3a9cb5a6e4783dc83/swatch-contracts/src/main/java/com/redhat/swatch/contract/resource/api/v1/ContractsV1Resource.java#L55 and https://github.com/RedHatInsights/rhsm-subscriptions/blob/bfd93bd17f90ff0e1e62dfc3a9cb5a6e4783dc83/swatch-contracts/src/main/java/com/redhat/swatch/contract/resource/api/v1/CapacityResourceV1.java#L297 )
- blocks
-
SWATCH-3353 Remove deprecated v1,v2 capacity api
-
- Backlog
-
- is blocked by
-
SWATCH-3524 Replace the quarkus-rest extension by quarkus-resteasy extension
-
- Closed
-
-
SWATCH-2842 Implement logic for capacity endpoints into swatch-contracts
-
- Closed
-
-
SWATCH-3469 Spike: Replace the quarkus-rest extension by quarkus-resteasy extension
-
- Closed
-