Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-aranda committed Jan 28, 2022
2 parents 240c268 + 114c03e commit 2cd0f06
Show file tree
Hide file tree
Showing 16 changed files with 5,682 additions and 907 deletions.
1 change: 1 addition & 0 deletions manager/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
path("salinfo/topic-data", api.views.salinfo_topic_data, name="salinfo-topic-data"),
path("config", api.views.get_config, name="config"),
path("efd/timeseries", api.views.query_efd, name="EFD-timeseries"),
path("efd/efd_clients", api.views.query_efd_clients, name="EFD-clients"),
path("tcs/aux", api.views.tcs_aux_command, name="TCS-aux"),
path("tcs/docstrings", api.views.tcs_docstrings, name="TCS-docstrings"),
]
Expand Down
27 changes: 24 additions & 3 deletions manager/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,27 @@ class EmergencyContactViewSet(viewsets.ModelViewSet):
"""Serializer used to serialize View objects"""


@api_view(["GET"])
@permission_classes((IsAuthenticated,))
def query_efd_clients(request):
"""Requests EFD instances
Params
------
request: Request
The Request object
Returns
-------
Response
The response and status code of the request to the LOVE-Commander
"""
url = f"http://{os.environ.get('COMMANDER_HOSTNAME')}:{os.environ.get('COMMANDER_PORT')}/efd/efd_clients"
response = requests.get(url)

return Response(response.json(), status=response.status_code)


@api_view(["POST"])
@permission_classes((IsAuthenticated,))
def query_efd(request, *args, **kwargs):
Expand Down Expand Up @@ -551,9 +572,9 @@ def tcs_aux_command(request, *args, **kwargs):
List of addittional arguments. Currently unused
kwargs: dict
Dictionary with request arguments. Request should contain the following:
command_name (required): The name of the command to be run. It should be a field of
the lsst.ts.observatory.control.auxtel.ATCS class params (required):
Parameters to be passed to the command method, e.g.
command_name (required): The name of the command to be run.
It should be a field of the lsst.ts.observatory.control.auxtel.ATCS class
params (required): Parameters to be passed to the command method, e.g.
{
ra: 80,
dec: 30,
Expand Down
8 changes: 4 additions & 4 deletions manager/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ coreapi==2.3.3
coreschema==0.0.4
cryptography==3.3.2
daphne==3.0.1
Django==3.1.13
Django==3.1.14
django-auth-ldap==2.1.0
django-cors-headers==3.2.1
django-webpack-loader==0.7.0
Expand All @@ -45,10 +45,10 @@ mccabe==0.6.1
mistune==0.8.4
more-itertools==8.2.0
msgpack==1.0.0
numpy==1.18.1
numpy==1.21.0
packaging==20.3
Pillow==8.3.2
pip-licenses==2.1.1
Pillow==9.0.0
pluggy==0.13.1
psycopg2==2.8.4
py==1.10.0
Expand All @@ -66,7 +66,7 @@ pytest-asyncio==0.10.0
pytest-django==3.8.0
pytest-env==0.6.2
python-dateutil==2.8.1
python-ldap==3.2.0
python-ldap==3.4.0
pytz==2019.3
PyYAML==5.4
requests==2.23.0
Expand Down
11 changes: 10 additions & 1 deletion manager/runserver-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,22 @@ python manage.py migrate

echo -e "\nCreating default users"
python manage.py createusers --adminpass ${ADMIN_USER_PASS} --userpass ${USER_USER_PASS} --cmduserpass ${CMD_USER_PASS} --authlistuserpass ${AUTHLIST_USER_PASS}
if [ -z ${LOVE_SITE} ]; then
love_site="summit"
else
love_site=${LOVE_SITE}
fi
echo -e "\nSite: ${love_site}"
echo -e "\nApplying fixtures"
mkdir -p media/thumbnails
cp -u ui_framework/fixtures/thumbnails/* media/thumbnails
if [ -d "ui_framework/fixtures/thumbnails/${love_site}" ]; then
cp -u ui_framework/fixtures/thumbnails/${love_site}/* media/thumbnails
fi
mkdir -p media/configs
cp -u api/fixtures/configs/* media/configs

python manage.py loaddata ui_framework/fixtures/initial_data.json
python manage.py loaddata ui_framework/fixtures/initial_data_${love_site}.json
python manage.py loaddata api/fixtures/initial_data.json

echo -e "\nStarting server"
Expand Down
11 changes: 10 additions & 1 deletion manager/runserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,22 @@ python manage.py migrate

echo -e "\nCreating default users"
python manage.py createusers --adminpass ${ADMIN_USER_PASS} --userpass ${USER_USER_PASS} --cmduserpass ${CMD_USER_PASS} --authlistuserpass ${AUTHLIST_USER_PASS}
if [ -z ${LOVE_SITE} ]; then
love_site="summit"
else
love_site=${LOVE_SITE}
fi
echo -e "\nSite: ${love_site}"
echo -e "\nApplying fixtures"
mkdir -p media/thumbnails
cp -u ui_framework/fixtures/thumbnails/* media/thumbnails
if [ -d "ui_framework/fixtures/thumbnails/${love_site}" ]; then
cp -u ui_framework/fixtures/thumbnails/${love_site}/* media/thumbnails
fi
mkdir -p media/configs
cp -u api/fixtures/configs/* media/configs

python manage.py loaddata ui_framework/fixtures/initial_data.json
python manage.py loaddata ui_framework/fixtures/initial_data_${love_site}.json
python manage.py loaddata api/fixtures/initial_data.json

echo -e "\nStarting server"
Expand Down
Loading

0 comments on commit 2cd0f06

Please sign in to comment.