-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 #227 from jojohappy/master
[api] add new api to update partial hosts in grp_host merged. thanks for contribute this 👍
- Loading branch information
Showing
4 changed files
with
171 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
docs/_posts/HostGroup/2017-08-22-hostgroup_update_partial_hosts.md
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,45 @@ | ||
--- | ||
category: HostGroup | ||
apiurl: '/api/v1/hostgroup/#{hostgroup_id}/host' | ||
title: "Update partial hosts in HostGroup" | ||
type: 'PATCH' | ||
sample_doc: 'hostgroup.html' | ||
layout: default | ||
--- | ||
|
||
* [Session](#/authentication) Required | ||
* 如果使用者不是 Admin 只能对创建的 HostGroup 做操作 | ||
* ex. /api/v1/hostgroup/1/host | ||
|
||
### Request | ||
```{ | ||
"hosts": [ | ||
"host01", | ||
"host02" | ||
], | ||
"action": "add" | ||
}``` | ||
|
||
### Response | ||
|
||
```Status: 200``` | ||
```{ | ||
"message": "[host01, host02] bind to hostgroup: test, [] have been exist" | ||
}``` | ||
|
||
### Request | ||
```{ | ||
"hosts": [ | ||
"host01", | ||
"host02" | ||
], | ||
"action": "remove" | ||
}``` | ||
|
||
### Response | ||
|
||
```Status: 200``` | ||
```{ | ||
"message": "[host01, host02] unbind to hostgroup: test" | ||
}``` | ||
|
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
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
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