diff --git a/otcextensions/sdk/__init__.py b/otcextensions/sdk/__init__.py index 207ca2904..ffea0e33c 100644 --- a/otcextensions/sdk/__init__.py +++ b/otcextensions/sdk/__init__.py @@ -207,6 +207,9 @@ 'endpoint_service_type': 'object', 'set_endpoint_override': True }, + 'ocr': { + 'service_type': 'ocr', + }, 'plas': { 'service_type': 'plas' }, diff --git a/otcextensions/sdk/ocr/__init__.py b/otcextensions/sdk/ocr/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/otcextensions/sdk/ocr/ocr_service.py b/otcextensions/sdk/ocr/ocr_service.py new file mode 100644 index 000000000..ab60ee24f --- /dev/null +++ b/otcextensions/sdk/ocr/ocr_service.py @@ -0,0 +1,22 @@ +# 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 openstack import service_description + +from otcextensions.sdk.ocr.v2 import _proxy + + +class OcrService(service_description.ServiceDescription): + """The Optical Character Recognition (OCR) service.""" + + supported_versions = { + '2': _proxy.Proxy + } diff --git a/otcextensions/sdk/ocr/v2/__init__.py b/otcextensions/sdk/ocr/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/otcextensions/sdk/ocr/v2/_proxy.py b/otcextensions/sdk/ocr/v2/_proxy.py new file mode 100644 index 000000000..38cfb42e8 --- /dev/null +++ b/otcextensions/sdk/ocr/v2/_proxy.py @@ -0,0 +1,17 @@ +# 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 openstack import proxy + + +class Proxy(proxy.Proxy): + + skip_discovery = True diff --git a/otcextensions/tests/functional/sdk/ocr/__init__.py b/otcextensions/tests/functional/sdk/ocr/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/otcextensions/tests/functional/sdk/ocr/v2/__init__.py b/otcextensions/tests/functional/sdk/ocr/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/otcextensions/tests/functional/sdk/ocr/v2/test_service.py b/otcextensions/tests/functional/sdk/ocr/v2/test_service.py new file mode 100644 index 000000000..e0de6e553 --- /dev/null +++ b/otcextensions/tests/functional/sdk/ocr/v2/test_service.py @@ -0,0 +1,23 @@ +# 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 openstack import _log +from otcextensions.tests.functional import base + +_logger = _log.setup_logging('openstack') + + +class TestService(base.BaseFunctionalTest): + + def test_initialize(self): + client = self.conn.ocr + + self.assertIsNotNone(client) diff --git a/otcextensions/tests/unit/sdk/ocr/__init__.py b/otcextensions/tests/unit/sdk/ocr/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/otcextensions/tests/unit/sdk/ocr/v2/__init__.py b/otcextensions/tests/unit/sdk/ocr/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/otcextensions/tests/unit/sdk/ocr/v2/test_proxy.py b/otcextensions/tests/unit/sdk/ocr/v2/test_proxy.py new file mode 100644 index 000000000..5a975c49e --- /dev/null +++ b/otcextensions/tests/unit/sdk/ocr/v2/test_proxy.py @@ -0,0 +1,22 @@ +# 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 otcextensions.sdk.ocr.v2 import _proxy + +from openstack.tests.unit import test_proxy_base + + +class TestOcrProxy(test_proxy_base.TestProxyBase): + + def setUp(self): + super(TestOcrProxy, self).setUp() + self.proxy = _proxy.Proxy(self.session) diff --git a/releasenotes/notes/ocr_sdk_proxy-c4cd12d963a7aa13.yaml b/releasenotes/notes/ocr_sdk_proxy-c4cd12d963a7aa13.yaml new file mode 100644 index 000000000..4a8eed9fb --- /dev/null +++ b/releasenotes/notes/ocr_sdk_proxy-c4cd12d963a7aa13.yaml @@ -0,0 +1,3 @@ +--- +features: + - Added OCR sdk proxy implementation.