Added new option to select the active a10 partition (#2628)

* Added new option to select the active a10 partition

* added version_added to the description of the new option

* added RETURN documentation

* fixed indents

* Removed empty cases, removed unneeded aliases

* removed artifacts from merging

* updated version_added to 2.3

* removed host, username and password option

* removed write_config and validate_certs documentation
This commit is contained in:
Dorian Dietzel 2016-11-30 16:08:53 +01:00 committed by Matt Clay
parent fa4b353da8
commit 1f32d68310
3 changed files with 57 additions and 1 deletions

View file

@ -34,6 +34,12 @@ notes:
- Requires A10 Networks aXAPI 2.1.
extends_documentation_fragment: a10
options:
partition:
version_added: "2.3"
description:
- set active-partition
required: false
default: null
server_name:
description:
- The SLB (Server Load Balancer) server name.
@ -87,6 +93,7 @@ EXAMPLES = '''
host: a10.mydomain.com
username: myadmin
password: mypassword
partition: mypartition
server: test
server_ip: 1.1.1.100
server_ports:
@ -97,6 +104,15 @@ EXAMPLES = '''
'''
RETURN = '''
content:
description: the full info regarding the slb_server
returned: success
type: string
sample: "mynewserver"
'''
VALID_PORT_FIELDS = ['port_num', 'protocol', 'status']
def validate_ports(module, ports):
@ -142,6 +158,7 @@ def main():
server_ip=dict(type='str', aliases=['ip', 'address']),
server_status=dict(type='str', default='enabled', aliases=['status'], choices=['enabled', 'disabled']),
server_ports=dict(type='list', aliases=['port'], default=[]),
partition=dict(type='str', default=[]),
)
)
@ -151,6 +168,7 @@ def main():
)
host = module.params['host']
partition = module.params['partition']
username = module.params['username']
password = module.params['password']
state = module.params['state']
@ -185,6 +203,8 @@ def main():
if slb_server_status:
json_post['server']['status'] = axapi_enabled_disabled(slb_server_status)
slb_server_partition = axapi_call(module, session_url + '&method=system.partition.active', json.dumps({'name': partition}))
slb_server_data = axapi_call(module, session_url + '&method=slb.server.search', json.dumps({'name': slb_server}))
slb_server_exists = not axapi_failure(slb_server_data)