Initial commit

This commit is contained in:
Jon Ervine
2021-03-02 20:53:43 +08:00
parent 89d3a2dfe1
commit f961b728fa
2919 changed files with 388582 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
import Base from '../Base';
class Hosts extends Base {
constructor(http) {
super(http);
this.baseUrl = '/api/v2/hosts/';
this.readFacts = this.readFacts.bind(this);
this.readAllGroups = this.readAllGroups.bind(this);
this.readGroupsOptions = this.readGroupsOptions.bind(this);
this.associateGroup = this.associateGroup.bind(this);
this.disassociateGroup = this.disassociateGroup.bind(this);
}
readFacts(id) {
return this.http.get(`${this.baseUrl}${id}/ansible_facts/`);
}
readAllGroups(id, params) {
return this.http.get(`${this.baseUrl}${id}/all_groups/`, { params });
}
readGroupsOptions(id) {
return this.http.options(`${this.baseUrl}${id}/groups/`);
}
associateGroup(id, groupId) {
return this.http.post(`${this.baseUrl}${id}/groups/`, { id: groupId });
}
disassociateGroup(id, group) {
return this.http.post(`${this.baseUrl}${id}/groups/`, {
id: group.id,
disassociate: true,
});
}
}
export default Hosts;