changed oData filters (#50112)

* changed oData filters

* Update bigip_asm_policy_fetch.py

* Update bigip_asm_policy_import.py
This commit is contained in:
Wojciech Wypior 2018-12-19 05:17:21 +01:00 committed by Tim Rupp
parent af19bc95e8
commit 0a55805ede
2 changed files with 17 additions and 9 deletions

View file

@ -73,7 +73,7 @@ EXAMPLES = r'''
bigip_asm_policy_fetch: bigip_asm_policy_fetch:
name: foobar name: foobar
file: export_foo file: export_foo
dst: /root/download dest: /root/download
binary: yes binary: yes
provider: provider:
password: secret password: secret
@ -96,7 +96,7 @@ EXAMPLES = r'''
bigip_asm_policy_fetch: bigip_asm_policy_fetch:
name: foobar name: foobar
file: export_foo file: export_foo
dst: /root/download dest: /root/download
provider: provider:
password: secret password: secret
server: lb.mydomain.com server: lb.mydomain.com
@ -107,7 +107,7 @@ EXAMPLES = r'''
bigip_asm_policy_fetch: bigip_asm_policy_fetch:
name: foobar name: foobar
file: export_foo.xml file: export_foo.xml
dst: /root/download/ dest: /root/download/
compact: yes compact: yes
provider: provider:
password: secret password: secret
@ -118,7 +118,7 @@ EXAMPLES = r'''
- name: Export policy in binary format, autogenerate name - name: Export policy in binary format, autogenerate name
bigip_asm_policy_fetch: bigip_asm_policy_fetch:
name: foobar name: foobar
dst: /root/download/ dest: /root/download/
binary: yes binary: yes
provider: provider:
password: secret password: secret
@ -133,7 +133,7 @@ name:
returned: changed returned: changed
type: str type: str
sample: Asm_APP1_Transparent sample: Asm_APP1_Transparent
dst: dest:
description: Local path to download exported ASM policy. description: Local path to download exported ASM policy.
returned: changed returned: changed
type: str type: str
@ -242,7 +242,9 @@ class ModuleParameters(Parameters):
self.client.provider['server'], self.client.provider['server'],
self.client.provider['server_port'], self.client.provider['server_port'],
) )
query = '?$filter=name+eq+{0}+and+partition+eq+{1}&$select=name'.format(self.want.name, self.want.partition) query = "?$filter=contains(name,'{0}')+and+contains(partition,'{1}')&$select=name,partition".format(
self.want.name, self.want.partition
)
resp = self.client.api.get(uri + query) resp = self.client.api.get(uri + query)
try: try:
response = resp.json() response = resp.json()
@ -532,7 +534,9 @@ class ModuleManager(object):
self.client.provider['server'], self.client.provider['server'],
self.client.provider['server_port'], self.client.provider['server_port'],
) )
query = '?$filter=name+eq+{0}+and+partition+eq+{1}&$select=name'.format(self.want.name, self.want.partition) query = "?$filter=contains(name,'{0}')+and+contains(partition,'{1}')&$select=name,partition".format(
self.want.name, self.want.partition
)
resp = self.client.api.get(uri + query) resp = self.client.api.get(uri + query)
try: try:
response = resp.json() response = resp.json()

View file

@ -270,7 +270,9 @@ class ModuleManager(object):
self.client.provider['server_port'], self.client.provider['server_port'],
) )
query = '?$filter=name+eq+{0}+and+partition+eq+{1}&$select=name'.format(self.want.name, self.want.partition) query = "?$filter=contains(name,'{0}')+and+contains(partition,'{1}')&$select=name,partition".format(
self.want.name, self.want.partition
)
resp = self.client.api.get(uri + query) resp = self.client.api.get(uri + query)
try: try:
@ -299,7 +301,9 @@ class ModuleManager(object):
self.client.provider['server_port'], self.client.provider['server_port'],
) )
query = '?$filter=name+eq+{0}+and+partition+eq+{1}&$select=name'.format(self.want.name, self.want.partition) query = "?$filter=contains(name,'{0}')+and+contains(partition,'{1}')&$select=name,partition".format(
self.want.name, self.want.partition
)
resp = self.client.api.get(uri + query) resp = self.client.api.get(uri + query)
try: try: