Add masakari openstackclient library
Implement openstackclient library for masakari. Change-Id: Ia8a218624ffea6da5cbfdd0411c602e3c61e2c8a
This commit is contained in:
parent
a25c7c0565
commit
e182f6fefa
0
masakariclient/common/__init__.py
Normal file
0
masakariclient/common/__init__.py
Normal file
28
masakariclient/common/i18n.py
Normal file
28
masakariclient/common/i18n.py
Normal file
@ -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
|
0
masakariclient/sdk/__init__.py
Normal file
0
masakariclient/sdk/__init__.py
Normal file
0
masakariclient/sdk/vmha/__init__.py
Normal file
0
masakariclient/sdk/vmha/__init__.py
Normal file
39
masakariclient/sdk/vmha/connection.py
Normal file
39
masakariclient/sdk/vmha/connection.py
Normal file
@ -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
|
0
masakariclient/sdk/vmha/v1/__init__.py
Normal file
0
masakariclient/sdk/vmha/v1/__init__.py
Normal file
22
masakariclient/sdk/vmha/v1/_proxy.py
Normal file
22
masakariclient/sdk/vmha/v1/_proxy.py
Normal file
@ -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.
|
||||
"""
|
26
masakariclient/sdk/vmha/vmha_service.py
Normal file
26
masakariclient/sdk/vmha/vmha_service.py
Normal file
@ -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)
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user