Skip to content
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

Some apis name need refactoring #5

Open
tanmayx opened this issue Feb 13, 2017 · 2 comments
Open

Some apis name need refactoring #5

tanmayx opened this issue Feb 13, 2017 · 2 comments

Comments

@tanmayx
Copy link

tanmayx commented Feb 13, 2017

ucsc apis: Latest code
python version: 2.7.12

Below APIs name need to be changed in parity with others -
user_add_role() --> should be user_role_add()
user_remove_role() --> should be user_role_remove()
user_add_locale() --> should be user_locale_add()
user_remove_locale() --> should be user_locale_remove()

Some more APIs to be refactored -
qos_policy_add() -> qos_policy_create()
qos_policy_remove() -> qos_policy_delete()
mac_pool_remove() -> mac_pool_delete()
lcp_vnic_delete() -> lcp_vnic_remove()
lcp_iscsi_vnic_delete() -> lcp_iscsi_vnic_remove()
ip_pool_remove() -> ip_pool_delete()
radius_provider_group_add_provider() -> radius_provider_group_provider_add()
radius_provider_group_modify_provider() -> radius_provider_group_provider_modify()
radius_provider_group_remove_provider() -> radius_provider_group_provider_remove()

Some APIs in tacacsplus.py module also needs refactoring.
ntp_server_create API name can be changed to ntp_server_add

The 'severity' param in syslog_local_console_enable API takes only 3 values ('emergencies', 'alerts' and 'critical'). But as per UI, we have 5 more values ('error', 'warning', 'notification', 'information', 'debug'). Setting one of these values through the API throws below error -

Traceback (most recent call last):
File "c:\python27\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "C:\Tanmay\PythonSDK\pysdkframework\TestSuite_UcsCentral\Nosetests\admin\test_syslog.py", line 38, in test_syslog_local_console_enable

severity='error')
File "c:\python27\lib\site-packages\ucsc_apis-0.9.0.0-py2.7.egg\ucsc_apis\admin\syslog.py", line 52, in syslog_local_console_enable
mo.severity = severity
File "c:\python27\lib\site-packages\ucscsdk-0.9.0.0-py2.7.egg\ucscsdk\ucscmo.py", line 134, in setattr
self.__set_prop(name, value)
File "c:\python27\lib\site-packages\ucscsdk-0.9.0.0-py2.7.egg\ucscsdk\ucscmo.py", line 185, in __set_prop
value))
ValueError: Invalid Value Exception - [CommSyslogConsole]: Prop , Value.
-------------------- >> begin captured logging << --------------------
ucscentral: DEBUG: severity valid values are ['alerts', 'critical', 'emergencies']
--------------------- >> end captured logging << ---------------------_

@parag-may4
Copy link
Contributor

Partially fixed this by: #10

  • Fixed user related apis renaming.
  • Fixed ntp api renaming.
  • Fixed tacacsplus api renaming.
    -> The fix to include other severity levels in syslog_local_console_enable() will be done in separate PR. It requires schema changes.

@parag-may4
Copy link
Contributor

Some more APIs in ldap and locale has been fixed by: #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants