update api document
authorwansuyoo <wansu.yoo@samsung.com>
Mon, 18 Mar 2019 08:13:38 +0000 (17:13 +0900)
committerwansuyoo <wansu.yoo@samsung.com>
Mon, 18 Mar 2019 08:13:38 +0000 (17:13 +0900)
doc/edge-orchestration-api.json

index bf3e202..7bd3287 100644 (file)
@@ -3,13 +3,17 @@
        "info": {
                "title": "Edge Orchestration",
                "description": "Edge Orchestration support to deliver distributed service process environment.",
-               "version": "v1-20190307"
+               "version": "v1-20190318"
        },
        "schemes": [
                "http"
        ],
        "tags": [
                {
+                       "name": "Discovery Manager",
+                       "description": "Edge Discovery"
+               },
+               {
                        "name": "Device Resource",
                        "description": "Device resource"                
                },
                }
        ],
        "paths": {
+               "/api/v1/discoverymgr/devices": {
+                       "get": {
+                               "tags": [
+                                       "Discovery Manager"
+                               ],
+                               "description": "Get result of Edge discovery",
+                               "consumes": [
+                                       "application/json"
+                               ],
+                               "produces": [
+                                       "application/json"
+                               ],
+                               "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"
+                                       }
+                               ],
+                               "responses": {
+                                       "200": {
+                                               "description": "Successful operation",
+                                               "schema": {
+                                                       "$ref": "#/definitions/DiscoveryEdge"
+                                               }
+                                       }
+                               }
+                       }
+               },
                "/api/v1/device/resource/usage/cpu": {
                        "get": {
                                "tags": [
                                }
                        }
                },
-               "/api/v1/servicemgr/service": {
+               "/api/v1/servicemgr/services": {
                        "post": {
                                "tags": [
                                        "Service Manager"
                                ],
-                               "description": "Create service",
+                               "description": "Create user app object",
                                "consumes": [
                                        "application/json"
                                ],
                                        {
                                                "in": "body",
                                                "name": "body",
-                                               "description": "Parameters for request service execution",
+                                               "description": "Parameters for request user service creation",
                                                "schema": {
                                                        "$ref": "#/definitions/ServiceRequest"
                                                }
                                        "200": {
                                                "description": "Successful operation",
                                                "schema": {
-                                                       "$ref": "#/definitions/APIResponse"
+                                                       "$ref": "#/definitions/ServiceObjectList"
                                                }
                                        }
                                }
                                "tags": [
                                        "Service Manager"
                                ],
-                               "description": "Destroy service",
+                               "description": "Destroy user app object",
                                "consumes": [
                                        "application/json"
                                ],
                                "produces": [
                                        "application/json"
                                ],
+                               "parameters": [
+                                       {
+                                               "name": "appname",
+                                               "in": "path",
+                                               "description": "Name of user app to be destroied",
+                                               "required": true,
+                                               "type": "string"
+                                       }
+                               ],
                                "responses": {
                                        "200": {
                                                "description": "Successful operation",
                                "tags": [
                                        "Service Manager"
                                ],
-                               "description": "Get Service list",
+                               "description": "Get information of user service",
                                "consumes": [
                                        "application/json"
                                ],
                                }
                        }
                },
-               "/api/v1/servicemgr/service/{serviceID}": {
+               "/api/v1/servicemgr/services/{serviceid}": {
+                       "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"
+                                       },
+                                       {
+                                               "in": "body",
+                                               "name": "serviceParam",
+                                               "description": "Parameters for request micro-service creation",
+                                               "schema": {
+                                                       "$ref": "#/definitions/MicroServiceRequest"
+                                               }
+                                       }
+                               ],
+                               "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",
+                                               "in": "path",
+                                               "description": "ID of micro-service",
+                                               "required": true,
+                                               "type": "string"
+                                       }
+                               ],
+                               "responses": {
+                                       "200": {
+                                               "description": "Successful operation",
+                                               "schema": {
+                                                       "$ref": "#/definitions/APIResponse"
+                                               }
+                                       }
+                               }
+                       },
                        "get": {
                                "tags": [
                                        "Service Manager"
                                ],
-                               "description": "Get service information",
+                               "description": "Get information of micro-service",
                                "consumes": [
                                        "application/json"
                                ],
                                ],
                                "parameters": [
                                        {
-                                               "name": "serviceID",
+                                               "name": "serviceid",
                                                "in": "path",
-                                               "description": "Name of service",
+                                               "description": "ID of micro-service",
                                                "required": true,
                                                "type": "string"
                                        }
                                        "200": {
                                                "description": "Successful operation",
                                                "schema": {
-                                                       "$ref": "#/definitions/ServiceInfo"
+                                                       "$ref": "#/definitions/MicroServiceInfo"
                                                }
                                        }
                                }
                }
        },
        "definitions": {
+               "EdgeResource": {
+                       "type": "string",
+                       "description": "H/W resource of Edge device can support"
+               },
+               "DiscoveryEdge": {
+                       "type": "object",
+                       "properties": {
+                               "deviceID": {
+                                       "type": "string",
+                                       "description": "Unique ID of Edge device",
+                                       "example": "edge-0001"
+                               },
+                               "deviceIPAddr": {
+                                       "type": "string",
+                                       "description": "IP address of Edge device",
+                                       "example": "10.113.175.249"
+                               },
+                               "deviceProperties": {
+                                       "type": "array",
+                                       "description": "Edge resources",
+                                       "items": {
+                                               "$ref": "#/definitions/EdgeResource"
+                                       },
+                                       "example": [
+                                               "display",
+                                               "speaker"
+                                       ]
+                               },
+                               "status": {
+                                       "type": "string",
+                                       "description": "Status of Edge device",
+                                       "example": "Up"
+                               }
+                       }
+               },
+               "DiscoveryEdgeList": {
+                       "type": "array",
+                       "items": {
+                               "$ref": "#/definitions/DiscoveryEdge"
+                       }
+               },
                "CPU": {
                        "type": "object",
                        "properties": {
                                }
                        }
                },
