Closed theneedyguy closed 11 months ago
Hi @theneedyguy ,
Thank you for the PR! These are great changes and will be integrated into the next version (3.0.1). In reviewing the change, I found a number of areas in the API that were not properly returning the right information (example: If an ID for component doesn't exist). v3.0.1 will update all APIS to resolve this, as well as add your suggested changes.
I'm trying to determine the best way to merge these changes with your edits. I will update the PR once that process is complete.
Thank you again for the contribution!
-Bryan
@BryanSoltis Thanks for reviewing my changes. I too found that some areas would not return an empty array if the index was out of bounds but would instead return the last item of the array.
P.S. The reason for my contribution was to be able to use the naming tool with Terraform together Mastercard's rest_api module. My changes would allow the "creation" and "destruction" of names using the API. What I also found is when using the module, the API would not be fast enough to create multiple names in parallel. This might be because using JSON as the storage is not suited for parallel writes. The workaround is setting the Terraform parallelism to 1 when applying the config. Maybe using a proper DB for data storage could fix this issue or maybe adding some kind of queueing mechanism to make sure the index is already used and to move on to the next free index. This an extremely niche case and the workaround works for me so that might be something for the future.
Hi @theneedyguy,
Thank you for your PR! These changes will be merged into the project, then updated with new functionality to align with recent API updates.
-Bryan
You can test out the changes in the pre-lease here:
https://github.com/mspnp/AzureNamingTool/releases/tag/v3.0.1
Please let me know if you have any issues!
-Bryan
This will allow API users to query the generated names by providing an ID in the URL.