f5-common-python
f5-common-python copied to clipboard
Classes should follow naming convention
There are quite a few classes that do not follow naming convention, i.e using plural or _s for collections and singular for resources:
e.g. policys_s, policys ==> policys_s, policy profiles_s, profiles ==> profiles_s, profile
There are a lot more examples, and we should refactor this to stay in line with what we set in our dev guide. This will break backwards compatibility.
@zancas @pjbreaux @caphrim007 @jasonrahm
After some thinking on the subject, i think the best approach is to follow naming pattern derived from json kind. This would mean as follows:
- If the the last part of json kind for a name of a resource is in plural, the sub-collection class name of that resource would have '_s' added. Then subsequently, the resource class name would be in plural. For example:
tm:security:firewall:rule-list:rules:rulesstate
Collection = RULES_S
Resource = RULES
- If the the last part of json kind for a name of a resource is in singular, the sub-collection class name of that resource would have 's' or '_s' added. However name of the class for resource would be in singular. For example:
tm:security:firewall:address-list:address-liststate
Collection = Address_Lists
Resource = Address_List
tm:asm:policies:policystate
Collection = Policies_s
Resource = Policy
@caphrim007 @jasonrahm @zancas @pjbreaux
Please let me know your thoughts, and if you agree, we need to put this inside developer documentation. I will start refactoring after we agree on the end format. This will break backwards compatibility in some cases.
We have to do this sooner than later in order to have this SDK remain consistent.
how is this any different that what is already there?
There are few places where it is inconsistent
closing due to lack of interest
re-opening. this still needs to be fixed. there is no lack of interest