Initial import
This commit is contained in:
38
otc_metadata/docs.py
Normal file
38
otc_metadata/docs.py
Normal file
@ -0,0 +1,38 @@
|
||||
# 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 copy
|
||||
|
||||
import otc_metadata.data
|
||||
|
||||
__all__ = ['Docs']
|
||||
|
||||
BUILTIN_DATA = otc_metadata.data.read_data('docs.yaml')
|
||||
|
||||
|
||||
def _normalize_type(service_type):
|
||||
if service_type:
|
||||
return service_type.replace('_', '-')
|
||||
|
||||
|
||||
class Service(object):
|
||||
"""Encapsulation of the OTC Docs data
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self._service_data = BUILTIN_DATA
|
||||
|
||||
@property
|
||||
def all_services(self):
|
||||
"Service Categories data listing."
|
||||
return copy.deepcopy(self._service_data['services'])
|
Reference in New Issue
Block a user