1919public class WorkloadManagementRestIT extends OpenSearchRestTestCase {
2020
2121 public void testCreate () throws Exception {
22- Response response = performOperation ("PUT" , "_wlm/query_group " , getCreateJson ("analytics" , "enforced" , 0.4 , 0.2 ));
22+ Response response = performOperation ("PUT" , "_wlm/workload_group " , getCreateJson ("analytics" , "enforced" , 0.4 , 0.2 ));
2323 assertEquals (response .getStatusLine ().getStatusCode (), 200 );
24- performOperation ("DELETE" , "_wlm/query_group /analytics" , null );
24+ performOperation ("DELETE" , "_wlm/workload_group /analytics" , null );
2525 }
2626
2727 public void testMultipleCreate () throws Exception {
28- Response response = performOperation ("PUT" , "_wlm/query_group " , getCreateJson ("analytics2" , "enforced" , 0.4 , 0.2 ));
28+ Response response = performOperation ("PUT" , "_wlm/workload_group " , getCreateJson ("analytics2" , "enforced" , 0.4 , 0.2 ));
2929 assertEquals (response .getStatusLine ().getStatusCode (), 200 );
3030
31- Response response2 = performOperation ("PUT" , "_wlm/query_group " , getCreateJson ("users" , "soft" , 0.2 , 0.1 ));
31+ Response response2 = performOperation ("PUT" , "_wlm/workload_group " , getCreateJson ("users" , "soft" , 0.2 , 0.1 ));
3232 assertEquals (response2 .getStatusLine ().getStatusCode (), 200 );
3333
3434 assertThrows (
3535 ResponseException .class ,
36- () -> performOperation ("PUT" , "_wlm/query_group " , getCreateJson ("users2" , "soft" , 0.41 , 0.71 ))
36+ () -> performOperation ("PUT" , "_wlm/workload_group " , getCreateJson ("users2" , "soft" , 0.41 , 0.71 ))
3737 );
38- performOperation ("DELETE" , "_wlm/query_group /analytics2" , null );
39- performOperation ("DELETE" , "_wlm/query_group /users" , null );
38+ performOperation ("DELETE" , "_wlm/workload_group /analytics2" , null );
39+ performOperation ("DELETE" , "_wlm/workload_group /users" , null );
4040 }
4141
4242 public void testGet () throws Exception {
43- Response response = performOperation ("PUT" , "_wlm/query_group " , getCreateJson ("analytics3" , "enforced" , 0.4 , 0.2 ));
43+ Response response = performOperation ("PUT" , "_wlm/workload_group " , getCreateJson ("analytics3" , "enforced" , 0.4 , 0.2 ));
4444 assertEquals (response .getStatusLine ().getStatusCode (), 200 );
4545
46- Response response2 = performOperation ("GET" , "_wlm/query_group /analytics3" , null );
46+ Response response2 = performOperation ("GET" , "_wlm/workload_group /analytics3" , null );
4747 assertEquals (response2 .getStatusLine ().getStatusCode (), 200 );
4848 String responseBody2 = EntityUtils .toString (response2 .getEntity ());
4949 assertTrue (responseBody2 .contains ("\" name\" :\" analytics3\" " ));
5050 assertTrue (responseBody2 .contains ("\" resiliency_mode\" :\" enforced\" " ));
5151 assertTrue (responseBody2 .contains ("\" cpu\" :0.4" ));
5252 assertTrue (responseBody2 .contains ("\" memory\" :0.2" ));
5353
54- assertThrows (ResponseException .class , () -> performOperation ("GET" , "_wlm/query_group /analytics97" , null ));
55- performOperation ("DELETE" , "_wlm/query_group /analytics3" , null );
54+ assertThrows (ResponseException .class , () -> performOperation ("GET" , "_wlm/workload_group /analytics97" , null ));
55+ performOperation ("DELETE" , "_wlm/workload_group /analytics3" , null );
5656 }
5757
5858 public void testDelete () throws Exception {
59- Response response = performOperation ("PUT" , "_wlm/query_group " , getCreateJson ("analytics4" , "enforced" , 0.4 , 0.2 ));
59+ Response response = performOperation ("PUT" , "_wlm/workload_group " , getCreateJson ("analytics4" , "enforced" , 0.4 , 0.2 ));
6060 assertEquals (response .getStatusLine ().getStatusCode (), 200 );
6161
62- Response response2 = performOperation ("DELETE" , "_wlm/query_group /analytics4" , null );
62+ Response response2 = performOperation ("DELETE" , "_wlm/workload_group /analytics4" , null );
6363 assertEquals (response2 .getStatusLine ().getStatusCode (), 200 );
6464 assertTrue (EntityUtils .toString (response2 .getEntity ()).contains ("\" acknowledged\" :true" ));
6565
66- assertThrows (ResponseException .class , () -> performOperation ("DELETE" , "_wlm/query_group /analytics99" , null ));
66+ assertThrows (ResponseException .class , () -> performOperation ("DELETE" , "_wlm/workload_group /analytics99" , null ));
6767 }
6868
6969 public void testUpdate () throws Exception {
70- Response response = performOperation ("PUT" , "_wlm/query_group " , getCreateJson ("analytics5" , "enforced" , 0.4 , 0.2 ));
70+ Response response = performOperation ("PUT" , "_wlm/workload_group " , getCreateJson ("analytics5" , "enforced" , 0.4 , 0.2 ));
7171 assertEquals (response .getStatusLine ().getStatusCode (), 200 );
7272
73- Response response2 = performOperation ("PUT" , "_wlm/query_group /analytics5" , getUpdateJson ("monitor" , 0.41 , 0.21 ));
73+ Response response2 = performOperation ("PUT" , "_wlm/workload_group /analytics5" , getUpdateJson ("monitor" , 0.41 , 0.21 ));
7474 assertEquals (response2 .getStatusLine ().getStatusCode (), 200 );
7575 String responseBody2 = EntityUtils .toString (response2 .getEntity ());
7676 assertTrue (responseBody2 .contains ("\" name\" :\" analytics5\" " ));
@@ -84,22 +84,22 @@ public void testUpdate() throws Exception {
8484 + " \" memory\" : -0.1\n "
8585 + " }\n "
8686 + "}'" ;
87- assertThrows (ResponseException .class , () -> performOperation ("PUT" , "_wlm/query_group /analytics5" , json ));
87+ assertThrows (ResponseException .class , () -> performOperation ("PUT" , "_wlm/workload_group /analytics5" , json ));
8888 assertThrows (
8989 ResponseException .class ,
90- () -> performOperation ("PUT" , "_wlm/query_group /analytics98" , getUpdateJson ("monitor" , 0.43 , 0.23 ))
90+ () -> performOperation ("PUT" , "_wlm/workload_group /analytics98" , getUpdateJson ("monitor" , 0.43 , 0.23 ))
9191 );
92- performOperation ("DELETE" , "_wlm/query_group /analytics5" , null );
92+ performOperation ("DELETE" , "_wlm/workload_group /analytics5" , null );
9393 }
9494
9595 public void testCRUD () throws Exception {
96- Response response = performOperation ("PUT" , "_wlm/query_group " , getCreateJson ("analytics6" , "enforced" , 0.4 , 0.2 ));
96+ Response response = performOperation ("PUT" , "_wlm/workload_group " , getCreateJson ("analytics6" , "enforced" , 0.4 , 0.2 ));
9797 assertEquals (response .getStatusLine ().getStatusCode (), 200 );
9898
99- Response response1 = performOperation ("PUT" , "_wlm/query_group /analytics6" , getUpdateJson ("monitor" , 0.41 , 0.21 ));
99+ Response response1 = performOperation ("PUT" , "_wlm/workload_group /analytics6" , getUpdateJson ("monitor" , 0.41 , 0.21 ));
100100 assertEquals (response1 .getStatusLine ().getStatusCode (), 200 );
101101
102- Response response2 = performOperation ("GET" , "_wlm/query_group /analytics6" , null );
102+ Response response2 = performOperation ("GET" , "_wlm/workload_group /analytics6" , null );
103103 assertEquals (response2 .getStatusLine ().getStatusCode (), 200 );
104104 String responseBody2 = EntityUtils .toString (response2 .getEntity ());
105105 assertTrue (responseBody2 .contains ("\" name\" :\" analytics6\" " ));
@@ -109,24 +109,24 @@ public void testCRUD() throws Exception {
109109
110110 assertThrows (
111111 ResponseException .class ,
112- () -> performOperation ("PUT" , "_wlm/query_group " , getCreateJson ("users3" , "monitor" , 0.6 , 0.8 ))
112+ () -> performOperation ("PUT" , "_wlm/workload_group " , getCreateJson ("users3" , "monitor" , 0.6 , 0.8 ))
113113 );
114114
115- Response response4 = performOperation ("PUT" , "_wlm/query_group " , getCreateJson ("users3" , "monitor" , 0.59 , 0.79 ));
115+ Response response4 = performOperation ("PUT" , "_wlm/workload_group " , getCreateJson ("users3" , "monitor" , 0.59 , 0.79 ));
116116 assertEquals (response4 .getStatusLine ().getStatusCode (), 200 );
117117
118- Response response5 = performOperation ("DELETE" , "_wlm/query_group /analytics6" , null );
118+ Response response5 = performOperation ("DELETE" , "_wlm/workload_group /analytics6" , null );
119119 assertEquals (response5 .getStatusLine ().getStatusCode (), 200 );
120120 String responseBody5 = EntityUtils .toString (response5 .getEntity ());
121121 assertTrue (responseBody5 .contains ("\" acknowledged\" :true" ));
122122
123- Response response6 = performOperation ("GET" , "_wlm/query_group " , null );
123+ Response response6 = performOperation ("GET" , "_wlm/workload_group " , null );
124124 assertEquals (response6 .getStatusLine ().getStatusCode (), 200 );
125125 String responseBody6 = EntityUtils .toString (response6 .getEntity ());
126- assertTrue (responseBody6 .contains ("\" query_groups \" " ));
126+ assertTrue (responseBody6 .contains ("\" workload_groups \" " ));
127127 assertTrue (responseBody6 .contains ("\" users3\" " ));
128128 assertFalse (responseBody6 .contains ("\" analytics6\" " ));
129- performOperation ("DELETE" , "_wlm/query_group /users3" , null );
129+ performOperation ("DELETE" , "_wlm/workload_group /users3" , null );
130130 }
131131
132132 static String getCreateJson (String name , String resiliencyMode , double cpu , double memory ) {
0 commit comments