Skip to content

Commit 268f85e

Browse files
committed
merge internal-api back into api
1 parent 8e7e23c commit 268f85e

10 files changed

Lines changed: 9 additions & 120 deletions

File tree

deploy/infrabox/templates/fluentbit/configmap.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ data:
3636
[OUTPUT]
3737
Name http
3838
Match *
39-
Host infrabox-internal-api.{{ template "system_namespace" . }}
39+
Host infrabox-api.{{ template "system_namespace" . }}
4040
Port 8080
41-
URI /api/job/consoleupdate
41+
URI /internal/api/job/consoleupdate
4242
Format json

deploy/infrabox/templates/internal-api/deployment.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

deploy/infrabox/templates/internal-api/service.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

ib.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env python
22
import argparse
3-
import json
43
import os
54
import re
65
import subprocess
@@ -30,7 +29,6 @@
3029
{'name': 'gc', 'depends_on': ['images-base']},
3130
{'name': 'scheduler-kubernetes'},
3231
{'name': 'api', 'depends_on': ['images-base']},
33-
{'name': 'internal-api', 'depends_on': ['images-base']},
3432
{'name': 'build-dashboard-client'},
3533
{'name': 'static', 'depends_on': ['build-dashboard-client']},
3634
{'name': 'docker-registry-auth'},

infrabox/generator/deployments.json

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -379,33 +379,6 @@
379379
"image": true
380380
}
381381
},
382-
{
383-
"type": "docker",
384-
"build_context": "../..",
385-
"name": "internal-api",
386-
"docker_file": "src/internal-api/Dockerfile",
387-
"build_only": true,
388-
"resources": {
389-
"limits": {
390-
"cpu": 1,
391-
"memory": 1024
392-
}
393-
},
394-
"deployments": [
395-
{
396-
"type": "docker-registry",
397-
"host": "quay.io/infrabox",
398-
"repository": "internal-api",
399-
"username": "infrabox+infrabox_ci",
400-
"password": {
401-
"$secret": "QUAY_PASSWORD"
402-
}
403-
}
404-
],
405-
"cache": {
406-
"image": true
407-
}
408-
},
409382
{
410383
"type": "docker",
411384
"build_context": "../..",

src/api/internal/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import api.internal.internal
Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,16 @@
11
from datetime import datetime
22

3-
import eventlet
4-
from eventlet import wsgi
5-
eventlet.monkey_patch()
6-
7-
from flask import jsonify, g, request
3+
from flask import g, request
84
from flask_restplus import Resource
95

10-
from pyinfraboxutils import get_env, get_logger
11-
from pyinfraboxutils.ibflask import app
126
from pyinfraboxutils.ibrestplus import api
13-
from pyinfraboxutils.db import connect_db
14-
15-
logger = get_logger('api')
16-
17-
app.config['OPA_ENABLED'] = False
187

19-
@app.route('/ping')
20-
def ping():
21-
return jsonify({'status': 200})
8+
ns = api.namespace('Internal',
9+
path='/internal/api',
10+
description='Project related operations')
2211

23-
@app.route('/v2/') # prevent 301 redirects
24-
@app.route('/v2')
25-
def v2():
26-
return jsonify({'status': 200})
2712

28-
@api.route("/api/job/consoleupdate", doc=False)
13+
@ns.route("/job/consoleupdate", doc=False)
2914
class ConsoleUpdate(Resource):
3015
def post(self):
3116
records = request.json
@@ -71,17 +56,3 @@ def post(self):
7156

7257
return {}
7358

74-
75-
def main(): # pragma: no cover
76-
get_env('INFRABOX_VERSION')
77-
get_env('INFRABOX_DATABASE_HOST')
78-
get_env('INFRABOX_DATABASE_USER')
79-
get_env('INFRABOX_DATABASE_PASSWORD')
80-
get_env('INFRABOX_DATABASE_PORT')
81-
get_env('INFRABOX_DATABASE_DB')
82-
83-
connect_db()
84-
wsgi.server(eventlet.listen(('0.0.0.0', 8080)), app)
85-
86-
if __name__ == "__main__": # pragma: no cover
87-
main()

src/api/server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import handlers
2626
import settings
27+
import internal
2728

2829
import listeners.console
2930
import listeners.job

src/internal-api/Dockerfile

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/internal-api/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)