GoogleCloudPlatform / GoogleCloudPlatform/application-integration-management-toolkit
[FR] Expose `takeoverEditLock` functionality for Versions in CLI tool
- Dominant language
- Go
- Stars
- 34
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
Currently due to the [edit-lock restrictions](https://cloud.google.com/application-integration/docs/view-integration-details#integration-edit-locks) user needs to go to the UI to take over , which breaks the flow of any automation.
**Describe the solution you'd like**
It seems there is a mechanism in the cli tool to take over the edit lock:
https://github.com/GoogleCloudPlatform/application-integration-management-toolkit/blob/9e19b2b4d306aa8ae7f0f02e5cf7254b9156c727/internal/client/integrations/integrations.go#L379C6-L379C22
But I do not see this function call anywhere in the code.
If we inspect browser activity when clicking "Take Over" from UI, I do see this undocumented API Call:
`google.cloud.integrations.v1alpha.IntegrationVersions/TakeoverEditLock`
The REST API explorer already has a way to takeover edit locks [but only for Test Cases](https://cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.integrations.versions.testCases/takeoverEditLock)
And Modifying this API call seems to work well so far:
```
curl --request POST \
'https://integrations.googleapis.com/v1alpha/projects/[PROJECT_NUMBER]/locations/[LOCATION]/integrations/[INTEGRATION_NAME]/versions/[VERSION_ID]:takeoverEditLock' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{}' \
--compressed
```
Can this be implemented in the CLI tool as well?
**Describe alternatives you've considered**
Modifying an undocumented restapi call works, so API exists.
Contributor guide
Assessment
This issue has not been assessed yet.