openswitch: Docs fixes

This commit is contained in:
John Barker
2016-08-05 14:40:52 +01:00
committed by Matt Clay
parent 3f8f67e359
commit d76a4e71c2
4 changed files with 33 additions and 20 deletions

View File

@@ -32,21 +32,24 @@ options:
description:
- When enabled, this argument will collect the current
running configuration from the remote device. If the
transport is C(rest) then the collected configuration will
C(transport=rest) then the collected configuration will
be the full system configuration.
required: false
choices:
- true
- false
default: false
endpoints:
description:
- Accepts a list of endpoints to retrieve from the remote
device using the REST API. The endpoints should be valid
endpoints availble on the device. This argument is only
valid when the transport is C(rest).
endpoints available on the device. This argument is only
valid when the C(transport=rest).
required: false
default: null
notes:
- The use of the REST transport is still experimental until it is
fully implemented
fully implemented.
"""
EXAMPLES = """
@@ -91,12 +94,14 @@ endpoints:
"""
import re
def get(module, url, expected_status=200):
response = module.connection.get(url)
if response.headers['status'] != expected_status:
module.fail_json(**response.headers)
return response
def get_config(module):
if module.params['transport'] == 'ssh':
rc, out, err = module.run_command('vtysh -c "show running-config"')
@@ -108,6 +113,7 @@ def get_config(module):
response = module.connection.send('show running-config')
return response[0]
def get_facts(module):
if module.params['transport'] == 'rest':
response = get(module, '/system')
@@ -167,4 +173,3 @@ from ansible.module_utils.openswitch import *
if __name__ == '__main__':
main()