add rest apis and django_library to hpc-onboard
hpcview from xos-core
Change-Id: I1aa063817779e76cdc5e5c1bc303ae12784d4dd3
diff --git a/xos/api/service/hpc/hpcview.py b/xos/api/service/hpc/hpcview.py
index 199bc09..3e31e73 100644
--- a/xos/api/service/hpc/hpcview.py
+++ b/xos/api/service/hpc/hpcview.py
@@ -14,15 +14,6 @@
import socket
import time
-# This REST API endpoint contains a bunch of misc information that the
-# tenant view needs to display
-
-def get_service_slices(service):
- try:
- return service.slices.all()
- except:
- return service.service.all()
-
def lookup_tag(service, instance, name, default=None):
instance_type = ContentType.objects.get_for_model(instance)
t = Tag.objects.filter(service=service, name=name, content_type__pk=instance_type.id, object_id=instance.id)
@@ -91,7 +82,7 @@
def getHpcDict(user, pk):
hpc = HpcService.objects.get(pk=pk)
- slices = get_service_slices(hpc)
+ slices = hpc.slices.all()
dnsdemux_slice = None
dnsredir_slice = None
@@ -111,7 +102,7 @@
rr = RequestRouterService.objects.all()
if rr:
rr=rr[0]
- slices = get_service_slices(rr)
+ slices = rr.slices.all()
for slice in slices:
if "dnsdemux" in slice.name:
dnsdemux_service = rr
diff --git a/xos/hpc-onboard.yaml b/xos/hpc-onboard.yaml
index fdf07ca..7b18a7f 100644
--- a/xos/hpc-onboard.yaml
+++ b/xos/hpc-onboard.yaml
@@ -12,14 +12,14 @@
properties:
base_url: file:///opt/xos_services/hypercache/xos/
models: models.py
+ django_library: filteredadmin.py
admin: admin.py
admin_template: templates/hpcadmin.html, templates/hpctools.html
synchronizer: synchronizer/manifest
synchronizer_run: hpc-synchronizer.py
tosca_custom_types: tosca/custom_types/cdn.yaml
tosca_resource: tosca/resources/cdnprefix.py, tosca/resources/cdnservice.py, tosca/resources/contentprovider.py, tosca/resources/hpchealthcheck.py, tosca/resources/originserver.py, tosca/resources/serviceprovider.py
- #rest_service: subdirectory:vsg api/service/vsg/vsgservice.py
+ rest_service: subdirectory:hpc api/service/hpc/hpc_config.py, subdirectory:hpc api/service/hpc/hpcview.py, subdirectory:hpc api/service/hpc/legacyapi.py
#rest_tenant: subdirectory:cord api/tenant/cord/vsg.py
#private_key: file:///opt/xos/key_import/vsg_rsa
#public_key: file:///opt/xos/key_import/vsg_rsa.pub
-