Open zikalino opened 5 years ago
My design would be (considering this is Ansible-only and not a common pattern across all resources):
status
property of string enum containing something like Started
, Stopped
, etc. User would also provide their customized code snippet in ansible.yaml to link the enum value with the actual api call. (And for terraform.yaml, just ignore this property)How do you think about that?
If we do (1) it won't be automatic code generation, we will have to include the same custom code again and again for different azure resources. I think we should have proper operations defined, then we should have default handling for these, and if it doesn't work as we want we should create custom code.
@zikalino Yes you are right. I do not plan to make it automatic for the following reasons:
So why not for now let's using manual customization code snippet. If in the future we found there are so many similar patterns, we can generate those customization code snippets, instead of putting everything into api.yaml since terraform does not need it.
@JunyiYi So we should resolve some basics, here are several unknowns:
I think this feature can be postponed a bit, maybe hurrying to do it now will result in something we will have to undo in the future.
@yungezz what do you think?
@zikalino I agree we should carefully design the feature. My two cents are, if a feature is only supported in one specific product (no matter Terraform or Ansible), then it should not be put in api.yaml.
For now, maybe customization is the standard work-around to unblock the scenario? I think you can just make azure_sdk_references: []
an empty array, I will fix magic-modules to support that.
Should api.yaml allow defining custom actions? They could be for example "start", "stop", "generalize", etc. They have different URL in REST API, for instance "…../virtualMachines/myVm/stop", and they have separate method in SDK as well. We should have schema for that so autorest.devops can generate api.yaml correctly.