diff --git a/masakariclient/common/__init__.py b/masakariclient/common/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/masakariclient/common/i18n.py b/masakariclient/common/i18n.py new file mode 100644 index 0000000..f0a8b59 --- /dev/null +++ b/masakariclient/common/i18n.py @@ -0,0 +1,28 @@ +# Copyright(c) 2016 Nippon Telegraph and Telephone Corporation +# +# 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. +import oslo_i18n + +_translators = oslo_i18n.TranslatorFactory(domain='masakariclient') + +# The primary translation function using the well-known name "_" +_ = _translators.primary + +# Translators for log levels. +# The abbreviated names are meant to reflect the usual use of a short +# name like '_'. The "L" is for "log" and the other letter comes from +# the level. +_LI = _translators.log_info +_LW = _translators.log_warning +_LE = _translators.log_error +_LC = _translators.log_critical diff --git a/masakariclient/sdk/__init__.py b/masakariclient/sdk/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/masakariclient/sdk/vmha/__init__.py b/masakariclient/sdk/vmha/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/masakariclient/sdk/vmha/connection.py b/masakariclient/sdk/vmha/connection.py new file mode 100644 index 0000000..91f3551 --- /dev/null +++ b/masakariclient/sdk/vmha/connection.py @@ -0,0 +1,39 @@ +# Copyright(c) 2016 Nippon Telegraph and Telephone Corporation +# +# 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 connection +from openstack import profile + + +def create_connection(prof=None, user_agent=None, **kwargs): + + if not prof: + prof = profile.Profile() + + interface = kwargs.pop('interface', None) + region_name = kwargs.pop('region_name', None) + if interface: + prof.set_interface('vmha', interface) + if region_name: + prof.set_region('vmha', region_name) + + prof.set_api_version('vmha', '1') + + try: + conn = connection.Connection(profile=prof, user_agent=user_agent, + **kwargs) + except Exception as e: + raise e + + return conn diff --git a/masakariclient/sdk/vmha/v1/__init__.py b/masakariclient/sdk/vmha/v1/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/masakariclient/sdk/vmha/v1/_proxy.py b/masakariclient/sdk/vmha/v1/_proxy.py new file mode 100644 index 0000000..5372692 --- /dev/null +++ b/masakariclient/sdk/vmha/v1/_proxy.py @@ -0,0 +1,22 @@ +# Copyright(c) 2016 Nippon Telegraph and Telephone Corporation +# +# 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.BaseProxy): + """Proxy class for vmha resource handling. + + Create method for each action of each API. + """ diff --git a/masakariclient/sdk/vmha/vmha_service.py b/masakariclient/sdk/vmha/vmha_service.py new file mode 100644 index 0000000..f5069d3 --- /dev/null +++ b/masakariclient/sdk/vmha/vmha_service.py @@ -0,0 +1,26 @@ +# Copyright(c) 2016 Nippon Telegraph and Telephone Corporation +# +# 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_filter + + +class VMHAService(service_filter.ServiceFilter): + """The VMHA service.""" + + valid_versions = [service_filter.ValidVersion('v1')] + + def __init__(self, version=None): + """Create an vmha service.""" + super(VMHAService, self).__init__(service_type='vmha', + version=version) diff --git a/requirements.txt b/requirements.txt index 95d0fe8..3b1bdab 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,6 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. +openstacksdk>=0.9.7 # Apache-2.0 +oslo.i18n>=2.1.0 # Apache-2.0 pbr>=1.6 # Apache-2.0