update restapi functions
authorwansuyoo <wansu.yoo@samsung.com>
Mon, 18 Mar 2019 09:24:30 +0000 (18:24 +0900)
committerwansuyoo <wansu.yoo@samsung.com>
Mon, 18 Mar 2019 09:24:30 +0000 (18:24 +0900)
29 files changed:
doc/generate-api/api/swagger.yaml
doc/generate-api/go/api_device_resource.go
doc/generate-api/go/api_discovery_manager.go [new file with mode: 0644]
doc/generate-api/go/api_service_manager.go
doc/generate-api/go/logger.go
doc/generate-api/go/model_api_response.go
doc/generate-api/go/model_cpu.go
doc/generate-api/go/model_discovery_edge.go [new file with mode: 0644]
doc/generate-api/go/model_discovery_edge_list.go [new file with mode: 0644]
doc/generate-api/go/model_disk.go
doc/generate-api/go/model_edge_resource.go [new file with mode: 0644]
doc/generate-api/go/model_memory.go
doc/generate-api/go/model_micro_service_info.go [new file with mode: 0644]
doc/generate-api/go/model_micro_service_list.go [new file with mode: 0644]
doc/generate-api/go/model_micro_service_request.go [new file with mode: 0644]
doc/generate-api/go/model_network.go
doc/generate-api/go/model_service_info.go
doc/generate-api/go/model_service_list.go
doc/generate-api/go/model_service_object.go [new file with mode: 0644]
doc/generate-api/go/model_service_object_list.go [new file with mode: 0644]
doc/generate-api/go/model_service_request.go
doc/generate-api/go/model_system_param.go
doc/generate-api/go/model_user_param.go
doc/generate-api/go/routers.go
doc/generate-api/main.go
src/restapi/v1/logger.go
src/restapi/v1/restapi.go
src/restapi/v1/routers.go
src/servicemgr/types.go

index 134a075..c5ef1b4 100644 (file)
@@ -3,9 +3,11 @@ swagger: "2.0"
 info:
   description: "Edge Orchestration support to deliver distributed service process\
     \ environment."
-  version: "v1-20190307"
+  version: "v1-20190318"
   title: "Edge Orchestration"
 tags:
+- name: "Discovery Manager"
+  description: "Edge Discovery"
 - name: "Device Resource"
   description: "Device resource"
 - name: "Service Manager"
@@ -13,6 +15,42 @@ tags:
 schemes:
 - "http"
 paths:
+  /api/v1/discoverymgr/devices:
+    get:
+      tags:
+      - "Discovery Manager"
+      description: "Get result of Edge discovery"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters: []
+      responses:
+        200:
+          description: "Successful operation"
+          schema:
+            $ref: "#/definitions/DiscoveryEdgeList"
+  /api/v1/discoverymgr/devices/{deviceid}:
+    get:
+      tags:
+      - "Discovery Manager"
+      description: "Get result of Edge discovery"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters:
+      - name: "deviceid"
+        in: "path"
+        description: "ID of Edge device"
+        required: true
+        type: "string"
+        x-exportParamName: "Deviceid"
+      responses:
+        200:
+          description: "Successful operation"
+          schema:
+            $ref: "#/definitions/DiscoveryEdge"
   /api/v1/device/resource/usage/cpu:
     get:
       tags:
@@ -73,11 +111,11 @@ paths:
           description: "Successful operation"
           schema:
             $ref: "#/definitions/Disk"
-  /api/v1/servicemgr/service:
+  /api/v1/servicemgr/services:
     get:
       tags:
       - "Service Manager"
-      description: "Get Service list"
+      description: "Get information of user service"
       consumes:
       - "application/json"
       produces:
@@ -91,7 +129,7 @@ paths:
     post:
       tags:
       - "Service Manager"
-      description: "Create service"
+      description: "Create user app object"
       consumes:
       - "application/json"
       produces:
@@ -99,7 +137,7 @@ paths:
       parameters:
       - in: "body"
         name: "body"
-        description: "Parameters for request service execution"
+        description: "Parameters for request user service creation"
         required: false
         schema:
           $ref: "#/definitions/ServiceRequest"
