Context
Neither the AWS executeExchange handler (internal/api/handler_ri_exchange.go) nor the new Azure executeAzureExchange handler (PR LeanerCloud/cloud-commitments-cli#1515, closes LeanerCloud/cloud-commitments-cli#596) writes a ledger/audit row when an exchange is executed directly via the API (as opposed to the approve/reject scheduled-exchange flow, which does persist via RIExchangeRecord / ExecuteApprovedExchange).
This is a parity gap for both providers, not something LeanerCloud/cloud-commitments-cli#596 introduced -- the AWS direct-execute path already has the same gap.
Scope
- Decide whether direct-API executes should write to the same
ri_exchange_history (or equivalent) table the scheduled-approval flow uses, or a separate audit log.
- Persist: subscription/account, source reservation IDs, target SKU/region/term, session ID, net payable + currency, status, executed-by (session/API key), timestamp.
- Apply to both the AWS and Azure execute handlers for consistency.
Notes
Context
Neither the AWS
executeExchangehandler (internal/api/handler_ri_exchange.go) nor the new AzureexecuteAzureExchangehandler (PR LeanerCloud/cloud-commitments-cli#1515, closes LeanerCloud/cloud-commitments-cli#596) writes a ledger/audit row when an exchange is executed directly via the API (as opposed to the approve/reject scheduled-exchange flow, which does persist viaRIExchangeRecord/ExecuteApprovedExchange).This is a parity gap for both providers, not something LeanerCloud/cloud-commitments-cli#596 introduced -- the AWS direct-execute path already has the same gap.
Scope
ri_exchange_history(or equivalent) table the scheduled-approval flow uses, or a separate audit log.Notes
h.config.GetRIExchangeHistory/RIExchangeRecordininternal/configfor the existing schema the scheduled-approval flow writes to.