summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
d732b87)
Change-Id: I0cd95d5f19399aa94837b91338e544f1d8a20364
Signed-off-by: Mohamed Abukar <abukar.mohamed@nokia.com>
#----------------------------------------------------------
FROM appmgr-xapp-base as appmgr-build
#----------------------------------------------------------
FROM appmgr-xapp-base as appmgr-build
-ARG PACKAGEURL
-ARG HELMVERSION
-
+ARG HELMVERSION=v2.13.0-rc.1
+ARG PACKAGEURL=gerrit.o-ran-sc.org/r/c/ric-plt/appmgr/
#
#----------------------------------------------------------
FROM appmgr-build as appmgr-test_unit
#
#----------------------------------------------------------
FROM appmgr-build as appmgr-test_unit
+ARG PACKAGEURL=gerrit.o-ran-sc.org/r/c/ric-plt/appmgr/
WORKDIR "/go/src/${PACKAGEURL}"
CMD ["make","go-test"]
WORKDIR "/go/src/${PACKAGEURL}"
CMD ["make","go-test"]
#
#----------------------------------------------------------
FROM appmgr-build as appmgr-test_fmt
#
#----------------------------------------------------------
FROM appmgr-build as appmgr-test_fmt
+ARG PACKAGEURL=gerrit.o-ran-sc.org/r/c/ric-plt/appmgr/
WORKDIR "/go/src/${PACKAGEURL}"
CMD ["make","go-test-fmt"]
WORKDIR "/go/src/${PACKAGEURL}"
CMD ["make","go-test-fmt"]
#
#----------------------------------------------------------
FROM appmgr-build as appmgr-test_sanity
#
#----------------------------------------------------------
FROM appmgr-build as appmgr-test_sanity
+ARG PACKAGEURL=gerrit.o-ran-sc.org/r/c/ric-plt/appmgr/
WORKDIR "/go/src/${PACKAGEURL}"
CMD ["jq","-s",".", "api/appmgr_rest_api.json"]
WORKDIR "/go/src/${PACKAGEURL}"
CMD ["jq","-s",".", "api/appmgr_rest_api.json"]
#
#----------------------------------------------------------
FROM ubuntu:16.04 as appmgr
#
#----------------------------------------------------------
FROM ubuntu:16.04 as appmgr
+ARG PACKAGEURL=gerrit.o-ran-sc.org/r/c/ric-plt/appmgr/
RUN apt-get update -y \
&& apt-get install -y sudo openssl ca-certificates ca-cacert \
RUN apt-get update -y \
&& apt-get install -y sudo openssl ca-certificates ca-cacert \
"swagger": "2.0",
"info": {
"description": "This is a draft API for RIC appmgr",
"swagger": "2.0",
"info": {
"description": "This is a draft API for RIC appmgr",
"title": "RIC appmgr",
"license": {
"name": "Apache 2.0",
"title": "RIC appmgr",
"license": {
"name": "Apache 2.0",
"host": "hostname",
"basePath": "/ric/v1",
"schemes": [
"host": "hostname",
"basePath": "/ric/v1",
"schemes": [
"200": {
"description": "successful query of xApps",
"schema": {
"200": {
"description": "successful query of xApps",
"schema": {
- "$ref": "#/definitions/AllXapps"
+ "$ref": "#/definitions/AllDeployedXapps"
+ }
+ },
+ "500": {
+ "description": "Internal error"
+ }
+ }
+ }
+ },
+ "/xapps/list": {
+ "get": {
+ "summary": "Returns the list of all deployable xapps",
+ "tags": [
+ "xapp"
+ ],
+ "operationId": "listAllXapps",
+ "produces": [
+ "application/json"
+ ],
+ "responses": {
+ "200": {
+ "description": "successful list of deployable xApps",
+ "schema": {
+ "$ref": "#/definitions/AllDeployableXapps"
+ "AllDeployableXapps": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "example": "xapp-dummy"
+ }
+ },
+ "AllDeployedXapps": {
"type": "array",
"items": {
"$ref": "#/definitions/Xapp"
"type": "array",
"items": {
"$ref": "#/definitions/Xapp"
- "$ref": "#/definitions/AllXapps"
+ "$ref": "#/definitions/AllDeployedXapps"
swagger: '2.0'
info:
description: This is a draft API for RIC appmgr
swagger: '2.0'
info:
description: This is a draft API for RIC appmgr
title: RIC appmgr
license:
name: Apache 2.0
title: RIC appmgr
license:
name: Apache 2.0
host: hostname
basePath: /ric/v1
schemes:
host: hostname
basePath: /ric/v1
schemes:
- http
paths:
/health/alive :
- http
paths:
/health/alive :
'200':
description: successful query of xApps
schema:
'200':
description: successful query of xApps
schema:
- $ref: '#/definitions/AllXapps'
+ $ref: '#/definitions/AllDeployedXapps'
+ '500':
+ description: Internal error
+ '/xapps/list':
+ get:
+ summary: Returns the list of all deployable xapps
+ tags:
+ - xapp
+ operationId: listAllXapps
+ produces:
+ - application/json
+ responses:
+ '200':
+ description: successful list of deployable xApps
+ schema:
+ $ref: '#/definitions/AllDeployableXapps'
'500':
description: Internal error
'/xapps/{xAppName}':
'500':
description: Internal error
'/xapps/{xAppName}':
'400':
description: Invalid subscription supplied
definitions:
'400':
description: Invalid subscription supplied
definitions:
+ AllDeployableXapps:
+ type: array
+ items:
+ type: string
+ example: "xapp-dummy"
+ AllDeployedXapps:
type: array
items:
$ref: '#/definitions/Xapp'
type: array
items:
$ref: '#/definitions/Xapp'
- deleted
- updated
xApps:
- deleted
- updated
xApps:
- $ref: '#/definitions/AllXapps'
+ $ref: '#/definitions/AllDeployedXapps'
{"GET", "/ric/v1/health/ready", m.getHealthStatus},
{"GET", "/ric/v1/xapps", m.getAllXapps},
{"GET", "/ric/v1/health/ready", m.getHealthStatus},
{"GET", "/ric/v1/xapps", m.getAllXapps},
+ {"GET", "/ric/v1/xapps/search", m.searchAllXapps},
{"GET", "/ric/v1/xapps/{name}", m.getXappByName},
{"GET", "/ric/v1/xapps/{name}/instances/{id}", m.getXappInstanceByName},
{"POST", "/ric/v1/xapps", m.deployXapp},
{"GET", "/ric/v1/xapps/{name}", m.getXappByName},
{"GET", "/ric/v1/xapps/{name}/instances/{id}", m.getXappInstanceByName},
{"POST", "/ric/v1/xapps", m.deployXapp},
respondWithJSON(w, http.StatusOK, xapps)
}
respondWithJSON(w, http.StatusOK, xapps)
}
+func (m *XappManager) searchAllXapps(w http.ResponseWriter, r *http.Request) {
+ respondWithJSON(w, http.StatusOK, m.helm.SearchAll())
+}
+
func (m *XappManager) deployXapp(w http.ResponseWriter, r *http.Request) {
if r.Body == nil {
Logger.Error("No xapp data found in request body - url=%s", r.URL.RequestURI())
func (m *XappManager) deployXapp(w http.ResponseWriter, r *http.Request) {
if r.Body == nil {
Logger.Error("No xapp data found in request body - url=%s", r.URL.RequestURI())
return xapps, helmError
}
return xapps, helmError
}
+func (h *MockedHelmer) SearchAll() (s []string) {
+ return s
+}
+
func (h *MockedHelmer) List() (names []string, err error) {
return names, helmError
}
func (h *MockedHelmer) List() (names []string, err error) {
return names, helmError
}
+func (cm *MockedConfigMapper) GetNamesFromHelmRepo() (names []string) {
+ return
+}
+
// Test cases
func TestGetMessages(t *testing.T) {
cm := ConfigMap{}
// Test cases
func TestGetMessages(t *testing.T) {
cm := ConfigMap{}
return h.GetNames(string(out))
}
return h.GetNames(string(out))
}
+func (h *Helm) SearchAll() (names []string) {
+ return h.cm.GetNamesFromHelmRepo()
+}
+
func (h *Helm) Delete(name string) (xapp Xapp, err error) {
xapp, err = h.Status(name)
if err != nil {
func (h *Helm) Delete(name string) (xapp Xapp, err error) {
xapp, err = h.Status(name)
if err != nil {
ApplyConfigMap(r XAppConfig, action string) (err error)
GetMessages(name string) (msgs MessageTypes)
GetNamespace(ns string) string
ApplyConfigMap(r XAppConfig, action string) (err error)
GetMessages(name string) (msgs MessageTypes)
GetNamespace(ns string) string
+ GetNamesFromHelmRepo() (names []string)
}
type Helmer interface {
}
type Helmer interface {
Install(m XappDeploy) (xapp Xapp, err error)
Status(name string) (xapp Xapp, err error)
StatusAll() (xapps []Xapp, err error)
Install(m XappDeploy) (xapp Xapp, err error)
Status(name string) (xapp Xapp, err error)
StatusAll() (xapps []Xapp, err error)
+ SearchAll() (xapps []string)
List() (xapps []string, err error)
Delete(name string) (xapp Xapp, err error)
}
List() (xapps []string, err error)
Delete(name string) (xapp Xapp, err error)
}