update api code generate
authorwansuyoo <wansu.yoo@samsung.com>
Thu, 14 Mar 2019 04:52:26 +0000 (13:52 +0900)
committerwansuyoo <wansu.yoo@samsung.com>
Thu, 14 Mar 2019 04:52:26 +0000 (13:52 +0900)
25 files changed:
.gitignore
doc/README.md [new file with mode: 0644]
doc/edge-orchestration-api.yaml [deleted file]
doc/generate-api/.swagger-codegen-ignore [new file with mode: 0644]
doc/generate-api/.swagger-codegen/VERSION [new file with mode: 0644]
doc/generate-api/api/swagger.yaml [new file with mode: 0644]
doc/generate-api/go/README.md [new file with mode: 0644]
doc/generate-api/go/api_device_resource.go [new file with mode: 0644]
doc/generate-api/go/api_service_manager.go [new file with mode: 0644]
doc/generate-api/go/logger.go [new file with mode: 0644]
doc/generate-api/go/model_api_response.go [new file with mode: 0644]
doc/generate-api/go/model_cpu.go [new file with mode: 0644]
doc/generate-api/go/model_disk.go [new file with mode: 0644]
doc/generate-api/go/model_memory.go [new file with mode: 0644]
doc/generate-api/go/model_network.go [new file with mode: 0644]
doc/generate-api/go/model_service_info.go [new file with mode: 0644]
doc/generate-api/go/model_service_list.go [new file with mode: 0644]
doc/generate-api/go/model_service_request.go [new file with mode: 0644]
doc/generate-api/go/model_system_param.go [new file with mode: 0644]
doc/generate-api/go/model_user_param.go [new file with mode: 0644]
doc/generate-api/go/routers.go [new file with mode: 0644]
doc/generate-api/main.go [new file with mode: 0644]
doc/generate-api/swagger-codegen-cli.jar [new file with mode: 0644]
pkg/linux_amd64/devicemgr.a [deleted file]
pkg/linux_amd64/servicemgr.a [deleted file]

