File tree 2 files changed +17
-0
lines changed
src/main/java/com/openshift/k8svisualizer
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,12 @@ public List<PlatformObject> getServices() {
49
49
return helper .getServices ();
50
50
}
51
51
52
+ @ RequestMapping ("/getDeployments" )
53
+ public List <PlatformObject > getDeployments () {
54
+ PlatformObjectHelper helper = new PlatformObjectHelper ();
55
+ return helper .getDeployments ();
56
+ }
57
+
52
58
@ CrossOrigin
53
59
@ RequestMapping ("/deleteObject" )
54
60
public void deletePlatformObject (@ RequestParam (value = "gameID" ) String gameID ,
Original file line number Diff line number Diff line change 5
5
import java .util .Random ;
6
6
import com .openshift .k8svisualizer .models .PlatformObject ;
7
7
import com .openshift .k8svisualizer .models .PlatformObjectPod ;
8
+ import io .fabric8 .kubernetes .api .model .extensions .Deployment ;
8
9
import io .fabric8 .kubernetes .api .model .PersistentVolumeClaim ;
9
10
import io .fabric8 .kubernetes .api .model .Pod ;
10
11
import io .fabric8 .kubernetes .api .model .Service ;
@@ -38,6 +39,7 @@ public List<PlatformObject> getPlatformObjects() {
38
39
platformObjects .addAll (this .getPVs ());
39
40
platformObjects .addAll (this .getServices ());
40
41
platformObjects .addAll (this .getRoutes ());
42
+ platformObjects .addAll (this .getDeployments ());
41
43
42
44
return platformObjects ;
43
45
@@ -121,6 +123,15 @@ public List<PlatformObject> getServices() {
121
123
return theList ;
122
124
}
123
125
126
+ public List <PlatformObject > getDeployments () {
127
+ ArrayList <PlatformObject > theList = new ArrayList <>();
128
+ List <Deployment > theItems = client .extensions ().deployments ().withLabel (labelName , labelValue ).list ().getItems ();
129
+ for (Deployment currConfig : theItems ) {
130
+ theList .add (new PlatformObject (currConfig .getMetadata ().getUid (), currConfig .getMetadata ().getName (),
131
+ "DEPLOYMENT" ));
132
+ }
133
+ return theList ;
134
+ }
124
135
private List <PlatformObject > getRoutes () {
125
136
ArrayList <PlatformObject > theList = new ArrayList <>();
126
137
List <Route > theItems = client .routes ().list ().getItems ();
You can’t perform that action at this time.
0 commit comments