From ba9a0775b7affb1a6d51927f480196655221fda3 Mon Sep 17 00:00:00 2001 From: hinashi Date: Wed, 21 Sep 2022 18:03:15 +0900 Subject: [PATCH 1/2] Added policy template list for v21 --- acos_client/v21/slb/template/__init__.py | 5 +++++ acos_client/v21/slb/template/templates.py | 25 +++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 acos_client/v21/slb/template/templates.py diff --git a/acos_client/v21/slb/template/__init__.py b/acos_client/v21/slb/template/__init__.py index 5733791d..dece3b81 100644 --- a/acos_client/v21/slb/template/__init__.py +++ b/acos_client/v21/slb/template/__init__.py @@ -18,6 +18,7 @@ from acos_client.v21.slb.template.persistence import SourceIpPersistence from acos_client.v21.slb.template.template_ssl import ClientSSL from acos_client.v21.slb.template.template_ssl import ServerSSL +from acos_client.v21.slb.template.templates import PolicyTemplates class Template(base.BaseV21): @@ -37,3 +38,7 @@ def cookie_persistence(self): @property def src_ip_persistence(self): return SourceIpPersistence(self.client) + + @property + def policy_templates(self): + return PolicyTemplates(self.client) diff --git a/acos_client/v21/slb/template/templates.py b/acos_client/v21/slb/template/templates.py new file mode 100644 index 00000000..5876b23c --- /dev/null +++ b/acos_client/v21/slb/template/templates.py @@ -0,0 +1,25 @@ +# Copyright 2014, Doug Wiegley, A10 Networks. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from acos_client.v21 import base + + +class BaseTemplate(base.BaseV21): + + def all(self, **kwargs): + return self._get("slb.template.%s.getall" % self.template_type, **kwargs) + + +class PolicyTemplates(BaseTemplate): + template_type = "pbslb" From 22c5afbcbb96296e504979d478bafe94bd517012 Mon Sep 17 00:00:00 2001 From: Koya Hinagawa Date: Mon, 2 Dec 2024 15:31:40 +0900 Subject: [PATCH 2/2] Added http template list for v21 --- acos_client/v21/slb/template/__init__.py | 6 +++++- acos_client/v21/slb/template/templates.py | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/acos_client/v21/slb/template/__init__.py b/acos_client/v21/slb/template/__init__.py index dece3b81..4d59ce45 100644 --- a/acos_client/v21/slb/template/__init__.py +++ b/acos_client/v21/slb/template/__init__.py @@ -18,7 +18,7 @@ from acos_client.v21.slb.template.persistence import SourceIpPersistence from acos_client.v21.slb.template.template_ssl import ClientSSL from acos_client.v21.slb.template.template_ssl import ServerSSL -from acos_client.v21.slb.template.templates import PolicyTemplates +from acos_client.v21.slb.template.templates import PolicyTemplates, HttpTemplates class Template(base.BaseV21): @@ -42,3 +42,7 @@ def src_ip_persistence(self): @property def policy_templates(self): return PolicyTemplates(self.client) + + @property + def http_templates(self): + return HttpTemplates(self.client) diff --git a/acos_client/v21/slb/template/templates.py b/acos_client/v21/slb/template/templates.py index 5876b23c..c644ec50 100644 --- a/acos_client/v21/slb/template/templates.py +++ b/acos_client/v21/slb/template/templates.py @@ -23,3 +23,7 @@ def all(self, **kwargs): class PolicyTemplates(BaseTemplate): template_type = "pbslb" + + +class HttpTemplates(BaseTemplate): + template_type = "http" \ No newline at end of file