@@ -108,43 +146,133 @@ paths:
         200:
           description: "Successful operation"
           schema:
-            $ref: "#/definitions/APIResponse"
+            $ref: "#/definitions/ServiceObjectList"
     delete:
       tags:
       - "Service Manager"
-      description: "Destroy service"
+      description: "Destroy user app object"
       consumes:
       - "application/json"
       produces:
       - "application/json"
-      parameters: []
+      parameters:
+      - name: "appname"
+        in: "path"
+        description: "Name of user app to be destroied"
+        required: true
+        type: "string"
+        x-exportParamName: "Appname"
       responses:
         200:
           description: "Successful operation"
           schema:
             $ref: "#/definitions/APIResponse"
-  /api/v1/servicemgr/service/{serviceID}:
+  /api/v1/servicemgr/services/{serviceid}:
     get:
       tags:
       - "Service Manager"
-      description: "Get service information"
+      description: "Get information of micro-service"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters:
+      - name: "serviceid"
+        in: "path"
+        description: "ID of micro-service"
+        required: true
+        type: "string"
+        x-exportParamName: "Serviceid"
+      responses:
+        200:
+          description: "Successful operation"
+          schema:
+            $ref: "#/definitions/MicroServiceInfo"
+    post:
+      tags:
+      - "Service Manager"
+      description: "Execute requested service"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters:
+      - name: "serviceid"
+        in: "path"
+        description: "ID of micro-service"
+        required: true
+        type: "string"
+        x-exportParamName: "Serviceid"
+      - in: "body"
+        name: "serviceParam"
+        description: "Parameters for request micro-service creation"
+        required: false
+        schema:
+          $ref: "#/definitions/MicroServiceRequest"
+        x-exportParamName: "ServiceParam"
+      responses:
+        200:
+          description: "Successful operation"
+          schema:
+            $ref: "#/definitions/APIResponse"
+    delete:
+      tags:
+      - "Service Manager"
+      description: "Destroy requested micro-service"
       consumes:
       - "application/json"
       produces:
       - "application/json"
       parameters:
-      - name: "serviceID"
+      - name: "serviceid"
         in: "path"
-        description: "Name of service"
+        description: "ID of micro-service"
         required: true
         type: "string"
-        x-exportParamName: "ServiceID"
+        x-exportParamName: "Serviceid"
       responses:
         200:
           description: "Successful operation"
           schema:
-            $ref: "#/definitions/ServiceInfo"
+            $ref: "#/definitions/APIResponse"
 definitions:
+  EdgeResource:
+    type: "string"
+    description: "H/W resource of Edge device can support"
+  DiscoveryEdge:
+    type: "object"
+    properties:
+      deviceID:
+        type: "string"
+        example: "edge-0001"
+        description: "Unique ID of Edge device"
+      deviceIPAddr:
+        type: "string"
+        example: "10.113.175.249"
+        description: "IP address of Edge device"
+      deviceProperties:
+        type: "array"
+        example:
+        - "display"
+        - "speaker"
+        description: "Edge resources"
+        items:
+          $ref: "#/definitions/EdgeResource"
+      status:
+        type: "string"
+        example: "Up"
+        description: "Status of Edge device"
+    example:
+      deviceIPAddr: "10.113.175.249"
+      deviceProperties:
+      - "display"
+      - "speaker"
+      deviceID: "edge-0001"
+      status: "Up"
+  DiscoveryEdgeList:
+    type: "array"
+    items:
+      $ref: "#/definitions/DiscoveryEdge"
   CPU:
     type: "object"
     properties:
@@ -204,21 +332,9 @@ definitions:
         description: "User parameter of requesting service"
     example:
       arguments: "5"
-  ServiceRequest:
+  MicroServiceRequest:
     type: "object"
     properties:
-      serviceName:
-        type: "string"
-        example: "helloWorld_service"
-        description: "Name of requested service"
-      status:
-        type: "string"
-        example: "Start"
-        description: "Status of requested service"
-      type:
-        type: "string"
-        example: "CPU"
-        description: "Type of resource for requested service"
       systemParam:
         $ref: "#/definitions/SystemParam"
       userParam:
