-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/metacell/cloud-harness i…
…nto feature/CH-95
- Loading branch information
Showing
39 changed files
with
1,237 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
.travis.yaml | ||
.openapi-generator-ignore | ||
README.md | ||
tox.ini | ||
git_push.sh | ||
test-requirements.txt | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
venv/ | ||
.python-version | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
#Ipython Notebook | ||
.ipynb_checkpoints | ||
|
||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
dist | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,3 +69,5 @@ target/ | |
|
||
#Ipython Notebook | ||
.ipynb_checkpoints | ||
|
||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,73 @@ | ||
node_modules | ||
dist | ||
.travis.yaml | ||
.openapi-generator-ignore | ||
README.md | ||
tox.ini | ||
git_push.sh | ||
test-requirements.txt | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
venv/ | ||
.python-version | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
#Ipython Notebook | ||
.ipynb_checkpoints | ||
|
||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,111 @@ | ||
openapi: 3.0.0 | ||
info: | ||
description: Cloud Harness Platform - Reference CH service API | ||
license: | ||
name: UNLICENSED | ||
title: CH common service API | ||
version: 0.1.0 | ||
title: CH common service API | ||
version: 0.1.0 | ||
description: Cloud Harness Platform - Reference CH service API | ||
license: | ||
name: UNLICENSED | ||
servers: | ||
- description: SwaggerHub API Auto Mocking | ||
url: /api | ||
tags: | ||
- description: Sentry | ||
name: Sentry | ||
- | ||
url: /api | ||
description: SwaggerHub API Auto Mocking | ||
paths: | ||
/sentry/getdsn/{appname}: | ||
parameters: | ||
- in: path | ||
name: appname | ||
schema: | ||
type: string | ||
required: true | ||
get: | ||
tags: | ||
- Sentry | ||
description: Gets the Sentry DSN for a given application | ||
operationId: getdsn | ||
responses: | ||
'200': | ||
description: Sentry DSN for the given application | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
'400': | ||
description: Sentry not configured for the given application | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
text/html: | ||
schema: | ||
type: string | ||
'404': | ||
description: Sentry not configured for the given application | ||
content: | ||
application/problem+json: | ||
schema: | ||
type: object | ||
text/html: | ||
schema: | ||
type: string | ||
summary: Gets the Sentry DSN for a given application | ||
x-openapi-router-controller: common.controllers.sentry_controller | ||
/accounts/config: | ||
get: | ||
tags: | ||
- Accounts | ||
description: Gets the config for logging in into accounts | ||
operationId: get_config | ||
responses: | ||
'200': | ||
description: Config for accounts log in | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
url: | ||
'/sentry/getdsn/{appname}': | ||
get: | ||
tags: | ||
- Sentry | ||
responses: | ||
'200': | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
description: Sentry DSN for the given application | ||
'400': | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
text/html: | ||
schema: | ||
type: string | ||
description: Sentry not configured for the given application | ||
'404': | ||
content: | ||
application/problem+json: | ||
schema: | ||
type: object | ||
text/html: | ||
schema: | ||
type: string | ||
description: Sentry not configured for the given application | ||
operationId: getdsn | ||
summary: Gets the Sentry DSN for a given application | ||
description: Gets the Sentry DSN for a given application | ||
x-openapi-router-controller: common.controllers.sentry_controller | ||
parameters: | ||
- | ||
name: appname | ||
schema: | ||
type: string | ||
description: The auth URL. | ||
realm: | ||
in: path | ||
required: true | ||
/accounts/config: | ||
get: | ||
tags: | ||
- Accounts | ||
responses: | ||
'200': | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
url: | ||
description: The auth URL. | ||
type: string | ||
realm: | ||
description: The realm. | ||
type: string | ||
clientId: | ||
description: The clientID. | ||
type: string | ||
description: Config for accounts log in | ||
operationId: get_config | ||
summary: Gets the config for logging in into accounts | ||
description: Gets the config for logging in into accounts | ||
x-openapi-router-controller: common.controllers.accounts_controller | ||
/version: | ||
summary: Get the version for this deployment | ||
get: | ||
tags: | ||
- config | ||
responses: | ||
'200': | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/AppVersion' | ||
examples: | ||
version: | ||
value: "{\r\n \"build\": \"63498f19146bae1a6ae7e354\"\r\n \"tag\": \"v1.2.0\"\r\n}" | ||
description: Deployment version GET | ||
operationId: getVersion | ||
components: | ||
schemas: | ||
AppVersion: | ||
title: Root Type for AppVersion | ||
description: '' | ||
type: object | ||
properties: | ||
build: | ||
type: string | ||
description: The realm. | ||
clientId: | ||
tag: | ||
type: string | ||
description: The clientID. | ||
summary: Gets the config for logging in into accounts | ||
x-openapi-router-controller: common.controllers.accounts_controller | ||
example: | ||
build: 63498f19146bae1a6ae7e354 | ||
tag: v1.2.0 | ||
tags: | ||
- | ||
name: Sentry | ||
description: Sentry |
25 changes: 25 additions & 0 deletions
25
applications/common/server/common/controllers/config_controller.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
import connexion | ||
import six | ||
from typing import Dict | ||
from typing import Tuple | ||
from typing import Union | ||
|
||
from common.models.app_version import AppVersion # noqa: E501 | ||
from common import util | ||
|
||
from cloudharness.utils.config import CloudharnessConfig | ||
from cloudharness_model.models import HarnessMainConfig | ||
|
||
def get_version(): # noqa: E501 | ||
"""get_version | ||
# noqa: E501 | ||
:rtype: Union[AppVersion, Tuple[AppVersion, int], Tuple[AppVersion, int, Dict[str, str]] | ||
""" | ||
|
||
config: HarnessMainConfig = HarnessMainConfig.from_dict(CloudharnessConfig.get_configuration()) | ||
|
||
return AppVersion(tag=config.tag, build=config.build_hash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.