2018-05-09 17:57:01 +00:00
|
|
|
import axios from '~/lib/utils/axios_utils';
|
2017-04-28 16:06:19 +00:00
|
|
|
|
|
|
|
export default class DeployKeysService {
|
|
|
|
constructor(endpoint) {
|
2018-05-09 17:57:01 +00:00
|
|
|
this.axios = axios.create({
|
|
|
|
baseURL: endpoint,
|
|
|
|
});
|
2017-04-28 16:06:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
getKeys() {
|
2018-10-24 19:17:03 +00:00
|
|
|
return this.axios.get().then(response => response.data);
|
2017-04-28 16:06:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enableKey(id) {
|
2018-10-24 19:17:03 +00:00
|
|
|
return this.axios.put(`${id}/enable`).then(response => response.data);
|
2017-04-28 16:06:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
disableKey(id) {
|
2018-10-24 19:17:03 +00:00
|
|
|
return this.axios.put(`${id}/disable`).then(response => response.data);
|
2017-04-28 16:06:19 +00:00
|
|
|
}
|
|
|
|
}
|