swagger supports multifile 07/8607/1
authormaopengzhang <zhang.maopeng1@zte.com.cn>
Thu, 24 Aug 2017 10:20:20 +0000 (18:20 +0800)
committermaopengzhang <zhang.maopeng1@zte.com.cn>
Thu, 24 Aug 2017 10:20:20 +0000 (18:20 +0800)
Split the swagger into multi files to nslcm,vnflcm,etc.

Change-Id: Ic9b645798316df9048528a84305af44855af7dd5
Issue-ID: VFC-145
Signed-off-by: maopengzhang <zhang.maopeng1@zte.com.cn>
14 files changed:
lcm/ns/swagger.json [deleted file]
lcm/ns/urls.py
lcm/settings.py
lcm/swagger/__init__.py [new file with mode: 0644]
lcm/swagger/tests.py [new file with mode: 0644]
lcm/swagger/urls.py [new file with mode: 0644]
lcm/swagger/vfc.db.swagger.json [new file with mode: 0644]
lcm/swagger/vfc.nslcm.swagger.json [new file with mode: 0644]
lcm/swagger/vfc.others.swagger.json [new file with mode: 0644]
lcm/swagger/vfc.sfclcm.swagger.json [new file with mode: 0644]
lcm/swagger/vfc.vllcm.swagger.json [new file with mode: 0644]
lcm/swagger/vfc.vnflcm.swagger.json [new file with mode: 0644]
lcm/swagger/views.py [new file with mode: 0644]
lcm/urls.py

