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) {
|
2020-09-02 18:10:40 +00:00
|
|
|
this.endpoint = endpoint;
|
2017-04-28 16:06:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
getKeys() {
|
2020-12-23 21:10:24 +00:00
|
|
|
return axios.get(this.endpoint).then((response) => response.data);
|
2017-04-28 16:06:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enableKey(id) {
|
2020-12-23 21:10:24 +00:00
|
|
|
return axios.put(`${this.endpoint}/${id}/enable`).then((response) => response.data);
|
2017-04-28 16:06:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
disableKey(id) {
|
2020-12-23 21:10:24 +00:00
|
|
|
return axios.put(`${this.endpoint}/${id}/disable`).then((response) => response.data);
|
2017-04-28 16:06:19 +00:00
|
|
|
}
|
|
|
|
}
|