+               "MicroServiceRequest": {
+                       "type": "object",
+                       "properties": {
+                               "systemParam": {
+                                       "$ref": "#/definitions/SystemParam"
+                               },
+                               "userParam": {
+                                       "$ref": "#/definitions/UserParam"
+                               }
+                       }
+               },
+               "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",
+                                       "items": {
+                                               "$ref": "#/definitions/ServiceObject"
+                                       },
+                                       "example": [
+                                               {
+                                                       "id": 2,
+                                                       "time": "2019-03-14T13:43:38+09:00"
+                                               },
+                                               {
+                                                       "id": 3,
+                                                       "time": "2019-03-14T13:43:38+09:00"
+                                               }
+                                       ]
+                               }
+                       }
+               },
                "ServiceRequest": {
                        "type": "object",
                        "properties": {
-                               "serviceName": {
+                               "appName": {
                                        "type": "string",
-                                       "description": "Name of requested service",
-                                       "example": "helloWorld_service"
+                                       "description": "Name of requested user service",
+                                       "example": "GreetWorldApp"
                                },
-                               "status": {
+                               "serviceName": {
                                        "type": "string",
-                                       "description": "Status of requested service",
-                                       "example": "Start"
+                                       "description": "Name of micro-services",
+                                       "example": "HelloWorldService"
                                },
-                               "type": {
+                               "count": {
+                                       "type": "integer",
+                                       "description": "Count of micro-services",
+                                       "example": 2
+                               }
+                       }
+               },
+               "ServiceInfo": {
+                       "type": "object",
+                       "properties": {
+                               "appName": {
                                        "type": "string",
-                                       "description": "Type of resource for requested service",
-                                       "example": "CPU"
-                               },
-                               "systemParam": {
-                                       "$ref": "#/definitions/SystemParam"
+                                       "description": "Name of requested user service",
+                                       "example": "GreetWorldApp"
                                },
-                               "userParam": {
-                                       "$ref": "#/definitions/UserParam"
+                               "serviceList": {
+                                       "$ref": "#/definitions/MicroServiceList"
                                }
                        }
                },
-               "ServiceInfo": {
+               "ServiceList": {
+                       "type": "array",
+                       "items": {
+                               "$ref": "#/definitions/ServiceInfo"
+                       }
+               },
+               "MicroServiceInfo": {
                        "type": "object",
                        "properties": {
                                "serviceName": {
                                        "type": "string",
                                        "description": "Service name",
-                                       "example": "helloWorld_service"
+                                       "example": "HelloWorldService#1"
                                },
                                "serviceID": {
-                                       "type": "string",
+                                       "type": "integer",
                                        "description": "Unique ID of service",
-                                       "example": "helloWorld_service_deviceID_UUID"
+                                       "example": 2
                                },
                                "status": {
                                        "type": "string",
                                        "description": "Status of service",
-                                       "example": "Start"
+                                       "example": "started"
                                },
                                "deviceID": {
                                        "type": "string",
                                }
                        }
                },
-               "ServiceList": {
+               "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",