Skip to content

Commit

Permalink
[Feat.] DDM proxies (#534)
Browse files Browse the repository at this point in the history
[Feat.] DDM proxies

Closes #532

Reviewed-by: Aloento
  • Loading branch information
anton-sidelnikov authored Feb 14, 2025
1 parent a4ba933 commit 5e8a53f
Show file tree
Hide file tree
Showing 21 changed files with 226 additions and 0 deletions.
15 changes: 15 additions & 0 deletions otcextensions/sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,21 @@
'service_type': 'deh',
'append_project_id': True,
},
'ddmv1': {
'service_type': 'ddmv1',
'endpoint_service_type': 'ddmv1',
'append_project_id': True
},
'ddmv2': {
'service_type': 'ddmv2',
'endpoint_service_type': 'ddmv2',
'append_project_id': True
},
'ddmv3': {
'service_type': 'ddmv3',
'endpoint_service_type': 'ddmv3',
'append_project_id': True
},
'dis': {
'service_type': 'dis',
'endpoint_service_type': 'disv2'
Expand Down
Empty file.
23 changes: 23 additions & 0 deletions otcextensions/sdk/ddmv1/ddmv1_service.py
Original file line number Diff line number Diff line change
@@ -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 service_description

from otcextensions.sdk.ddmv1.v1 import _proxy


class Ddmv1Service(service_description.ServiceDescription):
"""The Distributed Database Middleware service."""

supported_versions = {
'1': _proxy.Proxy
}
Empty file.
22 changes: 22 additions & 0 deletions otcextensions/sdk/ddmv1/v1/_proxy.py
Original file line number Diff line number Diff line change
@@ -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 proxy

from otcextensions.common.utils import extract_url_parts


class Proxy(proxy.Proxy):

skip_discovery = True

def _extract_name(self, url, service_type=None, project_id=None):
return extract_url_parts(url, project_id)
Empty file.
23 changes: 23 additions & 0 deletions otcextensions/sdk/ddmv2/ddmv2_service.py
Original file line number Diff line number Diff line change
@@ -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 service_description

from otcextensions.sdk.ddmv2.v1 import _proxy


class Ddmv2Service(service_description.ServiceDescription):
"""The Distributed Database Middleware service."""

supported_versions = {
'2': _proxy.Proxy
}
Empty file.
22 changes: 22 additions & 0 deletions otcextensions/sdk/ddmv2/v1/_proxy.py
Original file line number Diff line number Diff line change
@@ -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 proxy

from otcextensions.common.utils import extract_url_parts


class Proxy(proxy.Proxy):

skip_discovery = True

def _extract_name(self, url, service_type=None, project_id=None):
return extract_url_parts(url, project_id)
Empty file.
23 changes: 23 additions & 0 deletions otcextensions/sdk/ddmv3/ddmv3_service.py
Original file line number Diff line number Diff line change
@@ -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 service_description

from otcextensions.sdk.ddmv3.v1 import _proxy


class Ddmv3Service(service_description.ServiceDescription):
"""The Distributed Database Middleware service."""

supported_versions = {
'3': _proxy.Proxy
}
Empty file.
22 changes: 22 additions & 0 deletions otcextensions/sdk/ddmv3/v1/_proxy.py
Original file line number Diff line number Diff line change
@@ -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 proxy

from otcextensions.common.utils import extract_url_parts


class Proxy(proxy.Proxy):

skip_discovery = True

def _extract_name(self, url, service_type=None, project_id=None):
return extract_url_parts(url, project_id)
Empty file.
Empty file.
24 changes: 24 additions & 0 deletions otcextensions/tests/functional/sdk/ddm/v1/test_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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.ddmv1

self.assertIsNotNone(client)
Empty file.
24 changes: 24 additions & 0 deletions otcextensions/tests/functional/sdk/ddm/v2/test_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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.ddmv2

self.assertIsNotNone(client)
Empty file.
24 changes: 24 additions & 0 deletions otcextensions/tests/functional/sdk/ddm/v3/test_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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.ddmv3

self.assertIsNotNone(client)
4 changes: 4 additions & 0 deletions releasenotes/notes/ddm-proxies-0df8caad363ff6b8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
features:
- |
Add DDM Service proxies.

0 comments on commit 5e8a53f

Please sign in to comment.