@@ -226,40 +342,105 @@ definitions:
     example:
       userParam:
         arguments: "5"
-      serviceName: "helloWorld_service"
-      type: "CPU"
       systemParam:
         port: "5432"
         ipAddr: "127.0.0.1"
-      status: "Start"
+  ServiceObject:
+    type: "object"
+    properties:
+      id:
+        type: "integer"
+        description: "Created ID of micro-service"
+      time:
+        type: "string"
+        description: "The time when micro-service created"
+  ServiceObjectList:
+    type: "object"
+    properties:
+      serviceList:
+        type: "array"
+        example:
+        - id: 2
+          time: "2019-03-14T13:43:38+09:00"
+        - id: 3
+          time: "2019-03-14T13:43:38+09:00"
+        items:
+          $ref: "#/definitions/ServiceObject"
+    example:
+      serviceList:
+      - id: 2
+        time: "2019-03-14T13:43:38+09:00"
+      - id: 3
+        time: "2019-03-14T13:43:38+09:00"
+  ServiceRequest:
+    type: "object"
+    properties:
+      appName:
+        type: "string"
+        example: "GreetWorldApp"
+        description: "Name of requested user service"
+      serviceName:
+        type: "string"
+        example: "HelloWorldService"
+        description: "Name of micro-services"
+      count:
+        type: "integer"
+        example: 2
+        description: "Count of micro-services"
+    example:
+      appName: "GreetWorldApp"
+      count: 2
+      serviceName: "HelloWorldService"
   ServiceInfo:
     type: "object"
     properties:
+      appName:
+        type: "string"
+        example: "GreetWorldApp"
+        description: "Name of requested user service"
+      serviceList:
+        $ref: "#/definitions/MicroServiceList"
+  ServiceList:
+    type: "array"
+    items:
+      $ref: "#/definitions/ServiceInfo"
+  MicroServiceInfo:
+    type: "object"
+    properties:
       serviceName:
         type: "string"
-        example: "helloWorld_service"
+        example: "HelloWorldService#1"
         description: "Service name"
       serviceID:
-        type: "string"
-        example: "helloWorld_service_deviceID_UUID"
+        type: "integer"
+        example: 2
         description: "Unique ID of service"
       status:
         type: "string"
-        example: "Start"
+        example: "started"
         description: "Status of service"
       deviceID:
         type: "string"
         example: "Edge_deviceID"
         description: "DeviceID on which the service is operating"
     example:
-      serviceName: "helloWorld_service"
-      serviceID: "helloWorld_service_deviceID_UUID"
+      serviceName: "HelloWorldService#1"
+      serviceID: 2
       deviceID: "Edge_deviceID"
-      status: "Start"
-  ServiceList:
+      status: "started"
+  MicroServiceList:
     type: "array"
     items:
-      $ref: "#/definitions/ServiceInfo"
+      $ref: "#/definitions/MicroServiceInfo"
+    example:
+    - serviceName: "HelloWorldService#1"
+      serviceID: 2
+      status: "started"
+      deviceID: "10.113.175.249"
+    - serviceName: "HelloWorldService#2"
+      serviceID: 3
+      status: "progressing"
+      deviceID: "10.113.175.239"
   APIResponse:
     type: "object"
     properties:
index 0e5c9ec..2426cb4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
diff --git a/doc/generate-api/go/api_discovery_manager.go b/doc/generate-api/go/api_discovery_manager.go
new file mode 100644 (file)
index 0000000..6bea3ac
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190318
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+import (
+       "net/http"
+)
+
+func ApiV1DiscoverymgrDevicesDeviceidGet(w http.ResponseWriter, r *http.Request) {
+       w.Header().Set("Content-Type", "application/json; charset=UTF-8")
+       w.WriteHeader(http.StatusOK)
+}
+
+func ApiV1DiscoverymgrDevicesGet(w http.ResponseWriter, r *http.Request) {
+       w.Header().Set("Content-Type", "application/json; charset=UTF-8")
+       w.WriteHeader(http.StatusOK)
+}
index ac1d8dd..11cdb89 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
@@ -13,22 +13,32 @@ import (
        "net/http"
 )
 
