Hook up add instance group functionality.

This commit is contained in:
kialam
2019-01-07 16:56:39 -05:00
parent f34ec4be10
commit 517ef8a2c9
4 changed files with 30 additions and 12 deletions

View File

@@ -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;