Skip to content

Commit 4c5bdc7

Browse files
JasperB-TeamBluedupondje
authored andcommitted
api: updated Display class to contain a video type reference
Added VideoType as an extra parameter in the display, opens opportunity to alter/view the video type used by an object. Added documentation to VmGraphicsConsolesService. Signed-off-by: Jasper Berton <[email protected]>
1 parent cac7eba commit 4c5bdc7

File tree

6 files changed

+122
-10
lines changed

6 files changed

+122
-10
lines changed

src/main/java/services/InstanceTypeGraphicsConsoleService.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@ public interface InstanceTypeGraphicsConsoleService {
3535
/**
3636
* Gets graphics console configuration of the instance type.
3737
*
38+
* ```http
39+
* GET /ovirt-engine/api/instancetypes/123/graphicsconsoles HTTP/1.1
40+
* ```
41+
*
3842
* @author Ondra Machacek <[email protected]>
39-
* @date 31 Oct 2016
40-
* @status added
43+
* @author Jasper Berton <[email protected]>
44+
* @date 18 March 2025
45+
* @status updated_by_docs
4146
*/
4247
interface Get extends Follow {
4348
/**

src/main/java/services/VmGraphicsConsolesService.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,27 @@ public interface VmGraphicsConsolesService {
3838
/**
3939
* Add new graphics console to the virtual machine.
4040
*
41+
* For example, to add a new graphics console to the virtual machine `123` send a request as follows:
42+
*
43+
* ```http
44+
* POST /ovirt-engine/api/vms/123/graphicsconsoles HTTP/1.1
45+
* ```
46+
*
47+
* With a request body as follows:
48+
*
49+
* ```xml
50+
* <graphics_console> <protocol>type</protocol> </graphics_console>
51+
* ```
52+
*
53+
* Where `type` can be spice or vnc.
54+
*
55+
* IMPORTANT: Currently there is no check if the protocol is supported by the operating system the engine is running on.
56+
*
57+
*
4158
* @author Ondra Machacek <[email protected]>
42-
* @date 31 Oct 2016
43-
* @status added
59+
* @author Jasper Berton <[email protected]>
60+
* @date 18 Apr 2025
61+
* @status updated_by_docs
4462
*/
4563
interface Add {
4664
@InputDetail

src/main/java/services/VmService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,7 @@ default void inputDetail() {
822822
optional(vm().display().singleQxlPci());
823823
optional(vm().display().smartcardEnabled());
824824
optional(vm().display().type());
825+
optional(vm().display().videoType());
825826
optional(vm().domain().name());
826827
optional(vm().externalHostProvider().id());
827828
optional(vm().highAvailability().enabled());
@@ -1263,6 +1264,7 @@ default void inputDetail() {
12631264
optional(vm().customCpuModel());
12641265
optional(vm().customEmulatedMachine());
12651266
optional(vm().display().type());
1267+
optional(vm().display().videoType());
12661268
optional(vm().domain().name());
12671269
optional(vm().domain().user().password());
12681270
optional(vm().domain().user().userName());

src/main/java/services/VmsService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ default void inputDetail() {
368368
optional(vm().display().monitors());
369369
optional(vm().display().smartcardEnabled());
370370
optional(vm().display().type());
371+
optional(vm().display().videoType());
371372
optional(vm().domain().name());
372373
optional(vm().highAvailability().enabled());
373374
optional(vm().highAvailability().priority());

src/main/java/types/Display.java

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,35 @@
2424
import org.ovirt.api.metamodel.annotations.Type;
2525

2626
/**
27-
* Represents a graphic console configuration.
27+
* Represents the configuration of the used display.
2828
*
2929
* @author Sharon Gratch <[email protected]>
30-
* @date 24 Apr 2017
31-
* @status added
30+
* @author Jasper Berton <[email protected]>
31+
* @date 17 April 2025
32+
* @status updated
3233
*/
3334
@Type
3435
public interface Display {
3536
/**
36-
* The graphic console protocol type.
37+
* Returns SPICE or VNC based on the current Display type.
3738
*
3839
* @author Sharon Gratch <[email protected]>
39-
* @date 24 Apr 2017
40-
* @status added
40+
* @author Jasper Berton <[email protected]>
41+
* @date 17 April 2025
42+
* @status updated
4143
*/
44+
@Deprecated
4245
DisplayType type();
4346

47+
/**
48+
* Returns the video type used for the display.
49+
*
50+
* @author Jasper Berton <[email protected]>
51+
* @date 17 April 2025
52+
* @status added
53+
*/
54+
VideoType videoType();
55+
4456
/**
4557
* The IP address of the guest to connect the graphic console client to.
4658
*

src/main/java/types/VideoType.java

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
The oVirt Project - oVirt Engine Api Model
3+
4+
Copyright oVirt Authors
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
18+
A copy of the Apache License, Version 2.O is included with the program
19+
in the files ASL2.
20+
*/
21+
22+
package types;
23+
24+
import org.ovirt.api.metamodel.annotations.Type;
25+
26+
/**
27+
* Represents the video type that is currently configured.
28+
*
29+
* @author Jasper Berton <[email protected]>
30+
* @date 17 April 2025
31+
* @status added
32+
*/
33+
@Type
34+
public enum VideoType {
35+
36+
/**
37+
* Display of the type BOCHS
38+
*
39+
* @author Jasper Berton <[email protected]>
40+
* @date 17 April 2025
41+
* @status added
42+
*/
43+
BOCHS,
44+
45+
/**
46+
* Display of the type CIRRUS
47+
*
48+
* @author Jasper Berton <[email protected]>
49+
* @date 17 April 2025
50+
* @status added
51+
*/
52+
@Deprecated
53+
CIRRUS,
54+
55+
/**
56+
* Display of the type VGA
57+
*
58+
* @author Jasper Berton <[email protected]>
59+
* @date 17 April 2025
60+
* @status added
61+
*/
62+
VGA,
63+
64+
/**
65+
* Display of the type QXL
66+
*
67+
* @author Jasper Berton <[email protected]>
68+
* @date 17 April 2025
69+
* @status added
70+
*/
71+
@Deprecated
72+
QXL;
73+
74+
}

0 commit comments

Comments
 (0)