index 789354fd8d7d481c487dc39ec563cc66201c1503..4676dec1d76cf39a80a1662d057b63cc18e60fd7 100644 (file)
@@ -5,6 +5,7 @@
 *.so
 *.dylib
 bin/*
+pkg/*
 
 # Test binary, build with `go test -c`
 *.test
diff --git a/doc/README.md b/doc/README.md
new file mode 100644 (file)
index 0000000..26d87a4
--- /dev/null
@@ -0,0 +1,14 @@
+## Generating api server code with Swagger tool from JSON
+### Prerequisite
+Make sure Java version 1.8 or later is installed on your computer.
+To check java version, please open terminal and type
+```
+$ java -version
+java version "1.8.0_201"
+Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
+Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
+```
+### Code generate
+```
+$ java -jar swagger-codegen-cli.jar generate -i ../edge-orchestration-api.json -l go-server
+```
\ No newline at end of file
diff --git a/doc/edge-orchestration-api.yaml b/doc/edge-orchestration-api.yaml
deleted file mode 100644 (file)
index 134a075..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
----
-swagger: "2.0"
-info:
-  description: "Edge Orchestration support to deliver distributed service process\
-    \ environment."
-  version: "v1-20190307"
-  title: "Edge Orchestration"
-tags:
-- name: "Device Resource"
-  description: "Device resource"
-- name: "Service Manager"
-  description: "Managing services"
-schemes:
-- "http"
-paths:
-  /api/v1/device/resource/usage/cpu:
-    get:
-      tags:
-      - "Device Resource"
-      description: "Get device cpu usage"
-      consumes:
-      - "application/json"
-      produces:
-      - "application/json"
-      parameters: []
-      responses:
-        200:
-          description: "Successful operation"
-          schema:
-            $ref: "#/definitions/CPU"
-  /api/v1/device/resource/usage/memory:
-    get:
-      tags:
-      - "Device Resource"
-      description: "Get device memory usage"
-      consumes:
-      - "application/json"
-      produces:
-      - "application/json"
-      parameters: []
-      responses:
-        200:
-          description: "Successful operation"
-          schema:
-            $ref: "#/definitions/Memory"
-  /api/v1/device/resource/usage/network:
-    get:
-      tags:
-      - "Device Resource"
-      description: "Get device network usage"
-      consumes:
-      - "application/json"
-      produces:
-      - "application/json"
-      parameters: []
-      responses:
-        200:
-          description: "Successful operation"
-          schema:
-            $ref: "#/definitions/Network"
-  /api/v1/device/resource/usage/disk:
-    get:
-      tags:
-      - "Device Resource"
-      description: "Get device disk usage"
-      consumes:
-      - "application/json"
-      produces:
-      - "application/json"
-      parameters: []
-      responses:
-        200:
-          description: "Successful operation"
-          schema:
-            $ref: "#/definitions/Disk"
-  /api/v1/servicemgr/service:
-    get:
-      tags:
-      - "Service Manager"
-      description: "Get Service list"
-      consumes:
-      - "application/json"
-      produces:
-      - "application/json"
-      parameters: []
-      responses:
-        200:
-          description: "Successful operation"
-          schema:
-            $ref: "#/definitions/ServiceList"
-    post:
-      tags:
-      - "Service Manager"
-      description: "Create service"
-      consumes:
-      - "application/json"
-      produces:
-      - "application/json"
-      parameters:
-      - in: "body"
-        name: "body"
-        description: "Parameters for request service execution"
-        required: false
-        schema:
-          $ref: "#/definitions/ServiceRequest"
-        x-exportParamName: "Body"
-      responses:
-        200:
-          description: "Successful operation"
-          schema:
-            $ref: "#/definitions/APIResponse"
-    delete:
-      tags:
-      - "Service Manager"
-      description: "Destroy service"
-      consumes:
-      - "application/json"
-      produces:
-      - "application/json"
-      parameters: []
-      responses:
-        200:
-          description: "Successful operation"
-          schema:
-            $ref: "#/definitions/APIResponse"
-  /api/v1/servicemgr/service/{serviceID}:
-    get:
-      tags:
-      - "Service Manager"
-      description: "Get service information"
-      consumes:
-      - "application/json"
-      produces:
-      - "application/json"
-      parameters:
-      - name: "serviceID"
-        in: "path"
-        description: "Name of service"
-        required: true
-        type: "string"
-        x-exportParamName: "ServiceID"
-      responses:
-        200:
-          description: "Successful operation"
-          schema:
-            $ref: "#/definitions/ServiceInfo"
-definitions:
-  CPU:
-    type: "object"
-    properties:
-      cpu:
-        type: "string"
-        example: "0.187383"
-        description: "Usage of CPU"
-    example:
-      cpu: "0.187383"
-  Memory:
-    type: "object"
-    properties:
-      memory:
-        type: "string"
-        example: "11.871336"
-        description: "Usage of Memory"
-    example:
-      memory: "11.871336"
-  Network:
-    type: "object"
-    properties:
-      network:
-        type: "string"
-        example: "0.003023"
-        description: "Usage of Network"
-    example:
-      network: "0.003023"
-  Disk:
-    type: "object"
-    properties:
-      network:
-        type: "string"
-        example: ""
-        description: "Usage of Disk"
-    example:
-      network: ""
-  SystemParam:
-    type: "object"
-    properties:
-      ipAddr:
-        type: "string"
-        example: "127.0.0.1"
-        description: "IP Addr of device requesting service"
-      port:
-        type: "string"
-        example: "5432"
-        description: "Port number of device requesting service"
-    example:
-      port: "5432"
-      ipAddr: "127.0.0.1"
-  UserParam:
-    type: "object"
-    properties:
-      arguments:
-        type: "string"
-        example: "5"
-        description: "User parameter of requesting service"
-    example:
-      arguments: "5"
-  ServiceRequest:
-    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:
-        $ref: "#/definitions/UserParam"
-    example:
-      userParam:
-        arguments: "5"
-      serviceName: "helloWorld_service"
-      type: "CPU"
-      systemParam:
-        port: "5432"
-        ipAddr: "127.0.0.1"
-      status: "Start"
-  ServiceInfo:
-    type: "object"
-    properties:
-      serviceName:
-        type: "string"
-        example: "helloWorld_service"
-        description: "Service name"
-      serviceID:
-        type: "string"
-        example: "helloWorld_service_deviceID_UUID"
-        description: "Unique ID of service"
-      status:
-        type: "string"
-        example: "Start"
-        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"
-      deviceID: "Edge_deviceID"
-      status: "Start"
-  ServiceList:
-    type: "array"
-    items:
-      $ref: "#/definitions/ServiceInfo"
-  APIResponse:
-    type: "object"
-    properties:
-      message:
-        type: "string"
-        description: "Return the status of the request"
-    example:
-      message: "message"
diff --git a/doc/generate-api/.swagger-codegen-ignore b/doc/generate-api/.swagger-codegen-ignore
new file mode 100644 (file)
index 0000000..c5fa491
--- /dev/null
@@ -0,0 +1,23 @@
+# Swagger Codegen Ignore
+# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/doc/generate-api/.swagger-codegen/VERSION b/doc/generate-api/.swagger-codegen/VERSION
new file mode 100644 (file)
index 0000000..acdc3f1
--- /dev/null
@@ -0,0 +1 @@
+2.4.2
\ No newline at end of file
diff --git a/doc/generate-api/api/swagger.yaml b/doc/generate-api/api/swagger.yaml
new file mode 100644 (file)
index 0000000..134a075
--- /dev/null
@@ -0,0 +1,270 @@
+---
+swagger: "2.0"
+info:
+  description: "Edge Orchestration support to deliver distributed service process\
+    \ environment."
+  version: "v1-20190307"
+  title: "Edge Orchestration"
+tags:
+- name: "Device Resource"
+  description: "Device resource"
+- name: "Service Manager"
+  description: "Managing services"
+schemes:
+- "http"
+paths:
+  /api/v1/device/resource/usage/cpu:
+    get:
+      tags:
+      - "Device Resource"
+      description: "Get device cpu usage"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters: []
+      responses:
+        200:
+          description: "Successful operation"
+          schema:
+            $ref: "#/definitions/CPU"
+  /api/v1/device/resource/usage/memory:
+    get:
+      tags:
+      - "Device Resource"
+      description: "Get device memory usage"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters: []
+      responses:
+        200:
+          description: "Successful operation"
+          schema:
+            $ref: "#/definitions/Memory"
+  /api/v1/device/resource/usage/network:
+    get:
+      tags:
+      - "Device Resource"
+      description: "Get device network usage"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters: []
+      responses:
+        200:
+          description: "Successful operation"
+          schema:
+            $ref: "#/definitions/Network"
+  /api/v1/device/resource/usage/disk:
+    get:
+      tags:
+      - "Device Resource"
+      description: "Get device disk usage"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters: []
+      responses:
+        200:
+          description: "Successful operation"
+          schema:
+            $ref: "#/definitions/Disk"
+  /api/v1/servicemgr/service:
+    get:
+      tags:
+      - "Service Manager"
+      description: "Get Service list"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters: []
+      responses:
+        200:
+          description: "Successful operation"
+          schema:
+            $ref: "#/definitions/ServiceList"
+    post:
+      tags:
+      - "Service Manager"
+      description: "Create service"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters:
+      - in: "body"
+        name: "body"
+        description: "Parameters for request service execution"
+        required: false
+        schema:
+          $ref: "#/definitions/ServiceRequest"
+        x-exportParamName: "Body"
+      responses:
+        200:
+          description: "Successful operation"
+          schema:
+            $ref: "#/definitions/APIResponse"
+    delete:
+      tags:
+      - "Service Manager"
+      description: "Destroy service"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters: []
+      responses:
+        200:
+          description: "Successful operation"
+          schema:
+            $ref: "#/definitions/APIResponse"
+  /api/v1/servicemgr/service/{serviceID}:
+    get:
+      tags:
+      - "Service Manager"
+      description: "Get service information"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters:
+      - name: "serviceID"
+        in: "path"
+        description: "Name of service"
+        required: true
+        type: "string"
+        x-exportParamName: "ServiceID"
+      responses:
+        200:
+          description: "Successful operation"
+          schema:
+            $ref: "#/definitions/ServiceInfo"
+definitions:
+  CPU:
+    type: "object"
+    properties:
+      cpu:
+        type: "string"
+        example: "0.187383"
+        description: "Usage of CPU"
+    example:
+      cpu: "0.187383"
+  Memory:
+    type: "object"
+    properties:
+      memory:
+        type: "string"
+        example: "11.871336"
+        description: "Usage of Memory"
+    example:
+      memory: "11.871336"
+  Network:
+    type: "object"
+    properties:
+      network:
+        type: "string"
+        example: "0.003023"
+        description: "Usage of Network"
+    example:
+      network: "0.003023"
+  Disk:
+    type: "object"
+    properties:
+      network:
+        type: "string"
+        example: ""
+        description: "Usage of Disk"
+    example:
+      network: ""
+  SystemParam:
+    type: "object"
+    properties:
+      ipAddr:
+        type: "string"
+        example: "127.0.0.1"
+        description: "IP Addr of device requesting service"
+      port:
+        type: "string"
+        example: "5432"
+        description: "Port number of device requesting service"
+    example:
+      port: "5432"
+      ipAddr: "127.0.0.1"
+  UserParam:
+    type: "object"
+    properties:
+      arguments:
+        type: "string"
+        example: "5"
+        description: "User parameter of requesting service"
+    example:
+      arguments: "5"
+  ServiceRequest:
+    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:
+        $ref: "#/definitions/UserParam"
+    example:
+      userParam:
+        arguments: "5"
+      serviceName: "helloWorld_service"
+      type: "CPU"
+      systemParam:
+        port: "5432"
+        ipAddr: "127.0.0.1"
+      status: "Start"
+  ServiceInfo:
+    type: "object"
+    properties:
+      serviceName:
+        type: "string"
+        example: "helloWorld_service"
+        description: "Service name"
+      serviceID:
+        type: "string"
+        example: "helloWorld_service_deviceID_UUID"
+        description: "Unique ID of service"
+      status:
+        type: "string"
+        example: "Start"
+        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"
+      deviceID: "Edge_deviceID"
+      status: "Start"
+  ServiceList:
+    type: "array"
+    items:
+      $ref: "#/definitions/ServiceInfo"
+  APIResponse:
+    type: "object"
+    properties:
+      message:
+        type: "string"
+        description: "Return the status of the request"
+    example:
+      message: "message"
diff --git a/doc/generate-api/go/README.md b/doc/generate-api/go/README.md
new file mode 100644 (file)
index 0000000..e26f903
--- /dev/null
@@ -0,0 +1,25 @@
+# Go API Server for swagger
+
+Edge Orchestration support to deliver distributed service process environment.
+
+## Overview
+This server was generated by the [swagger-codegen]
+(https://github.com/swagger-api/swagger-codegen) project.  
+By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub.  
+-
+
+To see how to make this your own, look here:
+
+[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)
+
+- API version: v1-20190307
+- Build date: 2019-03-14T13:19:12.241+09:00
+
+
+### Running the server
+To run the server, follow these simple steps:
+
+```
+go run main.go
+```
+
diff --git a/doc/generate-api/go/api_device_resource.go b/doc/generate-api/go/api_device_resource.go
new file mode 100644 (file)
index 0000000..0e5c9ec
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190307
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+import (
+       "net/http"
+)
+
+func ApiV1DeviceResourceUsageCpuGet(w http.ResponseWriter, r *http.Request) {
+       w.Header().Set("Content-Type", "application/json; charset=UTF-8")
+       w.WriteHeader(http.StatusOK)
+}
+
+func ApiV1DeviceResourceUsageDiskGet(w http.ResponseWriter, r *http.Request) {
+       w.Header().Set("Content-Type", "application/json; charset=UTF-8")
+       w.WriteHeader(http.StatusOK)
+}
+
+func ApiV1DeviceResourceUsageMemoryGet(w http.ResponseWriter, r *http.Request) {
+       w.Header().Set("Content-Type", "application/json; charset=UTF-8")
+       w.WriteHeader(http.StatusOK)
+}
+
+func ApiV1DeviceResourceUsageNetworkGet(w http.ResponseWriter, r *http.Request) {
+       w.Header().Set("Content-Type", "application/json; charset=UTF-8")
+       w.WriteHeader(http.StatusOK)
+}
diff --git a/doc/generate-api/go/api_service_manager.go b/doc/generate-api/go/api_service_manager.go
new file mode 100644 (file)
index 0000000..ac1d8dd
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190307
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+import (
+       "net/http"
+)
+
+func ApiV1ServicemgrServiceDelete(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) {
+       w.Header().Set("Content-Type", "application/json; charset=UTF-8")
+       w.WriteHeader(http.StatusOK)
+}
+
+func ApiV1ServicemgrServicePost(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) {
+       w.Header().Set("Content-Type", "application/json; charset=UTF-8")
+       w.WriteHeader(http.StatusOK)
+}
diff --git a/doc/generate-api/go/logger.go b/doc/generate-api/go/logger.go
new file mode 100644 (file)
index 0000000..28dcc27
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190307
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+import (
+    "log"
+    "net/http"
+    "time"
+)
+
+func Logger(inner http.Handler, name string) http.Handler {
+    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+        start := time.Now()
+
+        inner.ServeHTTP(w, r)
+
+        log.Printf(
+            "%s %s %s %s",
+            r.Method,
+            r.RequestURI,
+            name,
+            time.Since(start),
+        )
+    })
+}
diff --git a/doc/generate-api/go/model_api_response.go b/doc/generate-api/go/model_api_response.go
new file mode 100644 (file)
index 0000000..446f044
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190307
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type ApiResponse struct {
+
+       // Return the status of the request
+       Message string `json:"message,omitempty"`
+}
diff --git a/doc/generate-api/go/model_cpu.go b/doc/generate-api/go/model_cpu.go
new file mode 100644 (file)
index 0000000..655e203
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190307
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type Cpu struct {
+
+       // Usage of CPU
+       Cpu string `json:"cpu,omitempty"`
+}
diff --git a/doc/generate-api/go/model_disk.go b/doc/generate-api/go/model_disk.go
new file mode 100644 (file)
index 0000000..7adc777
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190307
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type Disk struct {
+
+       // Usage of Disk
+       Network string `json:"network,omitempty"`
+}
diff --git a/doc/generate-api/go/model_memory.go b/doc/generate-api/go/model_memory.go
new file mode 100644 (file)
index 0000000..0d32211
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190307
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type Memory struct {
+
+       // Usage of Memory
+       Memory string `json:"memory,omitempty"`
+}
diff --git a/doc/generate-api/go/model_network.go b/doc/generate-api/go/model_network.go
new file mode 100644 (file)
index 0000000..a02eea1
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190307
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type Network struct {
+
+       // Usage of Network
+       Network string `json:"network,omitempty"`
+}
diff --git a/doc/generate-api/go/model_service_info.go b/doc/generate-api/go/model_service_info.go
new file mode 100644 (file)
index 0000000..735abee
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190307
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type ServiceInfo struct {
+
+       // Service name
+       ServiceName string `json:"serviceName,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"`
+}
diff --git a/doc/generate-api/go/model_service_list.go b/doc/generate-api/go/model_service_list.go
new file mode 100644 (file)
index 0000000..acc1566
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190307
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type ServiceList struct {
+}
diff --git a/doc/generate-api/go/model_service_request.go b/doc/generate-api/go/model_service_request.go
new file mode 100644 (file)
index 0000000..a309f96
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190307
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type ServiceRequest struct {
+
+       // Name of requested service
+       ServiceName string `json:"serviceName,omitempty"`
+
+       // Status of requested service
+       Status string `json:"status,omitempty"`
+
+       // Type of resource for requested service
+       Type_ string `json:"type,omitempty"`
+
+       SystemParam *SystemParam `json:"systemParam,omitempty"`
+
+       UserParam *UserParam `json:"userParam,omitempty"`
+}
diff --git a/doc/generate-api/go/model_system_param.go b/doc/generate-api/go/model_system_param.go
new file mode 100644 (file)
index 0000000..f364847
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190307
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type SystemParam struct {
+
+       // IP Addr of device requesting service
+       IpAddr string `json:"ipAddr,omitempty"`
+
+       // Port number of device requesting service
+       Port string `json:"port,omitempty"`
+}
diff --git a/doc/generate-api/go/model_user_param.go b/doc/generate-api/go/model_user_param.go
new file mode 100644 (file)
index 0000000..b6b82e2
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190307
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+type UserParam struct {
+
+       // User parameter of requesting service
+       Arguments string `json:"arguments,omitempty"`
+}
diff --git a/doc/generate-api/go/routers.go b/doc/generate-api/go/routers.go
new file mode 100644 (file)
index 0000000..23b4cdb
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190307
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package swagger
+
+import (
+       "fmt"
+       "net/http"
+       "strings"
+
+       "github.com/gorilla/mux"
+)
+
+type Route struct {
+       Name        string
+       Method      string
+       Pattern     string
+       HandlerFunc http.HandlerFunc
+}
+
+type Routes []Route
+
+func NewRouter() *mux.Router {
+       router := mux.NewRouter().StrictSlash(true)
+       for _, route := range routes {
+               var handler http.Handler
+               handler = route.HandlerFunc
+               handler = Logger(handler, route.Name)
+
+               router.
+                       Methods(route.Method).
+                       Path(route.Pattern).
+                       Name(route.Name).
+                       Handler(handler)
+       }
+
+       return router
+}
+
+func Index(w http.ResponseWriter, r *http.Request) {
+       fmt.Fprintf(w, "Hello World!")
+}
+
+var routes = Routes{
+       Route{
+               "Index",
+               "GET",
+               "/",
+               Index,
+       },
+
+       Route{
+               "ApiV1DeviceResourceUsageCpuGet",
+               strings.ToUpper("Get"),
+               "/api/v1/device/resource/usage/cpu",
+               ApiV1DeviceResourceUsageCpuGet,
+       },
+
+       Route{
+               "ApiV1DeviceResourceUsageDiskGet",
+               strings.ToUpper("Get"),
+               "/api/v1/device/resource/usage/disk",
+               ApiV1DeviceResourceUsageDiskGet,
+       },
+
+       Route{
+               "ApiV1DeviceResourceUsageMemoryGet",
+               strings.ToUpper("Get"),
+               "/api/v1/device/resource/usage/memory",
+               ApiV1DeviceResourceUsageMemoryGet,
+       },
+
+       Route{
+               "ApiV1DeviceResourceUsageNetworkGet",
+               strings.ToUpper("Get"),
+               "/api/v1/device/resource/usage/network",
+               ApiV1DeviceResourceUsageNetworkGet,
+       },
+
+       Route{
+               "ApiV1ServicemgrServiceDelete",
+               strings.ToUpper("Delete"),
+               "/api/v1/servicemgr/service",
+               ApiV1ServicemgrServiceDelete,
+       },
+
+       Route{
+               "ApiV1ServicemgrServiceGet",
+               strings.ToUpper("Get"),
+               "/api/v1/servicemgr/service",
+               ApiV1ServicemgrServiceGet,
+       },
+
+       Route{
+               "ApiV1ServicemgrServicePost",
+               strings.ToUpper("Post"),
+               "/api/v1/servicemgr/service",
+               ApiV1ServicemgrServicePost,
+       },
+
+       Route{
+               "ApiV1ServicemgrServiceServiceIDGet",
+               strings.ToUpper("Get"),
+               "/api/v1/servicemgr/service/{serviceID}",
+               ApiV1ServicemgrServiceServiceIDGet,
+       },
+}
diff --git a/doc/generate-api/main.go b/doc/generate-api/main.go
new file mode 100644 (file)
index 0000000..e3ccb09
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Edge Orchestration
+ *
+ * Edge Orchestration support to deliver distributed service process environment.
+ *
+ * API version: v1-20190307
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+ */
+
+package main
+
+import (
+       "log"
+       "net/http"
+
+       // WARNING!
+       // Change this to a fully-qualified import path
+       // once you place this file into your project.
+       // For example,
+       //
+       //    sw "github.com/myname/myrepo/go"
+       //
+       sw "./go"
+)
+
+func main() {
+       log.Printf("Server started")
+
+       router := sw.NewRouter()
+
+       log.Fatal(http.ListenAndServe(":8080", router))
+}
diff --git a/doc/generate-api/swagger-codegen-cli.jar b/doc/generate-api/swagger-codegen-cli.jar
new file mode 100644 (file)
index 0000000..73f8501
Binary files /dev/null and b/doc/generate-api/swagger-codegen-cli.jar differ
diff --git a/pkg/linux_amd64/devicemgr.a b/pkg/linux_amd64/devicemgr.a
deleted file mode 100644 (file)
index 7fff7ec..0000000
Binary files a/pkg/linux_amd64/devicemgr.a and /dev/null differ
diff --git a/pkg/linux_amd64/servicemgr.a b/pkg/linux_amd64/servicemgr.a
deleted file mode 100644 (file)
index b971e79..0000000
Binary files a/pkg/linux_amd64/servicemgr.a and /dev/null differ