3030class DeploymentController {
3131
3232 private static final DeploymentApi CLIENT = new DeploymentApi ();
33- private static final String RESSOURCE_GROUP = "default" ;
33+ private static final String RESOURCE_GROUP = "default" ;
3434
3535 /**
3636 * Create and delete a deployment with the Java specific configuration ID
@@ -40,15 +40,15 @@ class DeploymentController {
4040 */
4141 @ GetMapping ("/by-config/{id}/createDelete" )
4242 @ Nullable
43- public AiDeploymentDeletionResponse createAndDeleteDeploymentByConfigId (
43+ AiDeploymentDeletionResponse createAndDeleteDeploymentByConfigId (
4444 @ Nonnull @ PathVariable ("id" ) final String configId ) {
4545 final var deployment =
4646 CLIENT .create (
47- RESSOURCE_GROUP , AiDeploymentCreationRequest .create ().configurationId (configId ));
47+ RESOURCE_GROUP , AiDeploymentCreationRequest .create ().configurationId (configId ));
4848
4949 // shortly after creation, the deployment will be status UNKNOWN.
5050 // We can directly DELETE it, without going through STOPPED
51- return CLIENT .delete (RESSOURCE_GROUP , deployment .getId ());
51+ return CLIENT .delete (RESOURCE_GROUP , deployment .getId ());
5252 }
5353
5454 /**
@@ -62,7 +62,7 @@ public AiDeploymentDeletionResponse createAndDeleteDeploymentByConfigId(
6262 @ GetMapping ("/by-config/{id}/stop" )
6363 @ Nonnull
6464 @ SuppressWarnings ("unused" ) // debug method that doesn't need to be tested
65- public List <AiDeploymentModificationResponse > stopByConfigId (
65+ List <AiDeploymentModificationResponse > stopByConfigId (
6666 @ Nonnull @ PathVariable ("id" ) final String configId ) {
6767 final List <AiDeployment > myDeployments = getAllByConfigId (configId );
6868 log .info ("Found {} deployments to STOP" , myDeployments .size ());
@@ -72,7 +72,7 @@ public List<AiDeploymentModificationResponse> stopByConfigId(
7272 .map (
7373 deployment ->
7474 CLIENT .modify (
75- RESSOURCE_GROUP ,
75+ RESOURCE_GROUP ,
7676 deployment .getId (),
7777 AiDeploymentModificationRequest .create ()
7878 .targetStatus (AiDeploymentTargetStatus .STOPPED )))
@@ -90,14 +90,14 @@ public List<AiDeploymentModificationResponse> stopByConfigId(
9090 @ GetMapping ("/by-config/{id}/delete" )
9191 @ Nonnull
9292 @ SuppressWarnings ("unused" ) // debug method that doesn't need to be tested
93- public List <AiDeploymentDeletionResponse > deleteByConfigId (
93+ List <AiDeploymentDeletionResponse > deleteByConfigId (
9494 @ Nonnull @ PathVariable ("id" ) final String configId ) {
9595 final List <AiDeployment > myDeployments = getAllByConfigId (configId );
9696 log .info ("Found {} deployments to DELETE" , myDeployments .size ());
9797
9898 // DELETE my deployments
9999 return myDeployments .stream ()
100- .map (deployment -> CLIENT .delete (RESSOURCE_GROUP , deployment .getId ()))
100+ .map (deployment -> CLIENT .delete (RESOURCE_GROUP , deployment .getId ()))
101101 .toList ();
102102 }
103103
@@ -109,8 +109,8 @@ public List<AiDeploymentDeletionResponse> deleteByConfigId(
109109 */
110110 @ GetMapping ("/by-config/{id}/getAll" )
111111 @ Nonnull
112- public List <AiDeployment > getAllByConfigId (@ Nonnull @ PathVariable ("id" ) final String configId ) {
113- final AiDeploymentList deploymentList = CLIENT .query (RESSOURCE_GROUP );
112+ List <AiDeployment > getAllByConfigId (@ Nonnull @ PathVariable ("id" ) final String configId ) {
113+ final AiDeploymentList deploymentList = CLIENT .query (RESOURCE_GROUP );
114114
115115 return deploymentList .getResources ().stream ()
116116 .filter (deployment -> configId .equals (deployment .getConfigurationId ()))
@@ -124,8 +124,8 @@ public List<AiDeployment> getAllByConfigId(@Nonnull @PathVariable("id") final St
124124 */
125125 @ GetMapping ("/getAll" )
126126 @ Nullable
127- public AiDeploymentList getAll () {
128- return CLIENT .query (RESSOURCE_GROUP );
127+ AiDeploymentList getAll () {
128+ return CLIENT .query (RESOURCE_GROUP );
129129 }
130130
131131 /**
@@ -138,7 +138,7 @@ public AiDeploymentList getAll() {
138138 */
139139 @ Nonnull
140140 @ SuppressWarnings ("unused" ) // debug method that doesn't need to be tested
141- public AiDeploymentCreationResponse createConfigAndDeploy (final OpenAiModel model ) {
141+ AiDeploymentCreationResponse createConfigAndDeploy (final OpenAiModel model ) {
142142
143143 // Create a configuration
144144 final var modelNameParameter =
@@ -154,12 +154,12 @@ public AiDeploymentCreationResponse createConfigAndDeploy(final OpenAiModel mode
154154 .addParameterBindingsItem (modelVersion );
155155
156156 final AiConfigurationCreationResponse configuration =
157- new ConfigurationApi ().create (RESSOURCE_GROUP , configurationBaseData );
157+ new ConfigurationApi ().create (RESOURCE_GROUP , configurationBaseData );
158158
159159 // Create a deployment from the configuration
160160 final var deploymentCreationRequest =
161161 AiDeploymentCreationRequest .create ().configurationId (configuration .getId ());
162162
163- return CLIENT .create (RESSOURCE_GROUP , deploymentCreationRequest );
163+ return CLIENT .create (RESOURCE_GROUP , deploymentCreationRequest );
164164 }
165165}
0 commit comments