mirror of
https://github.com/ansible/awx.git
synced 2026-02-27 07:56:06 -03:30
Hook up add instance group functionality.
This commit is contained in:
15
src/api.js
15
src/api.js
@@ -4,6 +4,7 @@ const API_LOGOUT = `${API_ROOT}logout/`;
|
||||
const API_V2 = `${API_ROOT}v2/`;
|
||||
const API_CONFIG = `${API_V2}config/`;
|
||||
const API_ORGANIZATIONS = `${API_V2}organizations/`;
|
||||
const API_INSTANCE_GROUPS = `${API_V2}instance_groups/`;
|
||||
|
||||
const LOGIN_CONTENT_TYPE = 'application/x-www-form-urlencoded';
|
||||
|
||||
@@ -68,6 +69,20 @@ class APIClient {
|
||||
|
||||
return this.http.get(endpoint);
|
||||
}
|
||||
|
||||
getInstanceGroups (){
|
||||
return this.http.get(API_INSTANCE_GROUPS);
|
||||
}
|
||||
|
||||
createInstanceGroups (url, selected) {
|
||||
if (selected.length > 0) {
|
||||
selected.forEach(select => {
|
||||
this.http.post(url, { id: select.id });
|
||||
});
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default APIClient;
|
||||
|
||||
Reference in New Issue
Block a user