init
This commit is contained in:
56
otc_metadata/data/__init__.py
Normal file
56
otc_metadata/data/__init__.py
Normal file
@ -0,0 +1,56 @@
|
||||
# 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 os
|
||||
import pathlib
|
||||
import yaml
|
||||
|
||||
__all__ = ["read_data"]
|
||||
|
||||
DATA_DIR = os.path.dirname(__file__)
|
||||
|
||||
|
||||
def read_data(filename):
|
||||
"""Return data that is shipped inside the Python package."""
|
||||
|
||||
filepath = os.path.join(DATA_DIR, filename)
|
||||
with open(filepath, "r") as fd:
|
||||
data = yaml.safe_load(fd)
|
||||
# Merge data found in individual element files
|
||||
data.setdefault("documents", list())
|
||||
data.setdefault("services", list())
|
||||
data.setdefault("service_categories", list())
|
||||
for item in pathlib.Path(DATA_DIR, "documents").glob("*.yaml"):
|
||||
with open(item, "r") as fp:
|
||||
data["documents"].append(yaml.safe_load(fp))
|
||||
for item in pathlib.Path(DATA_DIR, "services").glob("*.yaml"):
|
||||
with open(item, "r") as fp:
|
||||
data["services"].append(yaml.safe_load(fp))
|
||||
for item in pathlib.Path(DATA_DIR, "service_categories").glob(
|
||||
"*.yaml"
|
||||
):
|
||||
with open(item, "r") as fp:
|
||||
data["service_categories"].append(yaml.safe_load(fp))
|
||||
|
||||
return data
|
||||
|
||||
|
||||
def rewrite_data(filename, data):
|
||||
"""Rewrites data formatting it"""
|
||||
from ruamel.yaml import YAML
|
||||
|
||||
_yaml = YAML()
|
||||
_yaml.indent(mapping=2, sequence=4, offset=2)
|
||||
filepath = os.path.join(DATA_DIR, filename)
|
||||
with open(filepath, "w") as fd:
|
||||
_yaml.dump(data, fd)
|
10
otc_metadata/data/documents/as-api-ref.yaml
Normal file
10
otc_metadata/data/documents/as-api-ref.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
hc_location: api/as
|
||||
html_location: docs/as/api-ref
|
||||
link: /auto-scaling/api-ref/
|
||||
pdf_enabled: true
|
||||
pdf_environment: internal
|
||||
rst_location: api-ref/source
|
||||
service_type: as
|
||||
title: API Reference
|
||||
type: api-ref
|
10
otc_metadata/data/documents/as-dev.yaml
Normal file
10
otc_metadata/data/documents/as-dev.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
hc_location: devg/as
|
||||
html_location: docs/as/dev
|
||||
link: /auto-scaling/dev-guide/
|
||||
pdf_enabled: true
|
||||
pdf_environment: internal
|
||||
rst_location: dev_guide/source
|
||||
service_type: as
|
||||
title: Developer Guide
|
||||
type: dev
|
10
otc_metadata/data/documents/as-umn.yaml
Normal file
10
otc_metadata/data/documents/as-umn.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
hc_location: usermanual/as
|
||||
html_location: docs/as/umn
|
||||
link: /auto-scaling/umn/
|
||||
pdf_enabled: true
|
||||
pdf_environment: internal
|
||||
rst_location: umn/source
|
||||
service_type: as
|
||||
title: User Guide
|
||||
type: umn
|
23
otc_metadata/data/repositories/as.yaml
Normal file
23
otc_metadata/data/repositories/as.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
---
|
||||
service_type: as
|
||||
- environment: public
|
||||
repo: opentelekomcloud-docs/auto-scaling
|
||||
type: github
|
||||
cloud_environments:
|
||||
- eu_de
|
||||
- environment: internal
|
||||
repo: docs/auto-scaling
|
||||
type: gitea
|
||||
- eu_de
|
||||
- environment: public
|
||||
repo: opentelekomcloud-docs-swiss/auto-scaling
|
||||
type: github
|
||||
cloud_environments:
|
||||
- swiss
|
||||
- environment: internal
|
||||
repo: docs-swiss/auto-scaling
|
||||
type: gitea
|
||||
cloud_environments:
|
||||
- swiss
|
||||
|
||||
|
3
otc_metadata/data/service_categories/application.yaml
Normal file
3
otc_metadata/data/service_categories/application.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
name: application
|
||||
title: Application Services
|
3
otc_metadata/data/service_categories/big_data.yaml
Normal file
3
otc_metadata/data/service_categories/big_data.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
name: big_data
|
||||
title: Big Data and Data Analysis
|
3
otc_metadata/data/service_categories/compute.yaml
Normal file
3
otc_metadata/data/service_categories/compute.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
name: compute
|
||||
title: Computing
|
3
otc_metadata/data/service_categories/container.yaml
Normal file
3
otc_metadata/data/service_categories/container.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
name: container
|
||||
title: Container
|
3
otc_metadata/data/service_categories/database.yaml
Normal file
3
otc_metadata/data/service_categories/database.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
name: database
|
||||
title: Databases
|
3
otc_metadata/data/service_categories/md.yaml
Normal file
3
otc_metadata/data/service_categories/md.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
name: md
|
||||
title: Management & Deployment
|
3
otc_metadata/data/service_categories/network.yaml
Normal file
3
otc_metadata/data/service_categories/network.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
name: network
|
||||
title: Networking
|
3
otc_metadata/data/service_categories/other.yaml
Normal file
3
otc_metadata/data/service_categories/other.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
name: other
|
||||
title: Other
|
@ -0,0 +1,3 @@
|
||||
---
|
||||
name: security-services
|
||||
title: Security Services
|
3
otc_metadata/data/service_categories/storage.yaml
Normal file
3
otc_metadata/data/service_categories/storage.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
name: storage
|
||||
title: Storage
|
22
otc_metadata/data/services.yaml
Normal file
22
otc_metadata/data/services.yaml
Normal file
@ -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.
|
||||
|
||||
# Please consult with otc_metadata.services.Services:_sort_data for expected
|
||||
# sort order. When unsure perform tools/sort_metadata.py for getting it sorted.
|
||||
# It is also supported, that content of files under
|
||||
# documents/services/service_categories is being merged with
|
||||
# the content here.
|
||||
---
|
||||
documents: []
|
||||
service_categories: []
|
||||
services: []
|
13
otc_metadata/data/services/as.yaml
Normal file
13
otc_metadata/data/services/as.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
environment: public
|
||||
repositories:
|
||||
service_category: compute
|
||||
service_title: Auto Scaling
|
||||
service_type: as
|
||||
service_uri: auto-scaling
|
||||
cloud_environments:
|
||||
- name: eu_de
|
||||
- name: swiss
|
||||
teams:
|
||||
- name: docs-compute-rw
|
||||
permission: write
|
Reference in New Issue
Block a user