-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
373 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...rc/main/java/fr/insee/onyxia/api/controller/exception/ServiceNotSuspendableException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package fr.insee.onyxia.api.controller.exception; | ||
|
||
import fr.insee.onyxia.api.services.impl.HelmAppsService; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
|
||
@ResponseStatus(value = HttpStatus.BAD_REQUEST) | ||
public class ServiceNotSuspendableException extends RuntimeException { | ||
public ServiceNotSuspendableException() { | ||
super( | ||
"This service is not suspendable. To be suspendable, a service must define " | ||
+ HelmAppsService.SUSPEND_KEY | ||
+ " as a key in values.schema.json"); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
onyxia-api/src/main/java/fr/insee/onyxia/api/events/SuspendResumeServiceEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package fr.insee.onyxia.api.events; | ||
|
||
public class SuspendResumeServiceEvent extends InstallServiceEvent { | ||
|
||
private boolean isSuspend; | ||
|
||
public SuspendResumeServiceEvent() {} | ||
|
||
public SuspendResumeServiceEvent( | ||
String username, | ||
String namespace, | ||
String releaseName, | ||
String packageName, | ||
String catalogId, | ||
boolean suspend) { | ||
super(username, namespace, releaseName, packageName, catalogId); | ||
this.isSuspend = suspend; | ||
} | ||
|
||
@Override | ||
public String getType() { | ||
return isSuspend ? "service.suspend" : "service.install"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.