diff --git a/lcm/ns/swagger.json b/lcm/ns/swagger.json
deleted file mode 100644 (file)
index e8a1f38..0000000
+++ /dev/null
@@ -1,1501 +0,0 @@
-{
-    "swagger": "2.0",
-    "info": {
-        "version": "1.0.0",
-        "title": "ONAP VFC Service Rest API"
-    },
-    "basePath": "/api/nslcm/v1",
-    "tags": [
-        {
-            "name": "vfc nslcm resource"
-        }
-    ],
-    "paths": {
-        "/nspackage": {
-            "post": {
-                "tags": [
-                    "ns package Resource"
-                ],
-                "summary": "ns package distribute",
-                "description": "ns package distribute",
-                "operationId": "ns_pkg_distribute",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "in": "body",
-                        "name": "body",
-                        "description": "distribute request param",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/NsPkgPostRequest"
-                        }
-                    }
-                ],
-                "responses": {
-                    "202": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/NsPkgPostResponse"
-                        }
-                    },
-                    "500": {
-                        "description": "internal error"
-                    }
-                }
-            }
-        },
-        "/nspackage/{csarId}": {
-            "get": {
-                "tags": [
-                    "ns package Resource"
-                ],
-                "summary": "query one ns package info",
-                "description": "query one ns package info",
-                "operationId": "query_one_ns_package",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "name": "csarId",
-                        "in": "path",
-                        "description": "csar id of ns package",
-                        "required": true,
-                        "type": "string"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "successful operation",
-                        "schema": {
-                            "$ref": "#/definitions/NsPackageInfo"
-                        }
-                    },
-                    "500": {
-                        "description": "internal error"
-                    }
-                }
-            },
-            "delete": {
-                "tags": [
-                    "ns package Resource"
-                ],
-                "summary": "delete ns pkg",
-                "description": "delete ns pkg",
-                "operationId": "delete_ns_pkg",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "name": "csarId",
-                        "in": "path",
-                        "description": "csar id of ns package",
-                        "required": true,
-                        "type": "string"
-                    }
-                ],
-                "responses": {
-                    "202": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/NsPkgPostResponse"
-                        }
-                    },
-                    "500": {
-                        "description": "internal error"
-                    }
-                }
-            }
-        },
-        "/vnfpackage": {
-            "get": {
-                "tags": [
-                    "nf package Resource"
-                ],
-                "summary": "query nf package info",
-                "description": "query nf package info",
-                "operationId": "query_nf_package",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                ],
-                "responses": {
-                    "200": {
-                        "description": "successful operation",
-                        "schema": {
-                            "$ref": "#/definitions/NfPackageListInfo"
-                        }
-                    },
-                    "500": {
-                        "description": "internal error"
-                    }
-                }
-            },
-            "post": {
-                "tags": [
-                    "nf package Resource"
-                ],
-                "summary": "nf package distribute",
-                "description": "nf package distribute",
-                "operationId": "nf_pkg_distribute",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "in": "body",
-                        "name": "body",
-                        "description": "distribute request param",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/NfPkgPostRequest"
-                        }
-                    }
-                ],
-                "responses": {
-                    "202": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/NfPkgPostResponse"
-                        }
-                    },
-                    "500": {
-                        "description": "internal error"
-                    }
-                }
-            }
-        },
-        "/vnfpackage/{csarId}": {
-            "get": {
-                "tags": [
-                    "nf package Resource"
-                ],
-                "summary": "query one nf package info",
-                "description": "query one nf package info",
-                "operationId": "query_one_nf_package",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "name": "csarId",
-                        "in": "path",
-                        "description": "csar id of nf package",
-                        "required": true,
-                        "type": "string"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "successful operation",
-                        "schema": {
-                            "$ref": "#/definitions/NfPackageInfo"
-                        }
-                    },
-                    "500": {
-                        "description": "internal error"
-                    }
-                }
-            },
-            "delete": {
-                "tags": [
-                    "nf package Resource"
-                ],
-                "summary": "delete nf pkg",
-                "description": "delete nf pkg",
-                "operationId": "delete_nf_pkg",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "name": "csarId",
-                        "in": "path",
-                        "description": "csar id of nf package",
-                        "required": true,
-                        "type": "string"
-                    }
-                ],
-                "responses": {
-                    "202": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/NfPkgPostResponse"
-                        }
-                    },
-                    "500": {
-                        "description": "internal error"
-                    }
-                }
-            }
-        },
-        "/ns/vls": {
-            "post": {
-                "tags": [
-                    "vls Resource"
-                ],
-                "summary": "vl create",
-                "description": "",
-                "operationId": "create_vl",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "in": "body",
-                        "name": "body",
-                        "description": "instantiate request param",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/VlPostRequest"
-                        }
-                    }
-                ],
-                "responses": {
-                    "201": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/VlPostResponse"
-                        }
-                    }
-                }
-            }
-        },
-        "/ns/vls/{vlId}": {
-            "get": {
-                "tags": [
-                    "vls Resource"
-                ],
-                "summary": "query the specified vl info",
-                "description": "",
-                "operationId": "query_vl",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "name": "vlId",
-                        "in": "path",
-                        "description": "vl instance id",
-                        "required": true,
-                        "type": "string"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "successful operation",
-                        "schema": {
-                            "$ref": "#/definitions/VlInfo"
-                        }
-                    },
-                    "404": {
-                        "description": "the vl instance id is wrong"
-                    },
-                    "500": {
-                        "description": "the url is invalid"
-                    }
-                }
-            },
-            "delete": {
-                "tags": [
-                    "vls Resource"
-                ],
-                "summary": "delete vl",
-                "description": "",
-                "operationId": "delete_vl",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "required": true,
-                        "type": "string",
-                        "description": "",
-                        "name": "vlId",
-                        "in": "path"
-                    }
-                ],
-                "responses": {
-                    "204": {
-                        "description": "successful operation",
-                        "schema": {
-                            "$ref": "#/definitions/DeleteVlResponse"
-                        }
-                    },
-                    "404": {
-                        "description": "the vl instance id is wrong"
-                    },
-                    "500": {
-                        "description": "the url is invalid"
-                    }
-                }
-            }
-        },
-        "/ns/vnfs": {
-            "post": {
-                "tags": [
-                    "vnfs Resource"
-                ],
-                "summary": "vnf create",
-                "description": "",
-                "operationId": "create_vnf",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "in": "body",
-                        "name": "body",
-                        "description": "instantiate request param",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/VnfPostRequest"
-                        }
-                    }
-                ],
-                "responses": {
-                    "201": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/VnfPostResponse"
-                        }
-                    }
-                }
-            }
-        },
-        "/ns/vnfs/{vnfInstId}": {
-            "get": {
-                "tags": [
-                    "vnfs Resource"
-                ],
-                "summary": "query the specified vnf info",
-                "description": "",
-                "operationId": "query_vnf",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "name": "vnfInstId",
-                        "in": "path",
-                        "description": "vnf instance id",
-                        "required": true,
-                        "type": "string"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "successful operation",
-                        "schema": {
-                            "$ref": "#/definitions/VnfInfo"
-                        }
-                    },
-                    "404": {
-                        "description": "the vnf instance id is wrong"
-                    },
-                    "500": {
-                        "description": "the url is invalid"
-                    }
-                }
-            },
-            "delete": {
-                "tags": [
-                    "vnfs Resource"
-                ],
-                "summary": "delete vnf",
-                "description": "",
-                "operationId": "delete_vnf",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "required": true,
-                        "type": "string",
-                        "description": "",
-                        "name": "vnfInstId",
-                        "in": "path"
-                    }
-                ],
-                "responses": {
-                    "204": {
-                        "description": "successful operation",
-                        "schema": {
-                            "$ref": "#/definitions/DeleteResponse"
-                        }
-                    },
-                    "404": {
-                        "description": "the vl instance id is wrong"
-                    },
-                    "500": {
-                        "description": "the url is invalid"
-                    }
-                }
-            }
-        },
-        "/ns/sfcs": {
-            "post": {
-                "tags": [
-                    "sfcs Resource"
-                ],
-                "summary": "sfc create",
-                "description": "",
-                "operationId": "create_sfc",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "in": "body",
-                        "name": "body",
-                        "description": "request param",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/SfcPostRequest"
-                        }
-                    }
-                ],
-                "responses": {
-                    "201": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/SfcPostResponse"
-                        }
-                    }
-                }
-            }
-        },
-        "/ns/sfcs/{sfcInstId}": {
-            "get": {
-                "tags": [
-                    "sfcs Resource"
-                ],
-                "summary": "query the specified sfc info",
-                "description": "",
-                "operationId": "query_sfc",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "name": "sfcInstId",
-                        "in": "path",
-                        "description": "sfc instance id",
-                        "required": true,
-                        "type": "string"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "successful operation",
-                        "schema": {
-                            "$ref": "#/definitions/SfcInfo"
-                        }
-                    },
-                    "404": {
-                        "description": "the sfc instance id is wrong"
-                    },
-                    "500": {
-                        "description": "the url is invalid"
-                    }
-                }
-            },
-            "delete": {
-                "tags": [
-                    "vnfs Resource"
-                ],
-                "summary": "delete sfc",
-                "description": "",
-                "operationId": "delete_sfc",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "required": true,
-                        "type": "string",
-                        "description": "",
-                        "name": "sfcInstId",
-                        "in": "path"
-                    }
-                ],
-                "responses": {
-                    "204": {
-                        "description": "successful operation",
-                        "schema": {
-                            "$ref": "#/definitions/DeleteResponse"
-                        }
-                    },
-                    "404": {
-                        "description": "the sfc instance id is wrong"
-                    },
-                    "500": {
-                        "description": "the url is invalid"
-                    }
-                }
-            }
-        },
-        "/ns/{nsInstanceId}/postdeal": {
-            "post": {
-                "tags": [
-                    "ns postdeal"
-                ],
-                "summary": "ns postdeal",
-                "description": "",
-                "operationId": "ns_postdeal",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "required": true,
-                        "type": "string",
-                        "description": "",
-                        "name": "nsInstanceId",
-                        "in": "path"
-                    },
-                    {
-                        "in": "body",
-                        "name": "body",
-                        "description": "request param",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/NSInstPostDetailRequest"
-                        }
-                    }
-                ],
-                "responses": {
-                    "202": {
-                        "description": ""
-                    }
-                }
-            }
-        },
-        "/ns/{nsInstanceId}/scale": {
-            "post": {
-                "tags": [
-                    "ns scale"
-                ],
-                "summary": "ns scale",
-                "description": "ns scale",
-                "operationId": "ns_scale",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "required": true,
-                        "type": "string",
-                        "description": "",
-                        "name": "nsInstanceId",
-                        "in": "path"
-                    },
-                    {
-                        "in": "body",
-                        "name": "ScaleNSRequest",
-                        "description": "Scale NS Request Body",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/ScaleNsRequest"
-                        }
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/NsScaleResponse"
-                        }
-                    },
-                    "201": {
-                        "description": "Invalid Request"
-                    }
-                }
-            }
-        },
-        "/ns/{ns_instance_id}": {
-            "delete": {
-                "tags": [
-                    "ns lcm"
-                ],
-                "summary": "ns delete",
-                "description": "ns delete",
-                "operationId": "ns_delete",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "required": true,
-                        "type": "string",
-                        "description": "Identifier of the NS instance.",
-                        "name": "ns_instance_id",
-                        "in": "path"
-                    }
-                ],
-                "responses": {
-                    "204": {
-                        "description": "The NS instance resource and the associated NS identifier were deleted successfully."
-                    }
-                }
-            }
-        },
-        "/ns/{ns_instance_id}/terminate": {
-            "post": {
-                "tags": [
-                    "ns lcm"
-                ],
-                "summary": "ns terminate",
-                "description": "ns terminate",
-                "operationId": "ns_terminate",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "required": true,
-                        "type": "string",
-                        "description": "Identifier of the NS instance.",
-                        "name": "ns_instance_id",
-                        "in": "path"
-                    },
-                    {
-                        "in": "body",
-                        "name": "NsTerminateRequest",
-                        "description": "NsTerminateRequest",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/NsTerminateRequest"
-                        }
-                    }
-                ],
-                "responses": {
-                    "202": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/NsTerminateResponse"
-                        }
-                    },
-                    "500": {
-                        "description": "the url is invalid"
-                    }
-                }
-            }
-        },
-        "/ns/{ns_instance_id}/heal": {
-            "post": {
-                "tags": [
-                    "ns heal"
-                ],
-                "summary": "ns heal",
-                "description": "ns heal",
-                "operationId": "ns_heal",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "required": true,
-                        "type": "string",
-                        "description": "Identifier of the NS instance.",
-                        "name": "ns_instance_id",
-                        "in": "path"
-                    },
-                    {
-                        "in": "body",
-                        "name": "healVnfData",
-                        "description": "healVnfData",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/healVnfDataRequest"
-                        }
-                    }
-                ],
-                "responses": {
-                    "202": {
-                        "description": "",
-                        "schema": {
-                            "$ref": "#/definitions/healVnfDataResponse"
-                        }
-                    },
-                    "500": {
-                        "description": "the url is invalid"
-                    }
-                }
-            }
-        },
-        "/mandb/{modelName}": {
-            "get": {
-                "tags": [
-                    "ns lcm"
-                ],
-                "summary": "query ns table info",
-                "description": "query ns table info",
-                "operationId": "query_ns_table",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "required": true,
-                        "type": "string",
-                        "description": "model Name.",
-                        "name": "modelName",
-                        "in": "path"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "successful operation",
-                        "schema": {
-                            "$ref": "#/definitions/TableInfo"
-                        }
-                    },
-                    "500": {
-                        "description": "the url is invalid"
-                    }
-                }
-            },
-            "delete": {
-                "tags": [
-                    "ns lcm"
-                ],
-                "summary": "ns table delete",
-                "description": "ns table delete",
-                "operationId": "ns_table_delete",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "required": true,
-                        "type": "string",
-                        "description": "model Name.",
-                        "name": "modelName",
-                        "in": "path"
-                    }
-                ],
-                "responses": {
-                    "204": {
-                        "description": "The tables were deleted successfully."
-                    }
-                }
-            }
-        },
-        "/ns": {
-            "get": {
-                "tags": [
-                    "ns lcm"
-                ],
-                "summary": "ns get",
-                "description": "ns get",
-                "operationId": "ns_get",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-  
-                ],
-                "responses": {
-                    "200": {
-                        "description": "successful operation",
-                        "schema": {
-                            "$ref": "#/definitions/NsInfo"
-                        }
-                    }
-                }
-            }
-        },
-        "/jobs/{jobId}":{
-          "post": {
-                "tags": [
-                    "jobstatus"
-                ],
-                "summary": "jobstatus",
-                "description": "",
-                "operationId": "jobstatus",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "parameters": [
-                    {
-                        "required": true,
-                        "type": "string",
-                        "description": "",
-                        "name": "jobId",
-                        "in": "path"
-                    },
-                    {
-                        "in": "body",
-                        "name": "body",
-                        "description": "request param",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/JobProgressRequest"
-                        }
-                    }
-                ],
-                "responses": {
-                    "202": {
-                        "description": ""
-                    }
-                }
-            }
-        }
-    },
-    "definitions": {
-        "NsPkgPostRequest": {
-            "type": "object",
-            "properties": {
-                "csarId": {
-                    "type": "string"
-                }
-            }
-        },
-        "NsPkgPostResponse": {
-            "type": "object",
-            "properties": {
-                "status": {
-                    "type": "string"
-                },
-                "statusDescription": {
-                    "type": "string"
-                },
-                "errorCode": {
-                    "type": "string"
-                }
-            }
-        },
-       
-        "NsPackageInfo": {
-            "type": "object",
-            "properties": {
-                "csarId": {
-                    "type": "string"
-                },
-                "packageInfo": {
-                    "$ref": "#/definitions/NsPkgDetailInfo"
-                },
-                "nsInstanceInfo": {
-                    "$ref": "#/definitions/NsInstListInfo"
-                }
-            }
-        },
-        "NsPkgDetailInfo": {
-            "type": "object",
-            "properties": {
-                "nsdId": {
-                    "type": "string"
-                },
-                "nsdProvider": {
-                    "type": "string"
-                },
-                "nsdVersion": {
-                    "type": "string"
-                }
-            }
-        },
-        "NsInstListInfo": {
-            "type": "array",
-            "items": {
-                "type": "object"
-            }
-        },
-        "NfPkgPostRequest": {
-            "type": "object",
-            "properties": {
-                "csarId": {
-                    "type": "string"
-                }
-            }
-        },
-        "NfPkgPostResponse": {
-            "type": "object",
-            "properties": {
-                "jobId": {
-                    "type": "string"
-                }
-            }
-        },
-        "NfPackageListInfo": {
-            "type": "object",
-            "properties": {
-                "csars": {
-                    "$ref": "#/definitions/NfPkgListInfo"
-                }
-            }
-        },
-        "NfPkgListInfo": {
-            "type": "array",
-            "items": {
-                "type": "object"
-            }
-        },
-        "NfPackageInfo": {
-            "type": "object",
-            "properties": {
-                "csarId": {
-                    "type": "string"
-                },
-                "packageInfo": {
-                    "$ref": "#/definitions/NfPkgDetailInfo"
-                },
-                "imageInfo": {
-                    "$ref": "#/definitions/NfPkgImgInfo"
-                },
-                "vnfInstanceInfo": {
-                    "$ref": "#/definitions/NfInstListInfo"
-                }
-            }
-        },
-        "NfPkgDetailInfo": {
-            "type": "object",
-            "properties": {
-                "vnfdId": {
-                    "type": "string"
-                },
-                "vnfdProvider": {
-                    "type": "string"
-                },
-                "vnfdVersion": {
-                    "type": "string"
-                },
-                "vnfVersion": {
-                    "type": "string"
-                }
-            }
-        },
-        "NfInstListInfo": {
-            "type": "array",
-            "items": {
-                "type": "object"
-            }
-        },
-        "NfPkgImgInfo": {
-            "type": "array",
-            "items": {
-                "type": "object"
-            }
-        },
-        "VlPostRequest": {
-            "type": "object",
-            "properties": {
-                "jobId": {
-                    "type": "string"
-                },
-                "nsInstanceId": {
-                    "type": "string"
-                },
-                "flavourId": {
-                    "type": "string"
-                },
-                "sapData": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "pnfInfo": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "vnfInstanceData": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "nestedNsInstanceId": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "locationConstraints": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "additionalParamForNs": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "additionalParamForVnf": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "extNSVirtualLink": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "context": {
-                    "type": "string"
-                },
-                "vlIndex": {
-                    "type": "string"
-                }
-            }
-        },
-        "VlPostResponse": {
-            "type": "object",
-            "properties": {
-                "result": {
-                    "type": "integer",
-                    "enum": [
-                        0,
-                        1
-                    ]
-                },
-                "detail": {
-                    "type": "string"
-                },
-                "vlId": {
-                    "type": "string"
-                }
-            }
-        },
-        "VnfPostRequest": {
-            "type": "object",
-            "properties": {
-                "jobId": {
-                    "type": "string"
-                },
-                "nsInstanceId": {
-                    "type": "string"
-                },
-                "flavourId": {
-                    "type": "string"
-                },
-                "sapData": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "pnfInfo": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "vnfInstanceData": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "nestedNsInstanceId": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "locationConstraints": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "additionalParamForNs": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "additionalParamForVnf": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "extNSVirtualLink": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "context": {
-                    "type": "string"
-                },
-                "vnfIndex": {
-                    "type": "string"
-                }
-            }
-        },
-        "VnfPostResponse": {
-            "type": "object",
-            "properties": {
-                "vnfInstId": {
-                    "type": "string"
-                },
-                "jobId": {
-                    "type": "string"
-                }
-            }
-        },
-        "SfcPostRequest": {
-            "type": "object",
-            "properties": {
-                "jobId": {
-                    "type": "string"
-                },
-                "nsInstanceId": {
-                    "type": "string"
-                },
-                "sapData": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "vnfInstanceData": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "additionalParamForNs": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "additionalParamForVnf": {
-                    "type": "array",
-                    "items": {
-                        "type": "object"
-                    }
-                },
-                "sdnControllerId": {
-                    "type": "string"
-                },
-                "context": {
-                    "type": "string"
-                },
-                "fpindex": {
-                    "type": "string"
-                }
-            }
-        },
-        "NSInstPostDetailRequest": {
-            "type": "object",
-            "properties": {
-                "status": {
-                    "type": "string"
-                }
-            }
-        },
-        "JobProgressRequest": {
-            "type": "object",
-            "properties": {
-                "progress": {
-                    "type": "string"
-                },
-                "desc": {
-                    "type": "string"
-                },
-                "errcode": {
-                    "type": "string"
-                }
-            }
-        },
-        "SfcPostResponse": {
-            "type": "object",
-            "properties": {
-                "sfcInstId": {
-                    "type": "string"
-                },
-                "jobId": {
-                    "type": "string"
-                }
-            }
-        },
-        "VlInfo": {
-            "type": "object",
-            "properties": {
-                "vlId": {
-                    "type": "string"
-                },
-                "vlName": {
-                    "type": "string"
-                },
-                "vlStatus": {
-                    "type": "string"
-                }
-            }
-        },
-        "VnfInfo": {
-            "type": "object",
-            "properties": {
-                "vnfInstId": {
-                    "type": "string"
-                },
-                "vnfName": {
-                    "type": "string"
-                },
-                "vnfStatus": {
-                    "type": "string"
-                }
-            }
-        },
-        "SfcInfo": {
-            "type": "object",
-            "properties": {
-                "sfcInstId": {
-                    "type": "string"
-                },
-                "sfcName": {
-                    "type": "string"
-                },
-                "sfcStatus": {
-                    "type": "string"
-                }
-            }
-        },
-        "DeleteVlResponse": {
-            "type": "object",
-            "properties": {
-                "result": {
-                    "type": "integer",
-                    "enum": [
-                        0,
-                        1
-                    ]
-                },
-                "detail": {
-                    "type": "string"
-                }
-            }
-        },
-        "DeleteResponse": {
-            "type": "object",
-            "properties": {
-                "result": {
-                    "type": "integer",
-                    "enum": [
-                        0,
-                        1
-                    ]
-                },
-                "detail": {
-                    "type": "string"
-                }
-            }
-        },
-        "ScaleNsRequest": {
-            "type": "object",
-            "properties": {
-                "scaleType":{
-                    "type": "string"
-                },
-                "scaleNsByStepsData": {
-                    "$ref": "#/definitions/ScaleNsByStepsData"
-                }
-            }
-        },
-        "ScaleNsByStepsData": {
-            "type": "object",
-            "properties": {
-                "scalingDirection": {
-                    "type": "string"
-                },
-                "aspectId": {
-                    "type": "string"
-                },
-                "numberOfSteps": {
-                    "type": "integer"
-                }
-            }
-        },
-        "NsScaleResponse": {
-            "type": "object",
-            "properties": {
-                "jobID": {
-                    "type": "string"
-                }
-            }
-        },
-        "NsTerminateRequest": {
-            "type": "object",
-            "properties": {
-                "terminationType": {
-                    "type": "string"
-                },
-                "gracefulTerminationTimeout": {
-                    "type": "string"
-                }
-            }
-        },
-        "NsTerminateResponse": {
-            "type": "object",
-            "properties": {
-                "jobID": {
-                    "type": "string"
-                }
-            }
-        },
-        "healVnfDataRequest": {
-            "type": "object",
-            "properties": {
-                "vnfInstanceId": {
-                    "type": "string"
-                },
-                "cause": {
-                    "type": "string"
-                },
-                "additionalParams": {
-                    "type": "object",
-                    "properties": {
-                        "action": {
-                            "type": "string"
-                        },
-                        "actionvminfo": {
-                            "type": "object",
-                            "properties": {
-                                "vmid": {
-                                    "type": "string"
-                                },
-                                "vmname": {
-                                    "type": "string"
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        },
-        "healVnfDataResponse": {
-            "type": "object",
-            "properties": {
-                "jobId": {
-                    "type": "string"
-                }
-            }
-        },
-        "TableInfo": {
-            "type": "object",
-            "properties": {
-                "count": {
-                    "type": "string"
-                }
-            }
-        },
-        "NsInfo": {
-            "type": "object",
-            "properties": {
-                "vnfInfoId": {
-                    "type": "string"
-                },
-                "vlInfo": {
-                    "type": "string"
-                },
-                "nsState": {
-                    "type": "string"
-                },
-                "description": {
-                    "type": "string"
-                },
-                "nsName": {
-                    "type": "string"
-                },
-                "nsInstanceId": {
-                    "type": "string"
-                },
-                "nsdId": {
-                    "type": "string"
-                },
-                "vnffgInfo": {
-                    "type": "string"
-                }
-            }
-        }
-    }
-}
\ No newline at end of file
index a18efcc..f2025bf 100644 (file)
@@ -19,7 +19,6 @@ from lcm.ns.views import CreateNSView, NSInstView, TerminateNSView, NSDetailView
 
 urlpatterns = patterns('',
                        url(r'^api/nslcm/v1/ns$', CreateNSView.as_view()),
-                       url(r'^api/nslcm/v1/swagger.json$', SwaggerJsonView.as_view()),
                        url(r'^api/nslcm/v1/ns/(?P<ns_instance_id>[0-9a-zA-Z_-]+)/instantiate$',
                            NSInstView.as_view()),
                        url(r'^api/nslcm/v1/ns/(?P<ns_instance_id>[0-9a-zA-Z_-]+)/terminate$',
index 1cf1371..8f9f732 100644 (file)
@@ -45,7 +45,8 @@ INSTALLED_APPS = [
     'django.contrib.staticfiles',
     'rest_framework',
     'lcm.pub.database',
-    'lcm.samples'
+    'lcm.samples',
+    'lcm.swagger'
 ]
 
 MIDDLEWARE_CLASSES = [
diff --git a/lcm/swagger/__init__.py b/lcm/swagger/__init__.py
new file mode 100644 (file)
index 0000000..49c7b94
--- /dev/null
@@ -0,0 +1,10 @@
+# Copyright 2016-2017 ZTE Corporation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/lcm/swagger/tests.py b/lcm/swagger/tests.py
new file mode 100644 (file)
index 0000000..b877609
--- /dev/null
@@ -0,0 +1,30 @@
+# Copyright 2016-2017 ZTE Corporation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
+import unittest
+import json
+from django.test import Client
+from rest_framework import status
+
+
+class SampleViewTest(unittest.TestCase):
+    def setUp(self):
+        self.client = Client()
+
+    def tearDown(self):
+        pass
+
+    def test_sample(self):
+        response = self.client.get("/api/nslcm/v1/swagger.json")
+        print response
+        self.assertEqual(status.HTTP_200_OK, response.status_code, response.content)
+#        resp_data = json.loads(response.content)
+#        self.assertEqual({"status": "active"}, resp_data)
diff --git a/lcm/swagger/urls.py b/lcm/swagger/urls.py
new file mode 100644 (file)
index 0000000..c3b8ad6
--- /dev/null
@@ -0,0 +1,23 @@
+# Copyright 2016-2017 ZTE Corporation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from django.conf.urls import patterns, url
+from rest_framework.urlpatterns import format_suffix_patterns
+
+from lcm.swagger.views import SwaggerJsonView
+
+urlpatterns = patterns('',
+                       url(r'^api/nslcm/v1/swagger.json$', SwaggerJsonView.as_view())
+                       )
+
+urlpatterns = format_suffix_patterns(urlpatterns)
diff --git a/lcm/swagger/vfc.db.swagger.json b/lcm/swagger/vfc.db.swagger.json
new file mode 100644 (file)
index 0000000..98f7696
--- /dev/null
@@ -0,0 +1,758 @@
+{
+    "swagger": "2.0",
+    "info": {
+        "version": "1.0.0",
+        "title": "ONAP VFC Service Internal Rest API"
+    },
+    "basePath": "/api/nslcm/v1",
+    "paths": {
+        "/ns/vls": {
+            "post": {
+                "tags": [
+                    "vls"
+                ],
+                "summary": "vl create",
+                "description": "",
+                "operationId": "create_vl",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "in": "body",
+                        "name": "body",
+                        "description": "instantiate request param",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/VlPostRequest"
+                        }
+                    }
+                ],
+                "responses": {
+                    "201": {
+                        "description": "",
+                        "schema": {
+                            "$ref": "#/definitions/VlPostResponse"
+                        }
+                    }
+                }
+            }
+        },
+        "/ns/vls/{vlId}": {
+            "get": {
+                "tags": [
+                    "vls"
+                ],
+                "summary": "query the specified vl info",
+                "description": "",
+                "operationId": "query_vl",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "name": "vlId",
+                        "in": "path",
+                        "description": "vl instance id",
+                        "required": true,
+                        "type": "string"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/VlInfo"
+                        }
+                    },
+                    "404": {
+                        "description": "the vl instance id is wrong"
+                    },
+                    "500": {
+                        "description": "the url is invalid"
+                    }
+                }
+            },
+            "delete": {
+                "tags": [
+                    "vls"
+                ],
+                "summary": "delete vl",
+                "description": "",
+                "operationId": "delete_vl",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "required": true,
+                        "type": "string",
+                        "description": "",
+                        "name": "vlId",
+                        "in": "path"
+                    }
+                ],
+                "responses": {
+                    "204": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/DeleteVlResponse"
+                        }
+                    },
+                    "404": {
+                        "description": "the vl instance id is wrong"
+                    },
+                    "500": {
+                        "description": "the url is invalid"
+                    }
+                }
+            }
+        },
+        "/ns/vnfs": {
+            "post": {
+                "tags": [
+                    "vnfs"
+                ],
+                "summary": "vnf create",
+                "description": "",
+                "operationId": "create_vnf",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "in": "body",
+                        "name": "body",
+                        "description": "instantiate request param",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/VnfPostRequest"
+                        }
+                    }
+                ],
+                "responses": {
+                    "201": {
+                        "description": "",
+                        "schema": {
+                            "$ref": "#/definitions/VnfPostResponse"
+                        }
+                    }
+                }
+            }
+        },
+        "/ns/vnfs/{vnfInstId}": {
+            "get": {
+                "tags": [
+                    "vnfs"
+                ],
+                "summary": "query the specified vnf info",
+                "description": "",
+                "operationId": "query_vnf",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "name": "vnfInstId",
+                        "in": "path",
+                        "description": "vnf instance id",
+                        "required": true,
+                        "type": "string"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/VnfInfo"
+                        }
+                    },
+                    "404": {
+                        "description": "the vnf instance id is wrong"
+                    },
+                    "500": {
+                        "description": "the url is invalid"
+                    }
+                }
+            },
+            "delete": {
+                "tags": [
+                    "vnfs"
+                ],
+                "summary": "delete vnf",
+                "description": "",
+                "operationId": "delete_vnf",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "required": true,
+                        "type": "string",
+                        "description": "",
+                        "name": "vnfInstId",
+                        "in": "path"
+                    }
+                ],
+                "responses": {
+                    "204": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/DeleteResponse"
+                        }
+                    },
+                    "404": {
+                        "description": "the vl instance id is wrong"
+                    },
+                    "500": {
+                        "description": "the url is invalid"
+                    }
+                }
+            }
+        },
+        "/ns/sfcs": {
+            "post": {
+                "tags": [
+                    "sfcs"
+                ],
+                "summary": "sfc create",
+                "description": "",
+                "operationId": "create_sfc",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "in": "body",
+                        "name": "body",
+                        "description": "request param",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/SfcPostRequest"
+                        }
+                    }
+                ],
+                "responses": {
+                    "201": {
+                        "description": "",
+                        "schema": {
+                            "$ref": "#/definitions/SfcPostResponse"
+                        }
+                    }
+                }
+            }
+        },
+        "/ns/sfcs/{sfcInstId}": {
+            "get": {
+                "tags": [
+                    "sfcs"
+                ],
+                "summary": "query the specified sfc info",
+                "description": "",
+                "operationId": "query_sfc",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "name": "sfcInstId",
+                        "in": "path",
+                        "description": "sfc instance id",
+                        "required": true,
+                        "type": "string"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/SfcInfo"
+                        }
+                    },
+                    "404": {
+                        "description": "the sfc instance id is wrong"
+                    },
+                    "500": {
+                        "description": "the url is invalid"
+                    }
+                }
+            },
+            "delete": {
+                "tags": [
+                    "vnfs"
+                ],
+                "summary": "delete sfc",
+                "description": "",
+                "operationId": "delete_sfc",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "required": true,
+                        "type": "string",
+                        "description": "",
+                        "name": "sfcInstId",
+                        "in": "path"
+                    }
+                ],
+                "responses": {
+                    "204": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/DeleteResponse"
+                        }
+                    },
+                    "404": {
+                        "description": "the sfc instance id is wrong"
+                    },
+                    "500": {
+                        "description": "the url is invalid"
+                    }
+                }
+            }
+        },
+        "/ns/{nsInstanceId}/postdeal": {
+            "post": {
+                "tags": [
+                    "postdeal"
+                ],
+                "summary": "ns postdeal",
+                "description": "",
+                "operationId": "ns_postdeal",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "required": true,
+                        "type": "string",
+                        "description": "",
+                        "name": "nsInstanceId",
+                        "in": "path"
+                    },
+                    {
+                        "in": "body",
+                        "name": "body",
+                        "description": "request param",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/NSInstPostDetailRequest"
+                        }
+                    }
+                ],
+                "responses": {
+                    "202": {
+                        "description": ""
+                    }
+                }
+            }
+        },
+        "/mandb/{modelName}": {
+            "get": {
+                "tags": [
+                    "db"
+                ],
+                "summary": "query ns table info",
+                "description": "query ns table info",
+                "operationId": "query_ns_table",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "required": true,
+                        "type": "string",
+                        "description": "model Name.",
+                        "name": "modelName",
+                        "in": "path"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/TableInfo"
+                        }
+                    },
+                    "500": {
+                        "description": "the url is invalid"
+                    }
+                }
+            },
+            "delete": {
+                "tags": [
+                    "db"
+                ],
+                "summary": "ns table delete",
+                "description": "ns table delete",
+                "operationId": "ns_table_delete",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "required": true,
+                        "type": "string",
+                        "description": "model Name.",
+                        "name": "modelName",
+                        "in": "path"
+                    }
+                ],
+                "responses": {
+                    "204": {
+                        "description": "The tables were deleted successfully."
+                    }
+                }
+            }
+        }
+    },
+    "definitions": {
+        "VlPostRequest": {
+            "type": "object",
+            "properties": {
+                "jobId": {
+                    "type": "string"
+                },
+                "nsInstanceId": {
+                    "type": "string"
+                },
+                "flavourId": {
+                    "type": "string"
+                },
+                "sapData": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "pnfInfo": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "vnfInstanceData": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "nestedNsInstanceId": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "locationConstraints": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "additionalParamForNs": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "additionalParamForVnf": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "extNSVirtualLink": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "context": {
+                    "type": "string"
+                },
+                "vlIndex": {
+                    "type": "string"
+                }
+            }
+        },
+        "VlPostResponse": {
+            "type": "object",
+            "properties": {
+                "result": {
+                    "type": "integer",
+                    "enum": [
+                        0,
+                        1
+                    ]
+                },
+                "detail": {
+                    "type": "string"
+                },
+                "vlId": {
+                    "type": "string"
+                }
+            }
+        },
+        "VnfPostRequest": {
+            "type": "object",
+            "properties": {
+                "jobId": {
+                    "type": "string"
+                },
+                "nsInstanceId": {
+                    "type": "string"
+                },
+                "flavourId": {
+                    "type": "string"
+                },
+                "sapData": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "pnfInfo": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "vnfInstanceData": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "nestedNsInstanceId": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "locationConstraints": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "additionalParamForNs": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "additionalParamForVnf": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "extNSVirtualLink": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "context": {
+                    "type": "string"
+                },
+                "vnfIndex": {
+                    "type": "string"
+                }
+            }
+        },
+        "VnfPostResponse": {
+            "type": "object",
+            "properties": {
+                "vnfInstId": {
+                    "type": "string"
+                },
+                "jobId": {
+                    "type": "string"
+                }
+            }
+        },
+        "SfcPostRequest": {
+            "type": "object",
+            "properties": {
+                "jobId": {
+                    "type": "string"
+                },
+                "nsInstanceId": {
+                    "type": "string"
+                },
+                "sapData": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "vnfInstanceData": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "additionalParamForNs": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "additionalParamForVnf": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "sdnControllerId": {
+                    "type": "string"
+                },
+                "context": {
+                    "type": "string"
+                },
+                "fpindex": {
+                    "type": "string"
+                }
+            }
+        },
+        "NSInstPostDetailRequest": {
+            "type": "object",
+            "properties": {
+                "status": {
+                    "type": "string"
+                }
+            }
+        },
+
+        "SfcPostResponse": {
+            "type": "object",
+            "properties": {
+                "sfcInstId": {
+                    "type": "string"
+                },
+                "jobId": {
+                    "type": "string"
+                }
+            }
+        },
+        "VlInfo": {
+            "type": "object",
+            "properties": {
+                "vlId": {
+                    "type": "string"
+                },
+                "vlName": {
+                    "type": "string"
+                },
+                "vlStatus": {
+                    "type": "string"
+                }
+            }
+        },
+        "VnfInfo": {
+            "type": "object",
+            "properties": {
+                "vnfInstId": {
+                    "type": "string"
+                },
+                "vnfName": {
+                    "type": "string"
+                },
+                "vnfStatus": {
+                    "type": "string"
+                }
+            }
+        },
+        "SfcInfo": {
+            "type": "object",
+            "properties": {
+                "sfcInstId": {
+                    "type": "string"
+                },
+                "sfcName": {
+                    "type": "string"
+                },
+                "sfcStatus": {
+                    "type": "string"
+                }
+            }
+        },
+        "DeleteVlResponse": {
+            "type": "object",
+            "properties": {
+                "result": {
+                    "type": "integer",
+                    "enum": [
+                        0,
+                        1
+                    ]
+                },
+                "detail": {
+                    "type": "string"
+                }
+            }
+        },
+        "DeleteResponse": {
+            "type": "object",
+            "properties": {
+                "result": {
+                    "type": "integer",
+                    "enum": [
+                        0,
+                        1
+                    ]
+                },
+                "detail": {
+                    "type": "string"
+                }
+            }
+        },
+
+        "TableInfo": {
+            "type": "object",
+            "properties": {
+                "count": {
+                    "type": "string"
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/lcm/swagger/vfc.nslcm.swagger.json b/lcm/swagger/vfc.nslcm.swagger.json
new file mode 100644 (file)
index 0000000..75cc6ba
--- /dev/null
@@ -0,0 +1,537 @@
+{\r
+  "swagger": "2.0",\r
+  "info": {\r
+    "version": "1.0.0",\r
+    "title": "ONAP VFC Network Service Lifecycle Management API",\r
+    "description": "VFC Network Service Lifecycle Management Rest API.",\r
+    "contact": {\r
+      "name": "ONAP VFC team",\r
+      "email": "onap-discuss@lists.onap.org",\r
+      "url": "https://gerrit.onap.org/r/#/admin/projects/vfc/nfvo/lcm"\r
+    }\r
+  },\r
+  "basePath": "/api/nslcm/v1",\r
+  "schemes": [\r
+    "http",\r
+    "https"\r
+  ],\r
+  "consumes": [\r
+    "application/json"\r
+  ],\r
+  "produces": [\r
+    "application/json"\r
+  ],\r
+  "paths": {\r
+    "/ns": {\r
+      "post": {\r
+        "tags": [\r
+          "ns"\r
+        ],\r
+        "summary": "ns create",\r
+        "description": "ns create",\r
+        "operationId": "ns_create",\r
+        "parameters": [\r
+          {\r
+            "in": "body",\r
+            "name": "NSCreateRequest",\r
+            "description": "NS Instance Create Request",\r
+            "required": true,\r
+            "schema": {\r
+              "$ref": "#/definitions/NsCreateRequest"\r
+            }\r
+          }\r
+        ],\r
+        "responses": {\r
+          "200": {\r
+            "description": "successful operation",\r
+            "schema": {\r
+              "$ref": "#/definitions/NsCreateResponse"\r
+            }\r
+          }\r
+        }\r
+      },\r
+      "get": {\r
+        "tags": [\r
+          "ns"\r
+        ],\r
+        "summary": "ns get",\r
+        "description": "ns get",\r
+        "operationId": "ns_get",\r
+        "parameters": [],\r
+        "responses": {\r
+          "200": {\r
+            "description": "successful operation",\r
+            "schema": {\r
+              "$ref": "#/definitions/NsInfo"\r
+            }\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/ns/{nsInstanceId}/Instantiate": {\r
+      "post": {\r
+        "tags": [\r
+          "ns"\r
+        ],\r
+        "summary": "ns Instantiate",\r
+        "description": "ns Instantiate",\r
+        "operationId": "ns_Instantiate",\r
+        "parameters": [\r
+          {\r
+            "required": true,\r
+            "type": "string",\r
+            "description": "",\r
+            "name": "nsInstanceId",\r
+            "in": "path"\r
+          },\r
+          {\r
+            "in": "body",\r
+            "name": "NSInstantiateRequest",\r
+            "description": "NS Instantiate Request Body",\r
+            "required": true,\r
+            "schema": {\r
+              "$ref": "#/definitions/NsInstantiateRequest"\r
+            }\r
+          }\r
+        ],\r
+        "responses": {\r
+          "200": {\r
+            "description": "",\r
+            "schema": {\r
+              "$ref": "#/definitions/JobInfo"\r
+            }\r
+          },\r
+          "201": {\r
+            "description": "Invalid Request"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/ns/{nsInstanceId}/scale": {\r
+      "post": {\r
+        "tags": [\r
+          "ns"\r
+        ],\r
+        "summary": "ns scale",\r
+        "description": "ns scale",\r
+        "operationId": "ns_scale",\r
+        "parameters": [\r
+          {\r
+            "required": true,\r
+            "type": "string",\r
+            "description": "",\r
+            "name": "nsInstanceId",\r
+            "in": "path"\r
+          },\r
+          {\r
+            "in": "body",\r
+            "name": "ScaleNSRequest",\r
+            "description": "Scale NS Request Body",\r
+            "required": true,\r
+            "schema": {\r
+              "$ref": "#/definitions/NsScaleRequest"\r
+            }\r
+          }\r
+        ],\r
+        "responses": {\r
+          "200": {\r
+            "description": "",\r
+            "schema": {\r
+              "$ref": "#/definitions/JobInfo"\r
+            }\r
+          },\r
+          "201": {\r
+            "description": "Invalid Request"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/ns/{ns_instance_id}/heal": {\r
+      "post": {\r
+        "tags": [\r
+          "ns"\r
+        ],\r
+        "summary": "ns heal",\r
+        "description": "ns heal",\r
+        "operationId": "ns_heal",\r
+        "parameters": [\r
+          {\r
+            "required": true,\r
+            "type": "string",\r
+            "description": "Identifier of the NS instance.",\r
+            "name": "ns_instance_id",\r
+            "in": "path"\r
+          },\r
+          {\r
+            "in": "body",\r
+            "name": "healVnfData",\r
+            "description": "healVnfData",\r
+            "required": true,\r
+            "schema": {\r
+              "$ref": "#/definitions/NsHealRequest"\r
+            }\r
+          }\r
+        ],\r
+        "responses": {\r
+          "202": {\r
+            "description": "",\r
+            "schema": {\r
+              "$ref": "#/definitions/JobInfo"\r
+            }\r
+          },\r
+          "500": {\r
+            "description": "the url is invalid"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/ns/{ns_instance_id}/terminate": {\r
+      "post": {\r
+        "tags": [\r
+          "ns"\r
+        ],\r
+        "summary": "ns terminate",\r
+        "description": "ns terminate",\r
+        "operationId": "ns_terminate",\r
+        "parameters": [\r
+          {\r
+            "required": true,\r
+            "type": "string",\r
+            "description": "Identifier of the NS instance.",\r
+            "name": "ns_instance_id",\r
+            "in": "path"\r
+          },\r
+          {\r
+            "in": "body",\r
+            "name": "NsTerminateRequest",\r
+            "description": "NsTerminateRequest",\r
+            "required": true,\r
+            "schema": {\r
+              "$ref": "#/definitions/NsTerminateRequest"\r
+            }\r
+          }\r
+        ],\r
+        "responses": {\r
+          "202": {\r
+            "description": "",\r
+            "schema": {\r
+              "$ref": "#/definitions/JobInfo"\r
+            }\r
+          },\r
+          "500": {\r
+            "description": "the url is invalid"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/ns/{ns_instance_id}": {\r
+      "delete": {\r
+        "tags": [\r
+          "ns"\r
+        ],\r
+        "summary": "ns delete",\r
+        "description": "ns delete",\r
+        "operationId": "ns_delete",\r
+        "parameters": [\r
+          {\r
+            "required": true,\r
+            "type": "string",\r
+            "description": "Identifier of the NS instance.",\r
+            "name": "ns_instance_id",\r
+            "in": "path"\r
+          }\r
+        ],\r
+        "responses": {\r
+          "204": {\r
+            "description": "The NS instance resource and the associated NS identifier were deleted successfully."\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/jobs/{jobId}": {\r
+      "post": {\r
+        "tags": [\r
+          "job"\r
+        ],\r
+        "summary": "jobstatus",\r
+        "description": "",\r
+        "operationId": "jobstatus",\r
+        "parameters": [\r
+          {\r
+            "required": true,\r
+            "type": "string",\r
+            "description": "",\r
+            "name": "jobId",\r
+            "in": "path"\r
+          },\r
+          {\r
+            "in": "body",\r
+            "name": "body",\r
+            "description": "request param",\r
+            "required": true,\r
+            "schema": {\r
+              "$ref": "#/definitions/JobProgressRequest"\r
+            }\r
+          }\r
+        ],\r
+        "responses": {\r
+          "202": {\r
+            "description": ""\r
+          }\r
+        }\r
+      }\r
+    }\r
+  },\r
+  "definitions": {\r
+    "NsCreateRequest": {\r
+      "type": "object",\r
+      "properties": {\r
+        "csarId": {\r
+          "type": "string",\r
+          "description": "the NS package ID"\r
+        },\r
+        "nsName": {\r
+          "type": "string"\r
+        },\r
+        "description": {\r
+          "type": "string"\r
+        }\r
+      }\r
+    },\r
+    "NsCreateResponse": {\r
+      "type": "object",\r
+      "properties": {\r
+        "nsInstanceId": {\r
+          "type": "string"\r
+        }\r
+      }\r
+    },\r
+    "NsInstantiateRequest": {\r
+      "type": "object",\r
+      "properties": {\r
+        "LocationConstraints": {\r
+          "type": "array",\r
+          "items": {\r
+            "$ref": "#/definitions/LocationConstraint"\r
+          }\r
+        },\r
+        "additionalParamForNs": {\r
+          "type": "string"\r
+        }\r
+      }\r
+    },\r
+    "LocationConstraint": {\r
+      "type": "object",\r
+      "properties": {\r
+        "vnfProfileId": {\r
+          "type": "string"\r
+        },\r
+        "locationConstraints": {\r
+          "type": "object",\r
+          "properties": {\r
+            "vimid": {\r
+              "type": "string"\r
+            }\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "NsScaleRequest": {\r
+      "type": "object",\r
+      "properties": {\r
+        "scaleType": {\r
+          "type": "string"\r
+        },\r
+        "scaleNsByStepsData": {\r
+          "$ref": "#/definitions/NsScaleByStepsData"\r
+        }\r
+      }\r
+    },\r
+    "NsScaleByStepsData": {\r
+      "type": "object",\r
+      "properties": {\r
+        "scalingDirection": {\r
+          "type": "string"\r
+        },\r
+        "aspectId": {\r
+          "type": "string"\r
+        },\r
+        "numberOfSteps": {\r
+          "type": "integer"\r
+        }\r
+      }\r
+    },\r
+    "NsHealRequest": {\r
+      "type": "object",\r
+      "properties": {\r
+        "vnfInstanceId": {\r
+          "type": "string"\r
+        },\r
+        "cause": {\r
+          "type": "string"\r
+        },\r
+        "additionalParams": {\r
+          "type": "object",\r
+          "properties": {\r
+            "action": {\r
+              "type": "string"\r
+            },\r
+            "actionvminfo": {\r
+              "type": "object",\r
+              "properties": {\r
+                "vmid": {\r
+                  "type": "string"\r
+                },\r
+                "vmname": {\r
+                  "type": "string"\r
+                }\r
+              }\r
+            }\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "NsTerminateRequest": {\r
+      "type": "object",\r
+      "properties": {\r
+        "terminationType": {\r
+          "type": "string"\r
+        },\r
+        "gracefulTerminationTimeout": {\r
+          "type": "string"\r
+        }\r
+      }\r
+    },\r
+    "JobInfo": {\r
+      "type": "object",\r
+      "properties": {\r
+        "jobId": {\r
+          "type": "string"\r
+        }\r
+      }\r
+    },\r
+    "JobProgressRequest": {\r
+      "type": "object",\r
+      "properties": {\r
+        "progress": {\r
+          "type": "string"\r
+        },\r
+        "desc": {\r
+          "type": "string"\r
+        },\r
+        "errcode": {\r
+          "type": "string"\r
+        }\r
+      }\r
+    },\r
+    "NsInfo": {\r
+      "type": "object",\r
+      "properties": {\r
+        "nsInstanceId": {\r
+          "type": "string"\r
+        },\r
+        "nsName": {\r
+          "type": "string"\r
+        },\r
+        "description": {\r
+          "type": "string"\r
+        },\r
+        "nsdId": {\r
+          "type": "string"\r
+        },\r
+        "vnfInfo": {\r
+          "type": "array",\r
+          "items": {\r
+            "$ref": "#/definitions/vnfInfo"\r
+          }\r
+        },\r
+        "vlInfo": {\r
+          "type": "array",\r
+          "items": {\r
+            "$ref": "#/definitions/vlInfo"\r
+          }\r
+        },\r
+        "vnffgInfo": {\r
+          "type": "array",\r
+          "items": {\r
+            "$ref": "#/definitions/vnffgInfo"\r
+          }\r
+        },\r
+        "nsState": {\r
+          "type": "string"\r
+        }\r
+      }\r
+    },\r
+    "vnfInfo": {\r
+      "type": "object",\r
+      "properties": {\r
+        "vnfInstanceId": {\r
+          "type": "string"\r
+        },\r
+        "vnfInstanceName": {\r
+          "type": "string"\r
+        },\r
+        "vnfdId": {\r
+          "type": "string"\r
+        }\r
+      }\r
+    },\r
+    "vlInfo": {\r
+      "type": "object",\r
+      "properties": {\r
+        "vlInstanceId": {\r
+          "type": "string"\r
+        },\r
+        "vlInstanceName": {\r
+          "type": "string"\r
+        },\r
+        "vldId": {\r
+          "type": "string"\r
+        },\r
+        "relatedCpInstanceId": {\r
+          "type": "array",\r
+          "items": {\r
+            "$ref": "#/definitions/cpInfo"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "cpInfo": {\r
+      "type": "object",\r
+      "properties": {\r
+        "cpInstanceId": {\r
+          "type": "string"\r
+        },\r
+        "cpInstanceName": {\r
+          "type": "string"\r
+        },\r
+        "cpdId": {\r
+          "type": "string"\r
+        }\r
+      }\r
+    },\r
+    "vnffgInfo": {\r
+      "type": "object",\r
+      "properties": {\r
+        "vnffgInstanceId": {\r
+          "type": "string"\r
+        },\r
+        "vnfId": {\r
+          "type": "string"\r
+        },\r
+        "pnfId": {\r
+          "type": "string"\r
+        },\r
+        "virtualLinkId": {\r
+          "type": "string"\r
+        },\r
+        "cpId": {\r
+          "type": "string"\r
+        },\r
+        "nfp": {\r
+          "type": "string"\r
+        }\r
+      }\r
+    }\r
+  }\r
+}
\ No newline at end of file
diff --git a/lcm/swagger/vfc.others.swagger.json b/lcm/swagger/vfc.others.swagger.json
new file mode 100644 (file)
index 0000000..9be7490
--- /dev/null
@@ -0,0 +1,135 @@
+{
+    "swagger": "2.0",
+    "info": {
+        "version": "1.0.0",
+        "title": "ONAP VFC Service Internal Rest API"
+    },
+    "basePath": "/api/nslcm/v1",
+    "paths": {
+        "/ns/{nsInstanceId}/postdeal": {
+            "post": {
+                "tags": [
+                    "postdeal"
+                ],
+                "summary": "ns postdeal",
+                "description": "",
+                "operationId": "ns_postdeal",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "required": true,
+                        "type": "string",
+                        "description": "",
+                        "name": "nsInstanceId",
+                        "in": "path"
+                    },
+                    {
+                        "in": "body",
+                        "name": "body",
+                        "description": "request param",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/NSInstPostDetailRequest"
+                        }
+                    }
+                ],
+                "responses": {
+                    "202": {
+                        "description": ""
+                    }
+                }
+            }
+        },
+        "/mandb/{modelName}": {
+            "get": {
+                "tags": [
+                    "db"
+                ],
+                "summary": "query ns table info",
+                "description": "query ns table info",
+                "operationId": "query_ns_table",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "required": true,
+                        "type": "string",
+                        "description": "model Name.",
+                        "name": "modelName",
+                        "in": "path"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/TableInfo"
+                        }
+                    },
+                    "500": {
+                        "description": "the url is invalid"
+                    }
+                }
+            },
+            "delete": {
+                "tags": [
+                    "db"
+                ],
+                "summary": "ns table delete",
+                "description": "ns table delete",
+                "operationId": "ns_table_delete",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "required": true,
+                        "type": "string",
+                        "description": "model Name.",
+                        "name": "modelName",
+                        "in": "path"
+                    }
+                ],
+                "responses": {
+                    "204": {
+                        "description": "The tables were deleted successfully."
+                    }
+                }
+            }
+        }
+    },
+    "definitions": {
+
+        "NSInstPostDetailRequest": {
+            "type": "object",
+            "properties": {
+                "status": {
+                    "type": "string"
+                }
+            }
+        },
+
+
+        "TableInfo": {
+            "type": "object",
+            "properties": {
+                "count": {
+                    "type": "string"
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/lcm/swagger/vfc.sfclcm.swagger.json b/lcm/swagger/vfc.sfclcm.swagger.json
new file mode 100644 (file)
index 0000000..af06543
--- /dev/null
@@ -0,0 +1,237 @@
+{
+    "swagger": "2.0",
+    "info": {
+        "version": "1.0.0",
+        "title": "ONAP VFC Service SFC Rest API"
+    },
+    "basePath": "/api/nslcm/v1",
+    "paths": {
+        "/ns/sfcs": {
+            "post": {
+                "tags": [
+                    "sfc"
+                ],
+                "summary": "sfc create",
+                "description": "",
+                "operationId": "create_sfc",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "in": "body",
+                        "name": "body",
+                        "description": "request param",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/SfcPostRequest"
+                        }
+                    }
+                ],
+                "responses": {
+                    "201": {
+                        "description": "",
+                        "schema": {
+                            "$ref": "#/definitions/SfcPostResponse"
+                        }
+                    }
+                }
+            }
+        },
+        "/ns/sfcs/{sfcInstId}": {
+            "get": {
+                "tags": [
+                    "sfc"
+                ],
+                "summary": "query the specified sfc info",
+                "description": "",
+                "operationId": "query_sfc",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "name": "sfcInstId",
+                        "in": "path",
+                        "description": "sfc instance id",
+                        "required": true,
+                        "type": "string"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/SfcInfo"
+                        }
+                    },
+                    "404": {
+                        "description": "the sfc instance id is wrong"
+                    },
+                    "500": {
+                        "description": "the url is invalid"
+                    }
+                }
+            },
+            "delete": {
+                "tags": [
+                    "sfc"
+                ],
+                "summary": "delete sfc",
+                "description": "",
+                "operationId": "delete_sfc",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "required": true,
+                        "type": "string",
+                        "description": "",
+                        "name": "sfcInstId",
+                        "in": "path"
+                    }
+                ],
+                "responses": {
+                    "204": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/DeleteResponse"
+                        }
+                    },
+                    "404": {
+                        "description": "the sfc instance id is wrong"
+                    },
+                    "500": {
+                        "description": "the url is invalid"
+                    }
+                }
+            }
+        }
+    },
+    "definitions": {
+        
+        "SfcPostRequest": {
+            "type": "object",
+            "properties": {
+                "jobId": {
+                    "type": "string"
+                },
+                "nsInstanceId": {
+                    "type": "string"
+                },
+                "sapData": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "vnfInstanceData": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "additionalParamForNs": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "additionalParamForVnf": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "sdnControllerId": {
+                    "type": "string"
+                },
+                "context": {
+                    "type": "string"
+                },
+                "fpindex": {
+                    "type": "string"
+                }
+            }
+        },
+        "SfcPostResponse": {
+            "type": "object",
+            "properties": {
+                "sfcInstId": {
+                    "type": "string"
+                },
+                "jobId": {
+                    "type": "string"
+                }
+            }
+        },
+        "VlInfo": {
+            "type": "object",
+            "properties": {
+                "vlId": {
+                    "type": "string"
+                },
+                "vlName": {
+                    "type": "string"
+                },
+                "vlStatus": {
+                    "type": "string"
+                }
+            }
+        },
+        "VnfInfo": {
+            "type": "object",
+            "properties": {
+                "vnfInstId": {
+                    "type": "string"
+                },
+                "vnfName": {
+                    "type": "string"
+                },
+                "vnfStatus": {
+                    "type": "string"
+                }
+            }
+        },
+        
+        "DeleteResponse": {
+            "type": "object",
+            "properties": {
+                "result": {
+                    "type": "integer",
+                    "enum": [
+                        0,
+                        1
+                    ]
+                },
+                "detail": {
+                    "type": "string"
+                }
+            }
+        },        
+        "SfcInfo": {
+            "type": "object",
+            "properties": {
+                "sfcInstId": {
+                    "type": "string"
+                },
+                "sfcName": {
+                    "type": "string"
+                },
+                "sfcStatus": {
+                    "type": "string"
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/lcm/swagger/vfc.vllcm.swagger.json b/lcm/swagger/vfc.vllcm.swagger.json
new file mode 100644 (file)
index 0000000..1b5241a
--- /dev/null
@@ -0,0 +1,238 @@
+{
+    "swagger": "2.0",
+    "info": {
+        "version": "1.0.0",
+        "title": "ONAP VFC Service Internal Rest API"
+    },
+    "basePath": "/api/nslcm/v1",
+    "paths": {
+        "/ns/vls": {
+            "post": {
+                "tags": [
+                    "vl"
+                ],
+                "summary": "vl create",
+                "description": "",
+                "operationId": "create_vl",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "in": "body",
+                        "name": "body",
+                        "description": "instantiate request param",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/VlPostRequest"
+                        }
+                    }
+                ],
+                "responses": {
+                    "201": {
+                        "description": "",
+                        "schema": {
+                            "$ref": "#/definitions/VlPostResponse"
+                        }
+                    }
+                }
+            }
+        },
+        "/ns/vls/{vlId}": {
+            "get": {
+                "tags": [
+                    "vl"
+                ],
+                "summary": "query the specified vl info",
+                "description": "",
+                "operationId": "query_vl",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "name": "vlId",
+                        "in": "path",
+                        "description": "vl instance id",
+                        "required": true,
+                        "type": "string"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/VlInfo"
+                        }
+                    },
+                    "404": {
+                        "description": "the vl instance id is wrong"
+                    },
+                    "500": {
+                        "description": "the url is invalid"
+                    }
+                }
+            },
+            "delete": {
+                "tags": [
+                    "vl"
+                ],
+                "summary": "delete vl",
+                "description": "",
+                "operationId": "delete_vl",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "required": true,
+                        "type": "string",
+                        "description": "",
+                        "name": "vlId",
+                        "in": "path"
+                    }
+                ],
+                "responses": {
+                    "204": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/DeleteVlResponse"
+                        }
+                    },
+                    "404": {
+                        "description": "the vl instance id is wrong"
+                    },
+                    "500": {
+                        "description": "the url is invalid"
+                    }
+                }
+            }
+        }
+    },
+    "definitions": {
+        "VlPostRequest": {
+            "type": "object",
+            "properties": {
+                "jobId": {
+                    "type": "string"
+                },
+                "nsInstanceId": {
+                    "type": "string"
+                },
+                "flavourId": {
+                    "type": "string"
+                },
+                "sapData": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "pnfInfo": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "vnfInstanceData": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "nestedNsInstanceId": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "locationConstraints": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "additionalParamForNs": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "additionalParamForVnf": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "extNSVirtualLink": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "context": {
+                    "type": "string"
+                },
+                "vlIndex": {
+                    "type": "string"
+                }
+            }
+        },
+        "VlPostResponse": {
+            "type": "object",
+            "properties": {
+                "result": {
+                    "type": "integer",
+                    "enum": [
+                        0,
+                        1
+                    ]
+                },
+                "detail": {
+                    "type": "string"
+                },
+                "vlId": {
+                    "type": "string"
+                }
+            }
+        },
+        "VlInfo": {
+            "type": "object",
+            "properties": {
+                "vlId": {
+                    "type": "string"
+                },
+                "vlName": {
+                    "type": "string"
+                },
+                "vlStatus": {
+                    "type": "string"
+                }
+            }
+        },
+        "DeleteVlResponse": {
+            "type": "object",
+            "properties": {
+                "result": {
+                    "type": "integer",
+                    "enum": [
+                        0,
+                        1
+                    ]
+                },
+                "detail": {
+                    "type": "string"
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/lcm/swagger/vfc.vnflcm.swagger.json b/lcm/swagger/vfc.vnflcm.swagger.json
new file mode 100644 (file)
index 0000000..3fbcb60
--- /dev/null
@@ -0,0 +1,232 @@
+{
+    "swagger": "2.0",
+    "info": {
+        "version": "1.0.0",
+        "title": "ONAP VFC Service Internal Rest API"
+    },
+    "basePath": "/api/nslcm/v1",
+    "paths": {
+        "/ns/vnfs": {
+            "post": {
+                "tags": [
+                    "vnf"
+                ],
+                "summary": "vnf create",
+                "description": "",
+                "operationId": "create_vnf",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "in": "body",
+                        "name": "body",
+                        "description": "instantiate request param",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/VnfPostRequest"
+                        }
+                    }
+                ],
+                "responses": {
+                    "201": {
+                        "description": "",
+                        "schema": {
+                            "$ref": "#/definitions/VnfPostResponse"
+                        }
+                    }
+                }
+            }
+        },
+        "/ns/vnfs/{vnfInstId}": {
+            "get": {
+                "tags": [
+                    "vnf"
+                ],
+                "summary": "query the specified vnf info",
+                "description": "",
+                "operationId": "query_vnf",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "name": "vnfInstId",
+                        "in": "path",
+                        "description": "vnf instance id",
+                        "required": true,
+                        "type": "string"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/VnfInfo"
+                        }
+                    },
+                    "404": {
+                        "description": "the vnf instance id is wrong"
+                    },
+                    "500": {
+                        "description": "the url is invalid"
+                    }
+                }
+            },
+            "delete": {
+                "tags": [
+                    "vnf"
+                ],
+                "summary": "delete vnf",
+                "description": "",
+                "operationId": "delete_vnf",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "parameters": [
+                    {
+                        "required": true,
+                        "type": "string",
+                        "description": "",
+                        "name": "vnfInstId",
+                        "in": "path"
+                    }
+                ],
+                "responses": {
+                    "204": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/DeleteResponse"
+                        }
+                    },
+                    "404": {
+                        "description": "the vl instance id is wrong"
+                    },
+                    "500": {
+                        "description": "the url is invalid"
+                    }
+                }
+            }
+        }
+    },
+    "definitions": {
+        "VnfPostRequest": {
+            "type": "object",
+            "properties": {
+                "jobId": {
+                    "type": "string"
+                },
+                "nsInstanceId": {
+                    "type": "string"
+                },
+                "flavourId": {
+                    "type": "string"
+                },
+                "sapData": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "pnfInfo": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "vnfInstanceData": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "nestedNsInstanceId": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "locationConstraints": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "additionalParamForNs": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "additionalParamForVnf": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "extNSVirtualLink": {
+                    "type": "array",
+                    "items": {
+                        "type": "object"
+                    }
+                },
+                "context": {
+                    "type": "string"
+                },
+                "vnfIndex": {
+                    "type": "string"
+                }
+            }
+        },
+        "VnfPostResponse": {
+            "type": "object",
+            "properties": {
+                "vnfInstId": {
+                    "type": "string"
+                },
+                "jobId": {
+                    "type": "string"
+                }
+            }
+        },
+
+        "VnfInfo": {
+            "type": "object",
+            "properties": {
+                "vnfInstId": {
+                    "type": "string"
+                },
+                "vnfName": {
+                    "type": "string"
+                },
+                "vnfStatus": {
+                    "type": "string"
+                }
+            }
+        },
+        "DeleteResponse": {
+            "type": "object",
+            "properties": {
+                "result": {
+                    "type": "integer",
+                    "enum": [
+                        0,
+                        1
+                    ]
+                },
+                "detail": {
+                    "type": "string"
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/lcm/swagger/views.py b/lcm/swagger/views.py
new file mode 100644 (file)
index 0000000..8386bf0
--- /dev/null
@@ -0,0 +1,73 @@
+# Copyright 2016-2017 ZTE Corporation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import json
+import logging
+import os
+import traceback
+
+from rest_framework import status
+from rest_framework.response import Response
+from rest_framework.views import APIView
+
+
+logger = logging.getLogger(__name__)
+
+
+class SwaggerJsonView(APIView):
+
+    def get(self, request):
+
+        json_file = os.path.join(os.path.dirname(__file__), 'vfc.nslcm.swagger.json')
+        f = open(json_file)
+        json_data = json.JSONDecoder().decode(f.read())
+        f.close()
+
+        json_file = os.path.join(os.path.dirname(__file__), 'vfc.vnflcm.swagger.json')
+        f = open(json_file)
+        json_data_temp = json.JSONDecoder().decode(f.read())
+        f.close()
+
+        json_data["paths"].update(json_data_temp["paths"])
+        json_data["definitions"].update(json_data_temp["definitions"])
+
+        json_file = os.path.join(os.path.dirname(__file__), 'vfc.vllcm.swagger.json')
+        f = open(json_file)
+        json_data_temp = json.JSONDecoder().decode(f.read())
+        f.close()
+
+        json_data["paths"].update(json_data_temp["paths"])
+        json_data["definitions"].update(json_data_temp["definitions"])
+
+
+        json_file = os.path.join(os.path.dirname(__file__), 'vfc.sfclcm.swagger.json')
+        f = open(json_file)
+        json_data_temp = json.JSONDecoder().decode(f.read())
+        f.close()
+
+        json_data["paths"].update(json_data_temp["paths"])
+        json_data["definitions"].update(json_data_temp["definitions"])
+
+
+        json_file = os.path.join(os.path.dirname(__file__), 'vfc.others.swagger.json')
+        f = open(json_file)
+        json_data_temp = json.JSONDecoder().decode(f.read())
+        f.close()
+
+        json_data["paths"].update(json_data_temp["paths"])
+        json_data["definitions"].update(json_data_temp["definitions"])
+
+        return Response(json_data)
+
+    
+
index b033351..5e64726 100644 (file)
@@ -25,6 +25,7 @@ urlpatterns = [
     url(r'^', include('lcm.ns.urls')),
     url(r'^', include('lcm.jobs.urls')),
     url(r'^', include('lcm.workflows.urls')),
+    url(r'^', include('lcm.swagger.urls')),
 ]
 
 # regist to MSB when startup