-func ApiV1ServicemgrServiceDelete(w http.ResponseWriter, r *http.Request) {
+func ApiV1ServicemgrServicesDelete(w http.ResponseWriter, r *http.Request) {
        w.Header().Set("Content-Type", "application/json; charset=UTF-8")
        w.WriteHeader(http.StatusOK)
 }
 
-func ApiV1ServicemgrServiceGet(w http.ResponseWriter, r *http.Request) {
+func ApiV1ServicemgrServicesGet(w http.ResponseWriter, r *http.Request) {
        w.Header().Set("Content-Type", "application/json; charset=UTF-8")
        w.WriteHeader(http.StatusOK)
 }
 
-func ApiV1ServicemgrServicePost(w http.ResponseWriter, r *http.Request) {
+func ApiV1ServicemgrServicesPost(w http.ResponseWriter, r *http.Request) {
        w.Header().Set("Content-Type", "application/json; charset=UTF-8")
        w.WriteHeader(http.StatusOK)
 }
 
-func ApiV1ServicemgrServiceServiceIDGet(w http.ResponseWriter, r *http.Request) {
+func ApiV1ServicemgrServicesServiceidDelete(w http.ResponseWriter, r *http.Request) {
+       w.Header().Set("Content-Type", "application/json; charset=UTF-8")
+       w.WriteHeader(http.StatusOK)
+}
+
+func ApiV1ServicemgrServicesServiceidGet(w http.ResponseWriter, r *http.Request) {
+       w.Header().Set("Content-Type", "application/json; charset=UTF-8")
+       w.WriteHeader(http.StatusOK)
+}
+
+func ApiV1ServicemgrServicesServiceidPost(w http.ResponseWriter, r *http.Request) {
        w.Header().Set("Content-Type", "application/json; charset=UTF-8")
        w.WriteHeader(http.StatusOK)
 }
index 28dcc27..ad916e3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
index 446f044..92f9f25 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
index 655e203..ed93b9a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
diff --git a/doc/generate-api/go/model_discovery_edge.go b/doc/generate-api/go/model_discovery_edge.go
new file mode 100644 (file)
index 0000000..b7242b8
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190318
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type DiscoveryEdge struct {
+
+       // Unique ID of Edge device
+       DeviceID string `json:"deviceID,omitempty"`
+
+       // IP address of Edge device
+       DeviceIPAddr string `json:"deviceIPAddr,omitempty"`
+
+       // Edge resources
+       DeviceProperties []EdgeResource `json:"deviceProperties,omitempty"`
+
+       // Status of Edge device
+       Status string `json:"status,omitempty"`
+}
diff --git a/doc/generate-api/go/model_discovery_edge_list.go b/doc/generate-api/go/model_discovery_edge_list.go
new file mode 100644 (file)
index 0000000..8e46f2f
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190318
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type DiscoveryEdgeList struct {
+}
index 7adc777..93a4ffa 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
diff --git a/doc/generate-api/go/model_edge_resource.go b/doc/generate-api/go/model_edge_resource.go
new file mode 100644 (file)
index 0000000..bef1ae5
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190318
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+// H/W resource of Edge device can support
+type EdgeResource struct {
+}
index 0d32211..67f9052 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
diff --git a/doc/generate-api/go/model_micro_service_info.go b/doc/generate-api/go/model_micro_service_info.go
new file mode 100644 (file)
index 0000000..7200bd7
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190318
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type MicroServiceInfo struct {
+
+       // Service name
+       ServiceName string `json:"serviceName,omitempty"`
+
+       // Unique ID of service
+       ServiceID int32 `json:"serviceID,omitempty"`
+
+       // Status of service
+       Status string `json:"status,omitempty"`
+
+       // DeviceID on which the service is operating
+       DeviceID string `json:"deviceID,omitempty"`
+}
diff --git a/doc/generate-api/go/model_micro_service_list.go b/doc/generate-api/go/model_micro_service_list.go
new file mode 100644 (file)
index 0000000..f5b2bee
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190318
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type MicroServiceList struct {
+}
diff --git a/doc/generate-api/go/model_micro_service_request.go b/doc/generate-api/go/model_micro_service_request.go
new file mode 100644 (file)
index 0000000..27117cf
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190318
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type MicroServiceRequest struct {
+
+       SystemParam *SystemParam `json:"systemParam,omitempty"`
+
+       UserParam *UserParam `json:"userParam,omitempty"`
+}
index a02eea1..3ba52f1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
index 735abee..9d4ee68 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
@@ -11,15 +11,8 @@ package swagger
 
 type ServiceInfo struct {
 
-       // Service name
-       ServiceName string `json:"serviceName,omitempty"`
+       // Name of requested user service
+       AppName string `json:"appName,omitempty"`
 
-       // Unique ID of service
-       ServiceID string `json:"serviceID,omitempty"`
-
-       // Status of service
-       Status string `json:"status,omitempty"`
-
-       // DeviceID on which the service is operating
-       DeviceID string `json:"deviceID,omitempty"`
+       ServiceList *MicroServiceList `json:"serviceList,omitempty"`
 }
index acc1566..6f8c990 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
diff --git a/doc/generate-api/go/model_service_object.go b/doc/generate-api/go/model_service_object.go
new file mode 100644 (file)
index 0000000..a131c7b
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190318
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type ServiceObject struct {
+
+       // Created ID of micro-service
+       Id int32 `json:"id,omitempty"`
+
+       // The time when micro-service created
+       Time string `json:"time,omitempty"`
+}
diff --git a/doc/generate-api/go/model_service_object_list.go b/doc/generate-api/go/model_service_object_list.go
new file mode 100644 (file)
index 0000000..c0c5dbf
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190318
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type ServiceObjectList struct {
+
+       ServiceList []ServiceObject `json:"serviceList,omitempty"`
+}
index a309f96..df43061 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
@@ -11,16 +11,12 @@ package swagger
 
 type ServiceRequest struct {
 
-       // Name of requested service
-       ServiceName string `json:"serviceName,omitempty"`
-
-       // Status of requested service
-       Status string `json:"status,omitempty"`
+       // Name of requested user service
+       AppName string `json:"appName,omitempty"`
 
-       // Type of resource for requested service
-       Type_ string `json:"type,omitempty"`
-
-       SystemParam *SystemParam `json:"systemParam,omitempty"`
+       // Name of micro-services
+       ServiceName string `json:"serviceName,omitempty"`
 
-       UserParam *UserParam `json:"userParam,omitempty"`
+       // Count of micro-services
+       Count int32 `json:"count,omitempty"`
 }
index f364847..f083e7f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
index b6b82e2..cfee401 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
index 23b4cdb..ca2e5b3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
@@ -84,30 +84,58 @@ var routes = Routes{
        },
 
        Route{
-               "ApiV1ServicemgrServiceDelete",
+               "ApiV1DiscoverymgrDevicesDeviceidGet",
+               strings.ToUpper("Get"),
+               "/api/v1/discoverymgr/devices/{deviceid}",
+               ApiV1DiscoverymgrDevicesDeviceidGet,
+       },
+
+       Route{
+               "ApiV1DiscoverymgrDevicesGet",
+               strings.ToUpper("Get"),
+               "/api/v1/discoverymgr/devices",
+               ApiV1DiscoverymgrDevicesGet,
+       },
+
+       Route{
+               "ApiV1ServicemgrServicesDelete",
                strings.ToUpper("Delete"),
-               "/api/v1/servicemgr/service",
-               ApiV1ServicemgrServiceDelete,
+               "/api/v1/servicemgr/services",
+               ApiV1ServicemgrServicesDelete,
        },
 
        Route{
-               "ApiV1ServicemgrServiceGet",
+               "ApiV1ServicemgrServicesGet",
                strings.ToUpper("Get"),
-               "/api/v1/servicemgr/service",
-               ApiV1ServicemgrServiceGet,
+               "/api/v1/servicemgr/services",
+               ApiV1ServicemgrServicesGet,
        },
 
        Route{
-               "ApiV1ServicemgrServicePost",
+               "ApiV1ServicemgrServicesPost",
                strings.ToUpper("Post"),
-               "/api/v1/servicemgr/service",
-               ApiV1ServicemgrServicePost,
+               "/api/v1/servicemgr/services",
+               ApiV1ServicemgrServicesPost,
        },
 
        Route{
-               "ApiV1ServicemgrServiceServiceIDGet",
+               "ApiV1ServicemgrServicesServiceidDelete",
+               strings.ToUpper("Delete"),
+               "/api/v1/servicemgr/services/{serviceid}",
+               ApiV1ServicemgrServicesServiceidDelete,
+       },
+
+       Route{
+               "ApiV1ServicemgrServicesServiceidGet",
                strings.ToUpper("Get"),
-               "/api/v1/servicemgr/service/{serviceID}",
-               ApiV1ServicemgrServiceServiceIDGet,
+               "/api/v1/servicemgr/services/{serviceid}",
+               ApiV1ServicemgrServicesServiceidGet,
+       },
+
+       Route{
+               "ApiV1ServicemgrServicesServiceidPost",
+               strings.ToUpper("Post"),
+               "/api/v1/servicemgr/services/{serviceid}",
+               ApiV1ServicemgrServicesServiceidPost,
        },
 }
index e3ccb09..5323101 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
index 9c1e6af..c7ef003 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
index d4b09c4..d958ef6 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
@@ -56,20 +56,24 @@ func APIV1DeviceResourceUsageNetworkGet(w http.ResponseWriter, r *http.Request)
        writeJSONResponse(w, data, http.StatusOK)
 }
 
-// APIV1ServicemgrServiceGet function
-func APIV1ServicemgrServiceGet(w http.ResponseWriter, r *http.Request) {
-       log.Printf("[%s] APIV1ServicemgrServiceGet", logPrefix)
+// APIV1DiscoverymgrDevicesDeviceIDGet function
+func APIV1DiscoverymgrDevicesDeviceIDGet(w http.ResponseWriter, r *http.Request) {
+       log.Printf("[%s] APIV1DiscoverymgrDevicesDeviceIDGet", logPrefix)
+}
 
-       w.Header().Set("Content-Type", "application/json; charset=UTF-8")
-       w.WriteHeader(http.StatusOK)
+// APIV1DiscoverymgrDevicesGet function
+func APIV1DiscoverymgrDevicesGet(w http.ResponseWriter, r *http.Request) {
+       log.Printf("[%s] APIV1DiscoverymgrDevicesGet", logPrefix)
 }
 
-// APIV1ServicemgrServiceServiceIDGet function
-func APIV1ServicemgrServiceServiceIDGet(w http.ResponseWriter, r *http.Request) {
-       log.Printf("[%s] APIV1ServicemgrServiceServiceIDGet", logPrefix)
+// APIV1ServicemgrServicesDelete function
+func APIV1ServicemgrServicesDelete(w http.ResponseWriter, r *http.Request) {
+       log.Printf("[%s] APIV1ServicemgrServicesDelete", logPrefix)
+}
 
-       w.Header().Set("Content-Type", "application/json; charset=UTF-8")
-       w.WriteHeader(http.StatusOK)
+// APIV1ServicemgrServicesGet function
+func APIV1ServicemgrServicesGet(w http.ResponseWriter, r *http.Request) {
+       log.Printf("[%s] APIV1ServicemgrServicesGet", logPrefix)
 }
 
 // APIV1ServicemgrServicesPost function
@@ -79,58 +83,55 @@ func APIV1ServicemgrServicesPost(w http.ResponseWriter, r *http.Request) {
        serviceParam, err := servicemgr.CreateServiceHandler(w, r)
        if err == nil {
                data := servicemgr.Create(serviceParam)
-               w.Header().Set("Content-Type", "application/json; charset=UTF-8")
                writeJSONResponse(w, data, http.StatusOK)
        } else {
-               w.Header().Set("Content-Type", "application/json; charset=UTF-8")
-               w.WriteHeader(http.StatusBadRequest)
+               writeJSONResponse(w, nil, http.StatusBadRequest)
        }
 }
 
-// APIV1ServicemgrServicesServiceIDPost function
-func APIV1ServicemgrServicesServiceIDPost(w http.ResponseWriter, r *http.Request) {
-       log.Printf("[%s] APIV1ServicemgrServiceIDPost", logPrefix)
+// APIV1ServicemgrServicesServiceIDDelete function
+func APIV1ServicemgrServicesServiceIDDelete(w http.ResponseWriter, r *http.Request) {
+       log.Printf("[%s] APIV1ServicemgrServicesServiceIDDelete", logPrefix)
 
        vars := mux.Vars(r)
        serviceID := vars["serviceid"]
        id, err := strconv.ParseUint(serviceID, 10, 64)
 
-       exist, _ := servicemgr.ServiceNameMap.Get(id)
-
-       if exist == nil || err != nil {
-               smbytes, _ := json.Marshal(servicemgr.ServiceCreationResponse{"NOTFOUND"})
+       if len(serviceID) == 0 || err != nil {
+               smbytes, _ := json.Marshal(servicemgr.ServiceDestroyResponse{Return: "NOTFOUND"})
                writeJSONResponse(w, smbytes, http.StatusBadRequest)
        } else {
-               distService, _ := servicemgr.ExecuteServiceHandler(w, r, id)
-               go servicemgr.Run(distService, id)
+               go servicemgr.DeleteServiceHandler(w, r, id)
 
-               w.Header().Set("Content-Type", "application/json; charset=UTF-8")
-               smbytes, _ := json.Marshal(servicemgr.ServiceCreationResponse{"OK"})
-               writeJSONResponse(w, smbytes, http.StatusBadRequest)
+               smbytes, _ := json.Marshal(servicemgr.ServiceDestroyResponse{Return: "OK"})
+               writeJSONResponse(w, smbytes, http.StatusOK)
        }
 }
 
-// APIV1ServicemgrEventServiceIDPost function
-func APIV1ServicemgrEventServiceIDPost(w http.ResponseWriter, r *http.Request) {
-
+// APIV1ServicemgrServicesServiceIDGet function
+func APIV1ServicemgrServicesServiceIDGet(w http.ResponseWriter, r *http.Request) {
+       log.Printf("[%s] APIV1ServicemgrServicesServiceIDGet", logPrefix)
 }
 
-// APIV1ServicemgrServicesServiceIDDelete function
-func APIV1ServicemgrServicesServiceIDDelete(w http.ResponseWriter, r *http.Request) {
-       log.Printf("[%s] APIV1ServicemgrServicesServiceIDDelete", logPrefix)
+// APIV1ServicemgrServicesServiceIDPost function
+func APIV1ServicemgrServicesServiceIDPost(w http.ResponseWriter, r *http.Request) {
+       log.Printf("[%s] APIV1ServicemgrServicesServiceIDPost", logPrefix)
 
        vars := mux.Vars(r)
        serviceID := vars["serviceid"]
        id, err := strconv.ParseUint(serviceID, 10, 64)
 
-       if len(serviceID) == 0 || err != nil {
-               w.Header().Set("Content-Type", "application/json; charset=UTF-8")
-               w.WriteHeader(http.StatusBadRequest)
+       exist, _ := servicemgr.ServiceNameMap.Get(id)
+
+       if exist == nil || err != nil {
+               smbytes, _ := json.Marshal(servicemgr.ServiceCreationResponse{Return: "NOTFOUND"})
+               writeJSONResponse(w, smbytes, http.StatusBadRequest)
        } else {
-               go servicemgr.DeleteServiceHandler(w, r, id)
+               distService, _ := servicemgr.ExecuteServiceHandler(w, r, id)
+               go servicemgr.Run(distService, id)
 
-               w.Header().Set("Content-Type", "application/json; charset=UTF-8")
-               w.WriteHeader(http.StatusOK)
+               smbytes, _ := json.Marshal(servicemgr.ServiceCreationResponse{Return: "OK"})
+               writeJSONResponse(w, smbytes, http.StatusOK)
        }
 }
 
index 27e229f..558afc9 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Edge Orchestration support to deliver distributed service process environment.
  *
- * API version: v1-20190307
+ * API version: v1-20190318
  * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
  */
 
@@ -48,7 +48,7 @@ func NewRouter() *mux.Router {
 
 // Index function
 func Index(w http.ResponseWriter, r *http.Request) {
-       fmt.Fprintf(w, "Edge Orchestration!!!")
+       fmt.Fprintf(w, "Hello World!")
 }
 
 var routes = Routes{
@@ -88,31 +88,31 @@ var routes = Routes{
        },
 
        Route{
-               "APIV1ServicemgrServicesServiceIDDelete",
-               strings.ToUpper("Delete"),
-               "/api/v1/servicemgr/services/{serviceid}",
-               APIV1ServicemgrServicesServiceIDDelete,
+               "APIV1DiscoverymgrDevicesDeviceIDGet",
+               strings.ToUpper("Get"),
+               "/api/v1/discoverymgr/devices/{deviceid}",
+               APIV1DiscoverymgrDevicesDeviceIDGet,
        },
 
        Route{
-               "APIV1ServicemgrServiceGet",
+               "APIV1DiscoverymgrDevicesGet",
                strings.ToUpper("Get"),
-               "/api/v1/servicemgr/service",
-               APIV1ServicemgrServiceGet,
+               "/api/v1/discoverymgr/devices",
+               APIV1DiscoverymgrDevicesGet,
        },
 
        Route{
-               "APIV1ServicemgrEventServiceIDPost",
-               strings.ToUpper("Post"),
-               "/api/v1/servicmgr/event/{serviceid}",
-               APIV1ServicemgrEventServiceIDPost,
+               "APIV1ServicemgrServicesDelete",
+               strings.ToUpper("Delete"),
+               "/api/v1/servicemgr/services",
+               APIV1ServicemgrServicesDelete,
        },
 
        Route{
-               "APIV1ServicemgrServicesServiceIDPost",
-               strings.ToUpper("Post"),
-               "/api/v1/servicemgr/services/{serviceid}",
-               APIV1ServicemgrServicesServiceIDPost,
+               "APIV1ServicemgrServicesGet",
+               strings.ToUpper("Get"),
+               "/api/v1/servicemgr/services",
+               APIV1ServicemgrServicesGet,
        },
 
        Route{
@@ -123,9 +123,23 @@ var routes = Routes{
        },
 
        Route{
-               "APIV1ServicemgrServiceServiceIDGet",
+               "APIV1ServicemgrServicesServiceIDDelete",
+               strings.ToUpper("Delete"),
+               "/api/v1/servicemgr/services/{serviceid}",
+               APIV1ServicemgrServicesServiceIDDelete,
+       },
+
+       Route{
+               "APIV1ServicemgrServicesServiceIDGet",
                strings.ToUpper("Get"),
-               "/api/v1/servicemgr/service/{serviceid}",
-               APIV1ServicemgrServiceServiceIDGet,
+               "/api/v1/servicemgr/services/{serviceid}",
+               APIV1ServicemgrServicesServiceIDGet,
+       },
+
+       Route{
+               "APIV1ServicemgrServicesServiceIDPost",
+               strings.ToUpper("Post"),
+               "/api/v1/servicemgr/services/{serviceid}",
+               APIV1ServicemgrServicesServiceIDPost,
        },
 }
index 764019b..7144348 100644 (file)
@@ -62,6 +62,11 @@ type ServiceCreationResponse struct {
        Return string `json:"return"`
 }
 
+// ServiceDestroyResponse structure
+type ServiceDestroyResponse struct {
+       Return string `json:"return"`
+}
+
 // ServiceExecutionResponse structure
 type ServiceExecutionResponse struct {
        ServiceList []ServiceExecutionItem `json:"serviceList"`