-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from linkernetworks/alex/apiDocument
Create API.md Former-commit-id: b2847958832097ddc50d0c16461da2e18be098a3 [formerly b2847958832097ddc50d0c16461da2e18be098a3 [formerly ea47a74]] Former-commit-id: 6d5f9f524687db2558bd0a93c3a1c24340586866 Former-commit-id: 6c40f00
- Loading branch information
Showing
1 changed file
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
# Vortex API | ||
|
||
## Network | ||
|
||
### Create Network | ||
|
||
**POST /v1/networks** | ||
|
||
Example: | ||
|
||
``` | ||
curl -X POST -H "Content-Type: application/json" \ | ||
-d '{"type":"ovs","name":"awesomeNetworks","nodeName":"vortex-dev","ovs":{"bridgeName":"awesomeBridge", "physicalPorts":[]}}' \ | ||
http://localhost:7890/v1/networks | ||
``` | ||
|
||
Request Data: | ||
|
||
```json | ||
{ | ||
"type": "ovs", | ||
"name": "awesomeNetworks", | ||
"nodeName": "vortex-dev", | ||
"ovs": { | ||
"bridgeName": "awesomeBridge", | ||
"physicalPorts":[] | ||
} | ||
} | ||
``` | ||
|
||
Response Data: | ||
|
||
```json | ||
{ | ||
"error": false, | ||
"message": "Create success" | ||
} | ||
``` | ||
|
||
### List Network | ||
|
||
**GET /v1/networks/** | ||
|
||
Example: | ||
|
||
``` | ||
curl http://localhost:7890/v1/networks/ | ||
``` | ||
|
||
Response Data: | ||
|
||
```json | ||
[{ | ||
"id": "5b3475f94807c5199773910a", | ||
"type": "ovs", | ||
"name": "awesomeNetworks", | ||
"nodeName": "vortex-dev", | ||
"createdAt": "2018-06-28T05:45:29.828Z", | ||
"ovs": { | ||
"bridgeName": "awesomeBridge", | ||
"physicalPorts": [] | ||
}, | ||
"fake": { | ||
"bridgeName": "", | ||
"iWantFail": false | ||
} | ||
}] | ||
``` | ||
|
||
### Get Network | ||
|
||
**GET /v1/networks/[id]** | ||
|
||
Example: | ||
|
||
``` | ||
curl http://localhost:7890/v1/networks/5b3475f94807c5199773910a | ||
``` | ||
|
||
Response Data: | ||
|
||
```json | ||
{ | ||
"id": "5b3475f94807c5199773910a", | ||
"type": "ovs", | ||
"name": "awesomeNetwork", | ||
"nodeName": "vortex-dev", | ||
"createdAt": "2018-06-28T05:45:29.828Z", | ||
"ovs": { | ||
"bridgeName": "awesomeBridge", | ||
"physicalPorts": [] | ||
}, | ||
"fake": { | ||
"bridgeName": "", | ||
"iWantFail": false | ||
} | ||
} | ||
``` | ||
|
||
### Delete Network | ||
|
||
**DELETE /v1/networks/[id]** | ||
|
||
Example: | ||
|
||
``` | ||
curl -X DELETE http://localhost:7890/v1/networks/5b3475f94807c5199773910a | ||
``` | ||
|
||
Response Data: | ||
|
||
```json | ||
{ | ||
"error": false, | ||
"message": "Delete success" | ||
} | ||
``` |