-
Notifications
You must be signed in to change notification settings - Fork 334
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
New Module [API Management] #322
Conversation
tests/integration/targets/azure_rm_apimanagement/tasks/main.yml
Outdated
Show resolved
Hide resolved
@sakar97 After you update, you can follow the link below to do sanity verification to verify that the format is correct!
|
@sakar97 |
Hi @paultaiton We thought it would be better to use predefined generic Azure rest api client instead of any other method. |
Hello @nikhilpatne . The vast majority of modules in this collection follow the pattern of using a '@Property' decorated method located in azure_rm_common.py to contain an azure.mgmt.XYZ client, and to use it in module code to manage the resources. Done this way it leads to code that is more pythonic, more robust ( the specific use case is better tested by upstream Azure-python-sdk team,) cleaner code that is more concise and follows patterns better in regards to naming, and MUCH more maintainable long term. I appreciate everyone who contributes free code for all to use and am grateful you and @sakar97 have taken the time, but I think rewriting this module to follow the standard practice used almost everywhere else in the collection will produce a better product in the long term that is much easier to maintain by the community going forward. That's only my opinion of course, and the decision would be down to the project maintainers ( if I'm not mistaken @Fred-sun and @haiyuazhang .) Thanks everyone, |
Thanks @paultaiton for your valuable feedback, will work on it |
Hi, @paultaiton I am trying to use azure-mgmt-apimanagement, specifically the |
Hello @sakar97 . Have you updated the code in this PR with what you're asking for? I'm not understanding exactly what you're asking, and would need to see the code giving your problems to really understand. The general pattern for the management clients is to have a @Property decorated function in the azure_rm_common.py file in module_utils that corresponds to something like apimanagement_client that instantiates the management client class. Then one of the methods of that class will be apimanagement_client.api_management_service.create_or_update() . Below is a very rough outline of what you would do outside of Ansible to use the python SDK to create (or update) an apim service:
I hope that helps. Shoot me any other questions you have. |
Hi @paultaiton, I have understood the process you have explained, and to be more precise with the problem I have changed |
@sakar97 |
@paultaiton Yes, this module is for Individual API in apim services. Module for individual apim services are open in #333. |
Hi @paultaiton Did you find the issue which I was referring. Thanks |
I apologize for my delay in response, I haven't had a chance to look into this. I will try and take a look this weekend. I'm not an expert in API management at all, so I'm having to make assumptions based on the standard usage pattern of the Azure python SDK's management clients. |
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.
@sakar97 The content of the document and the return value, the indentation between the upper and lower levels should be 4 characters, thank you!
|
||
|
||
if __name__ == '__main__': | ||
main() |
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.
no newline at end of file
@sakar97 You can check the module through the link below。 link: https://docs.ansible.com/ansible/devel/dev_guide/testing_sanity.html#testing-sanity |
|
Hello @Fred-sun Could you help me figure out the error? This module is open since quite a lot of time now. Thanks |
@sakar97 There are a lot of Sanity errors, can you authorize me to make some updates in your branch? Thank you very much! |
Hi, @Fred-sun I have given you the permission. Kindly approve. Thanks |
@Fred-sun Could you take a look at it? |
@Ompragash I'm working in this! Thank you very much! |
SUMMARY
This module introduces a wide variety of configurations for creating an API instance on Azure.
Fixes #209
ISSUE TYPE
COMPONENT NAME
azure_rm_apimanagement
ADDITIONAL INFORMATION
This module allows user to create/update or delete the api management instance. It also provides all the parameters given by
Microsoft.ApiManagement service/apis
More information: https://docs.microsoft.com/en-us/azure/templates/microsoft.apimanagement/service/apis