Skip to content

Commit

Permalink
Add Namespace CRUD in API.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sufuf3 committed Aug 13, 2018
1 parent 760aee7 commit 77e6bf7
Showing 1 changed file with 96 additions and 0 deletions.
96 changes: 96 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
- [List Services](#list-services)
- [Get Service](#get-service)
- [Delete Service](#delete-service)
- [Namespace](#namespace)
- [Create Namespace](#create-namespace)
- [List Namespaces](#list-namespaces)
- [Get Namespace](#get-namespace)
- [Delete Namespace](#delete-namespace)



Expand Down Expand Up @@ -1361,3 +1366,94 @@ Response Data:
"message": "Delete success"
}
```

## Namespace
### Create Namespace

**POST /v1/namespaces**

Example:

```
curl -X POST -H "Content-Type: application/json" \
-d '{"name":"awesome"}' \
http://localhost:7890/v1/namespaces
```

Request Data:

```json
{
"name": "awesome",
}
```

Response Data:

```json
{
"error": false,
"message": "Create success"
}
```

### List Namespaces

**GET /v1/namespaces/**

Example:

```
curl http://localhost:7890/v1/namespaces/
```

Response Data:

```json
[
{
"id": "5b4edcbc4807c557d9feb69e",
"name": "awesome",
"createdAt": "2018-07-18T06:22:52.403Z"
}
]
```

### Get Namespace

**GET /v1/namespaces/[id]**

Example:

```
curl http://localhost:7890/v1/namespaces/5b4edcbc4807c557d9feb69e
```

Response Data:

```json
{
"id": "5b4edcbc4807c557d9feb69e",
"name": "awesome",
"createdAt": "2018-07-18T06:22:52.403Z"
}
```

### Delete Namespace

**DELETE /v1/namespaces/[id]**

Example:

```
curl -X DELETE http://localhost:7890/v1/namespaces/5b4edcbc4807c557d9feb69e
```

Response Data:

```json
{
"error": false,
"message": "Delete success"
}
```

0 comments on commit 77e6bf7

Please sign in to comment.