ovirt-engine-sdk 4.0.5 → 4.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fa8b2c41d6e4de3707932c34fb215d2991894ac
4
- data.tar.gz: a5d2dc254baded75ff8c10dd658d261c1e84a835
3
+ metadata.gz: 8e5bfa1388e71cd3c46306600f1684f33840cab9
4
+ data.tar.gz: 1aef00ac9898fe1ee30e31d8bde8be4f3b6ec01c
5
5
  SHA512:
6
- metadata.gz: 53fc1b7b12b9a89fbc48831cd817e2d6163057bf569b96234c716cb980803092982acb86a49b991d3bf6c54fb57190568000d4c1fb193435b5c0c5786ba99392
7
- data.tar.gz: c5a1888b7aa6bd2334ff1524a29a7d2978e519c50aa86e67807bd24ac21a700582d3e3a7ca3293f45360d918f82659a9fe9a5a00a78bbc44ad19918eaa2df0af
6
+ metadata.gz: 575ee5fd660bfe4747f22c0dd56bb36ee7ef4f688f30bc92fe1acec76f208d40a31e9d555b274df2afba03dd869a4a516e5ddd1d543ed0304005ae661ff60c76
7
+ data.tar.gz: 008405cdde7b82e2f07b7cf15a5f6d741d887fe7a64070d4b96bbfa1fc76ecac36ed9dcfc55d579d41533448e945bdac59d92238c77ec8ac061b009dd66dac24
@@ -2,6 +2,49 @@
2
2
 
3
3
  This document describes the relevant changes between releases of the SDK.
4
4
 
5
+ == 4.0.6 / Oct 18 2016
6
+
7
+ Update to model 4.0.37.
8
+
9
+ New features:
10
+
11
+ * Add services to support disk attachments of virtual machines available
12
+ for import from storage domains.
13
+
14
+ * Add `gluster` value to the `NetworkUsage` enum.
15
+
16
+ * Add `force` parameter to the operation that updates a storage server
17
+ connection.
18
+
19
+ Bug fixes:
20
+
21
+ * Fix the type of the `ticket` parameter of the `VmService.ticket`
22
+ method.
23
+
24
+ * Fix the type of the `authentication_method` attribute of the `Ssh`
25
+ type.
26
+
27
+ * Rename the `AuthenticationMethod` enum type to `SshAuthenticationMethod`.
28
+
29
+ * Fix the name of the `exclusive` parameter o the `TemplateService.export`
30
+ method.
31
+
32
+ * Add the missing `cluster` parameter to the `OpenstackImageService.import`
33
+ method.
34
+
35
+ * Move the `quota` link from the `Vm` type to the `VmBase` type.
36
+
37
+ * Add missing `template` and `storage_domain` parameters to the
38
+ operation that imports an image.
39
+
40
+ * Add the `next_run` parameter to the operation that updates a virtual
41
+ machine.
42
+
43
+ * Add the `all_content` parameters to the operations that list and
44
+ retrieve virtual machines.
45
+
46
+ * Implement `==` and `eql?` for types https://bugzilla.redhat.com/1383613[#1383613].
47
+
5
48
  == 4.0.5 / Oct 7 2016
6
49
 
7
50
  Bug Fixes:
@@ -28,7 +28,7 @@ require 'ovirtsdk4c'
28
28
  # Own requirements.
29
29
  #
30
30
  require 'ovirtsdk4/version.rb'
31
- require 'ovirtsdk4/http.rb'
31
+ require 'ovirtsdk4/connection.rb'
32
32
  require 'ovirtsdk4/type.rb'
33
33
  require 'ovirtsdk4/types.rb'
34
34
  require 'ovirtsdk4/reader.rb'
@@ -138,7 +138,7 @@ module OvirtSDK4
138
138
  request.url = "#{@url}#{request.url}"
139
139
  end
140
140
 
141
- # Set the headers:
141
+ # Set the headers common to all requests:
142
142
  request.headers.merge!(
143
143
  'User-Agent' => "RubySDK/#{VERSION}",
144
144
  'Version' => '4',
@@ -146,6 +146,16 @@ module OvirtSDK4
146
146
  'Accept' => 'application/xml',
147
147
  )
148
148
 
149
+ # Older versions of the engine (before 4.1) required the 'all_content' as an HTTP header instead of a query
150
+ # parameter. In order to better support those older versions of the engine we need to check if this parameter is
151
+ # included in the request, and add the corresponding header.
152
+ unless request.query.nil?
153
+ all_content = request.query['all_content']
154
+ unless all_content.nil?
155
+ request.headers['All-Content'] = all_content
156
+ end
157
+ end
158
+
149
159
  # Set the authentication token:
150
160
  @token ||= get_access_token
151
161
  request.token = @token
@@ -48,8 +48,6 @@ module OvirtSDK4
48
48
  object.discard_snapshots = value if not value.nil?
49
49
  value = reader.get_attribute('exclusive')
50
50
  object.exclusive = value if not value.nil?
51
- value = reader.get_attribute('exclussive')
52
- object.exclussive = value if not value.nil?
53
51
  value = reader.get_attribute('fence_type')
54
52
  object.fence_type = value if not value.nil?
55
53
  value = reader.get_attribute('filter')
@@ -135,8 +133,6 @@ module OvirtSDK4
135
133
  object.disks = DiskReader.read_many(reader)
136
134
  when 'exclusive'
137
135
  object.exclusive = Reader.read_boolean(reader)
138
- when 'exclussive'
139
- object.exclussive = Reader.read_boolean(reader)
140
136
  when 'fault'
141
137
  object.fault = FaultReader.read_one(reader)
142
138
  when 'fence_type'
@@ -1922,8 +1918,6 @@ module OvirtSDK4
1922
1918
  object.gluster_hooks = GlusterHookReader.read_many(reader)
1923
1919
  when 'gluster_volumes'
1924
1920
  object.gluster_volumes = GlusterVolumeReader.read_many(reader)
1925
- when 'mac_pool'
1926
- object.mac_pool = MacPoolReader.read_one(reader)
1927
1921
  when 'management_network'
1928
1922
  object.management_network = NetworkReader.read_one(reader)
1929
1923
  when 'network_filters'
@@ -8184,6 +8178,8 @@ module OvirtSDK4
8184
8178
  object.nics = NicReader.read_many(reader)
8185
8179
  when 'permissions'
8186
8180
  object.permissions = PermissionReader.read_many(reader)
8181
+ when 'quota'
8182
+ object.quota = QuotaReader.read_one(reader)
8187
8183
  when 'storage_domain'
8188
8184
  object.storage_domain = StorageDomainReader.read_one(reader)
8189
8185
  when 'tags'
@@ -15650,6 +15646,8 @@ module OvirtSDK4
15650
15646
  object.nics = NicReader.read_many(reader)
15651
15647
  when 'permissions'
15652
15648
  object.permissions = PermissionReader.read_many(reader)
15649
+ when 'quota'
15650
+ object.quota = QuotaReader.read_one(reader)
15653
15651
  when 'storage_domain'
15654
15652
  object.storage_domain = StorageDomainReader.read_one(reader)
15655
15653
  when 'tags'
@@ -17272,6 +17270,8 @@ module OvirtSDK4
17272
17270
  object.cluster = ClusterReader.read_one(reader)
17273
17271
  when 'cpu_profile'
17274
17272
  object.cpu_profile = CpuProfileReader.read_one(reader)
17273
+ when 'quota'
17274
+ object.quota = QuotaReader.read_one(reader)
17275
17275
  when 'storage_domain'
17276
17276
  object.storage_domain = StorageDomainReader.read_one(reader)
17277
17277
  else
@@ -551,6 +551,12 @@ module OvirtSDK4
551
551
  class StorageDomainVmService < Service
552
552
  end
553
553
 
554
+ class StorageDomainVmDiskAttachmentService < Service
555
+ end
556
+
557
+ class StorageDomainVmDiskAttachmentsService < Service
558
+ end
559
+
554
560
  class StorageDomainVmsService < Service
555
561
  end
556
562
 
@@ -757,7 +763,17 @@ module OvirtSDK4
757
763
  end
758
764
 
759
765
  #
760
- # Returns the representation of the object managed by this service.
766
+ # Retrieve the affinity group details.
767
+ #
768
+ # [source,xml]
769
+ # ----
770
+ # <affinity_group id="00000000-0000-0000-0000-000000000000">
771
+ # <name>AF_GROUP_001</name>
772
+ # <cluster id="00000000-0000-0000-0000-000000000000"/>
773
+ # <positive>true</positive>
774
+ # <enforcing>true</enforcing>
775
+ # </affinity_group>
776
+ # ----
761
777
  #
762
778
  # @param opts [Hash] Additional options.
763
779
  #
@@ -781,7 +797,12 @@ module OvirtSDK4
781
797
  end
782
798
 
783
799
  #
784
- # Deletes the object managed by this service.
800
+ # Remove the affinity group.
801
+ #
802
+ # [source]
803
+ # ----
804
+ # DELETE /ovirt-engine/api/clusters/000-000/affinitygroups/123-456
805
+ # ----
785
806
  #
786
807
  # @param opts [Hash] Additional options.
787
808
  #
@@ -801,9 +822,9 @@ module OvirtSDK4
801
822
  end
802
823
 
803
824
  #
804
- # Updates the `group`.
825
+ # Update the affinity group.
805
826
  #
806
- # @param group [AffinityGroup] The `group` to update.
827
+ # @param group [AffinityGroup] The affinity group.
807
828
  # @param opts [Hash] Additional options.
808
829
  #
809
830
  # @option opts [Boolean] :async Indicates if the update should be performed asynchronously.
@@ -844,7 +865,9 @@ module OvirtSDK4
844
865
  end
845
866
 
846
867
  #
847
- # Locates the `vms` service.
868
+ # Returns a reference to the service that manages the
869
+ # list of all virtual machines attached to this affinity
870
+ # group.
848
871
  #
849
872
  # @return [AffinityGroupVmsService] A reference to `vms` service.
850
873
  def vms_service
@@ -899,7 +922,7 @@ module OvirtSDK4
899
922
  end
900
923
 
901
924
  #
902
- # Deletes the object managed by this service.
925
+ # Remove this virtual machine from the affinity group.
903
926
  #
904
927
  # @param opts [Hash] Additional options.
905
928
  #
@@ -960,7 +983,21 @@ module OvirtSDK4
960
983
  end
961
984
 
962
985
  #
963
- # Adds a new `vm`.
986
+ # Add a virtual machine to the affinity group.
987
+ #
988
+ # For example to add the virtual machine 000-000 to affinity group 123-456 send a request to:
989
+ #
990
+ # [source]
991
+ # ----
992
+ # POST /ovirt-engine/api/clusters/000-000/affinitygroups/123-456/vms
993
+ # ----
994
+ #
995
+ # With the following body:
996
+ #
997
+ # [source,xml]
998
+ # ----
999
+ # <vm id="000-000"/>
1000
+ # ----
964
1001
  #
965
1002
  # @param vm [Vm] The `vm` to add.
966
1003
  #
@@ -983,7 +1020,7 @@ module OvirtSDK4
983
1020
  end
984
1021
  response = @connection.send(request)
985
1022
  case response.code
986
- when 201, 202
1023
+ when 200, 201, 202
987
1024
  begin
988
1025
  reader = XmlReader.new(response.body)
989
1026
  return VmReader.read_one(reader)
@@ -996,7 +1033,7 @@ module OvirtSDK4
996
1033
  end
997
1034
 
998
1035
  #
999
- # Returns the representation of the object managed by this service.
1036
+ # List all virtual machines assigned to this affinity group.
1000
1037
  #
1001
1038
  # @param opts [Hash] Additional options.
1002
1039
  #
@@ -1028,7 +1065,7 @@ module OvirtSDK4
1028
1065
  end
1029
1066
 
1030
1067
  #
1031
- # Locates the `vm` service.
1068
+ # Access the service that manages the virtual machine assignment to this affinity group.
1032
1069
  #
1033
1070
  # @param id [String] The identifier of the `vm`.
1034
1071
  #
@@ -1084,9 +1121,27 @@ module OvirtSDK4
1084
1121
  end
1085
1122
 
1086
1123
  #
1087
- # Adds a new `group`.
1124
+ # Create a new affinity group.
1125
+ #
1126
+ # Post a request like in the example below to create a new affinity group:
1127
+ #
1128
+ # [source]
1129
+ # ----
1130
+ # POST /ovirt-engine/api/clusters/000-000/affinitygroups
1131
+ # ----
1132
+ #
1133
+ # And use the following example in its body:
1134
+ #
1135
+ # [source,xml]
1136
+ # ----
1137
+ # <affinity_group>
1138
+ # <name>AF_GROUP_001</name>
1139
+ # <positive>true</positive>
1140
+ # <enforcing>true</enforcing>
1141
+ # </affinity_group>
1142
+ # ----
1088
1143
  #
1089
- # @param group [AffinityGroup] The `group` to add.
1144
+ # @param group [AffinityGroup] The affinity group object to create.
1090
1145
  #
1091
1146
  # @param opts [Hash] Additional options.
1092
1147
  #
@@ -1107,7 +1162,7 @@ module OvirtSDK4
1107
1162
  end
1108
1163
  response = @connection.send(request)
1109
1164
  case response.code
1110
- when 201, 202
1165
+ when 200, 201, 202
1111
1166
  begin
1112
1167
  reader = XmlReader.new(response.body)
1113
1168
  return AffinityGroupReader.read_one(reader)
@@ -1120,7 +1175,7 @@ module OvirtSDK4
1120
1175
  end
1121
1176
 
1122
1177
  #
1123
- # Returns the representation of the object managed by this service.
1178
+ # List existing affinity groups.
1124
1179
  #
1125
1180
  # @param opts [Hash] Additional options.
1126
1181
  #
@@ -1151,7 +1206,7 @@ module OvirtSDK4
1151
1206
  end
1152
1207
 
1153
1208
  #
1154
- # Locates the `group` service.
1209
+ # Access affinity group service that manages the affinity group specified by an id.
1155
1210
  #
1156
1211
  # @param id [String] The identifier of the `group`.
1157
1212
  #
@@ -1456,7 +1511,7 @@ module OvirtSDK4
1456
1511
  end
1457
1512
  response = @connection.send(request)
1458
1513
  case response.code
1459
- when 201, 202
1514
+ when 200, 201, 202
1460
1515
  begin
1461
1516
  reader = XmlReader.new(response.body)
1462
1517
  return HostReader.read_one(reader)
@@ -1652,7 +1707,7 @@ module OvirtSDK4
1652
1707
  end
1653
1708
  response = @connection.send(request)
1654
1709
  case response.code
1655
- when 201, 202
1710
+ when 200, 201, 202
1656
1711
  begin
1657
1712
  reader = XmlReader.new(response.body)
1658
1713
  return VmReader.read_one(reader)
@@ -1770,7 +1825,7 @@ module OvirtSDK4
1770
1825
  end
1771
1826
  response = @connection.send(request)
1772
1827
  case response.code
1773
- when 201, 202
1828
+ when 200, 201, 202
1774
1829
  begin
1775
1830
  reader = XmlReader.new(response.body)
1776
1831
  return AffinityLabelReader.read_one(reader)
@@ -1972,7 +2027,7 @@ module OvirtSDK4
1972
2027
  end
1973
2028
  response = @connection.send(request)
1974
2029
  case response.code
1975
- when 201, 202
2030
+ when 200, 201, 202
1976
2031
  begin
1977
2032
  reader = XmlReader.new(response.body)
1978
2033
  return AffinityLabelReader.read_one(reader)
@@ -2174,7 +2229,7 @@ module OvirtSDK4
2174
2229
  end
2175
2230
  response = @connection.send(request)
2176
2231
  case response.code
2177
- when 201, 202
2232
+ when 200, 201, 202
2178
2233
  begin
2179
2234
  reader = XmlReader.new(response.body)
2180
2235
  return CpuProfileReader.read_one(reader)
@@ -2382,7 +2437,7 @@ module OvirtSDK4
2382
2437
  end
2383
2438
  response = @connection.send(request)
2384
2439
  case response.code
2385
- when 201, 202
2440
+ when 200, 201, 202
2386
2441
  begin
2387
2442
  reader = XmlReader.new(response.body)
2388
2443
  return DiskProfileReader.read_one(reader)
@@ -2633,7 +2688,7 @@ module OvirtSDK4
2633
2688
  end
2634
2689
  response = @connection.send(request)
2635
2690
  case response.code
2636
- when 201, 202
2691
+ when 200, 201, 202
2637
2692
  begin
2638
2693
  reader = XmlReader.new(response.body)
2639
2694
  return NetworkReader.read_one(reader)
@@ -2756,7 +2811,7 @@ module OvirtSDK4
2756
2811
  end
2757
2812
  response = @connection.send(request)
2758
2813
  case response.code
2759
- when 201, 202
2814
+ when 200, 201, 202
2760
2815
  begin
2761
2816
  reader = XmlReader.new(response.body)
2762
2817
  return PermissionReader.read_one(reader)
@@ -3045,7 +3100,7 @@ module OvirtSDK4
3045
3100
  end
3046
3101
  response = @connection.send(request)
3047
3102
  case response.code
3048
- when 201, 202
3103
+ when 200, 201, 202
3049
3104
  begin
3050
3105
  reader = XmlReader.new(response.body)
3051
3106
  return TagReader.read_one(reader)
@@ -3267,7 +3322,7 @@ module OvirtSDK4
3267
3322
  end
3268
3323
  response = @connection.send(request)
3269
3324
  case response.code
3270
- when 201, 202
3325
+ when 200, 201, 202
3271
3326
  begin
3272
3327
  reader = XmlReader.new(response.body)
3273
3328
  return VnicProfileReader.read_one(reader)
@@ -3367,7 +3422,21 @@ module OvirtSDK4
3367
3422
  end
3368
3423
 
3369
3424
  #
3370
- # Executes the `activate` method.
3425
+ # This operation activates an attached storage domain.
3426
+ # Once the storage domain is activated it is ready for use with the data center.
3427
+ #
3428
+ # [source]
3429
+ # ----
3430
+ # POST /ovirt-engine/api/datacenters/123/storagedomains/456/activate
3431
+ # ----
3432
+ #
3433
+ # The activate action does not take any action specific parameters,
3434
+ # so the request body should contain an empty `action`:
3435
+ #
3436
+ # [source,xml]
3437
+ # ----
3438
+ # <action/>
3439
+ # ----
3371
3440
  #
3372
3441
  # @param opts [Hash] Additional options.
3373
3442
  #
@@ -3394,7 +3463,21 @@ module OvirtSDK4
3394
3463
  end
3395
3464
 
3396
3465
  #
3397
- # Executes the `deactivate` method.
3466
+ # This operation deactivates an attached storage domain.
3467
+ # Once the storage domain is deactivated it will not be used with the data center.
3468
+ #
3469
+ # [source]
3470
+ # ----
3471
+ # POST /ovirt-engine/api/datacenters/123/storagedomains/456/deactivate
3472
+ # ----
3473
+ #
3474
+ # The deactivate action does not take any action specific parameters,
3475
+ # so the request body should contain an empty `action`:
3476
+ #
3477
+ # [source,xml]
3478
+ # ----
3479
+ # <action/>
3480
+ # ----
3398
3481
  #
3399
3482
  # @param opts [Hash] Additional options.
3400
3483
  #
@@ -3543,7 +3626,7 @@ module OvirtSDK4
3543
3626
  end
3544
3627
  response = @connection.send(request)
3545
3628
  case response.code
3546
- when 201, 202
3629
+ when 200, 201, 202
3547
3630
  begin
3548
3631
  reader = XmlReader.new(response.body)
3549
3632
  return StorageDomainReader.read_one(reader)
@@ -3758,7 +3841,7 @@ module OvirtSDK4
3758
3841
  end
3759
3842
  response = @connection.send(request)
3760
3843
  case response.code
3761
- when 201, 202
3844
+ when 200, 201, 202
3762
3845
  begin
3763
3846
  reader = XmlReader.new(response.body)
3764
3847
  return BalanceReader.read_one(reader)
@@ -4016,7 +4099,7 @@ module OvirtSDK4
4016
4099
  end
4017
4100
  response = @connection.send(request)
4018
4101
  case response.code
4019
- when 201, 202
4102
+ when 200, 201, 202
4020
4103
  begin
4021
4104
  reader = XmlReader.new(response.body)
4022
4105
  return BookmarkReader.read_one(reader)
@@ -4147,7 +4230,12 @@ module OvirtSDK4
4147
4230
  end
4148
4231
 
4149
4232
  #
4150
- # Deletes the object managed by this service.
4233
+ # Removes cluster from the system.
4234
+ #
4235
+ # [source]
4236
+ # ----
4237
+ # DELETE /ovirt-engine/api/clusters/00000000-0000-0000-0000-000000000000
4238
+ # ----
4151
4239
  #
4152
4240
  # @param opts [Hash] Additional options.
4153
4241
  #
@@ -4194,7 +4282,27 @@ module OvirtSDK4
4194
4282
  end
4195
4283
 
4196
4284
  #
4197
- # Updates the `cluster`.
4285
+ # Updates information about the cluster.
4286
+ #
4287
+ # Only specified fields are updated, others remain unchanged.
4288
+ #
4289
+ # E.g. update cluster's CPU:
4290
+ #
4291
+ # [source]
4292
+ # ----
4293
+ # PUT /ovirt-engine/api/clusters/123
4294
+ # ----
4295
+ #
4296
+ # With request body like:
4297
+ #
4298
+ # [source,xml]
4299
+ # ----
4300
+ # <cluster>
4301
+ # <cpu>
4302
+ # <type>Intel Haswell-noTSX Family</type>
4303
+ # </cpu>
4304
+ # </cluster>
4305
+ # ----
4198
4306
  #
4199
4307
  # @param cluster [Cluster] The `cluster` to update.
4200
4308
  # @param opts [Hash] Additional options.
@@ -4521,7 +4629,28 @@ module OvirtSDK4
4521
4629
  end
4522
4630
 
4523
4631
  #
4524
- # Adds a new `cluster`.
4632
+ # Creates a new cluster.
4633
+ #
4634
+ # This requires the `name`, `cpu.type` and `data_center` attributes. Identify the data center with either the `id`
4635
+ # or `name` attributes.
4636
+ #
4637
+ # [source]
4638
+ # ----
4639
+ # POST /ovirt-engine/api/clusters
4640
+ # ----
4641
+ #
4642
+ # With a request body like this:
4643
+ #
4644
+ # [source,xml]
4645
+ # ----
4646
+ # <cluster>
4647
+ # <name>mycluster</name>
4648
+ # <cpu>
4649
+ # <type>Intel Penryn Family</type>
4650
+ # </cpu>
4651
+ # <data_center id="123"/>
4652
+ # </cluster>
4653
+ # ----
4525
4654
  #
4526
4655
  # @param cluster [Cluster] The `cluster` to add.
4527
4656
  #
@@ -4544,7 +4673,7 @@ module OvirtSDK4
4544
4673
  end
4545
4674
  response = @connection.send(request)
4546
4675
  case response.code
4547
- when 201, 202
4676
+ when 200, 201, 202
4548
4677
  begin
4549
4678
  reader = XmlReader.new(response.body)
4550
4679
  return ClusterReader.read_one(reader)
@@ -4899,7 +5028,7 @@ module OvirtSDK4
4899
5028
  end
4900
5029
  response = @connection.send(request)
4901
5030
  case response.code
4902
- when 201, 202
5031
+ when 200, 201, 202
4903
5032
  begin
4904
5033
  reader = XmlReader.new(response.body)
4905
5034
  return CpuProfileReader.read_one(reader)
@@ -5032,6 +5161,11 @@ module OvirtSDK4
5032
5161
  #
5033
5162
  # Removes the data center.
5034
5163
  #
5164
+ # [source]
5165
+ # ----
5166
+ # DELETE /ovirt-engine/api/datacenters/123
5167
+ # ----
5168
+ #
5035
5169
  # Without any special parameters, the storage domains attached to the data center are detached and then removed
5036
5170
  # from the storage. If something fails when performing this operation, for example if there is no host available to
5037
5171
  # remove the storage domains from the storage, the complete operation will fail.
@@ -5067,9 +5201,27 @@ module OvirtSDK4
5067
5201
  end
5068
5202
 
5069
5203
  #
5070
- # Updates the `data_center`.
5204
+ # Updates the data center.
5205
+ #
5206
+ # The `name`, `description`, `storage_type`, `version`, `storage_format` and `mac_pool` elements are updatable
5207
+ # post-creation. For example, to change the name and description of data center `123` send a request like this:
5208
+ #
5209
+ # [source]
5210
+ # ----
5211
+ # PUT /ovirt-engine/api/datacenters/123
5212
+ # ----
5213
+ #
5214
+ # With a request body like this:
5071
5215
  #
5072
- # @param data_center [DataCenter] The `data_center` to update.
5216
+ # [source,xml]
5217
+ # ----
5218
+ # <data_center>
5219
+ # <name>myupdatedname</name>
5220
+ # <description>An updated description for the data center</description>
5221
+ # </data_center>
5222
+ # ----
5223
+ #
5224
+ # @param data_center [DataCenter] The data center that is being updated.
5073
5225
  # @param opts [Hash] Additional options.
5074
5226
  #
5075
5227
  # @option opts [Boolean] :async Indicates if the update should be performed asynchronously.
@@ -5158,7 +5310,30 @@ module OvirtSDK4
5158
5310
  end
5159
5311
 
5160
5312
  #
5161
- # Locates the `storage_domains` service.
5313
+ # Attach and detach storage domains to and from a data center.
5314
+ #
5315
+ # For attaching a single storage domain we should use the folowing POST request:
5316
+ #
5317
+ # [source]
5318
+ # ----
5319
+ # POST /ovirt-engine/api/datacenters/123/storagedomains
5320
+ # ----
5321
+ #
5322
+ # With a request body like this:
5323
+ #
5324
+ # [source,xml]
5325
+ # ----
5326
+ # <storage_domain>
5327
+ # <name>data1</name>
5328
+ # </storage_domain>
5329
+ # ----
5330
+ #
5331
+ # For detaching a single storage domain we should use the folowing DELETE request:
5332
+ #
5333
+ # [source]
5334
+ # ----
5335
+ # DELETE /ovirt-engine/api/datacenters/123/storagedomains/123
5336
+ # ----
5162
5337
  #
5163
5338
  # @return [AttachedStorageDomainsService] A reference to `storage_domains` service.
5164
5339
  def storage_domains_service
@@ -5249,9 +5424,27 @@ module OvirtSDK4
5249
5424
  end
5250
5425
 
5251
5426
  #
5252
- # Adds a new `data_center`.
5427
+ # Creates a new data center.
5428
+ #
5429
+ # Creation of a new data center requires the `name` and `local` elements. For example, to create a data center
5430
+ # named `mydc` that uses shared storage (NFS, iSCSI or fibre channel) send a request like this:
5431
+ #
5432
+ # [source]
5433
+ # ----
5434
+ # POST /ovirt-engine/api/datacenters
5435
+ # ----
5436
+ #
5437
+ # With a request body like this:
5438
+ #
5439
+ # [source,xml]
5440
+ # ----
5441
+ # <data_center>
5442
+ # <name>mydc</name>
5443
+ # <local>false</local>
5444
+ # </data_center>
5445
+ # ----
5253
5446
  #
5254
- # @param data_center [DataCenter] The `data_center` to add.
5447
+ # @param data_center [DataCenter] The data center that is being added.
5255
5448
  #
5256
5449
  # @param opts [Hash] Additional options.
5257
5450
  #
@@ -5272,7 +5465,7 @@ module OvirtSDK4
5272
5465
  end
5273
5466
  response = @connection.send(request)
5274
5467
  case response.code
5275
- when 201, 202
5468
+ when 200, 201, 202
5276
5469
  begin
5277
5470
  reader = XmlReader.new(response.body)
5278
5471
  return DataCenterReader.read_one(reader)
@@ -5285,7 +5478,63 @@ module OvirtSDK4
5285
5478
  end
5286
5479
 
5287
5480
  #
5288
- # Returns the representation of the object managed by this service.
5481
+ # Lists the data centers.
5482
+ #
5483
+ # The following request retrieves a representation of the data centers:
5484
+ #
5485
+ # [source]
5486
+ # ----
5487
+ # GET /ovirt-engine/api/datacenters
5488
+ # ----
5489
+ #
5490
+ # The above request performed with `curl`:
5491
+ #
5492
+ # [source,bash]
5493
+ # ----
5494
+ # curl \
5495
+ # --request GET \
5496
+ # --cacert /etc/pki/ovirt-engine/ca.pem \
5497
+ # --header "Version: 4" \
5498
+ # --header "Accept: application/xml" \
5499
+ # --user "admin@internal:mypassword" \
5500
+ # https://myengine.example.com/ovirt-engine/api/datacenters
5501
+ # ----
5502
+ #
5503
+ # This is what an example response could look like:
5504
+ #
5505
+ # [source,xml]
5506
+ # ----
5507
+ # <data_center href="/ovirt-engine/api/datacenters/123" id="123">
5508
+ # <name>Default</name>
5509
+ # <description>The default Data Center</description>
5510
+ # <link href="/ovirt-engine/api/datacenters/123/networks" rel="networks"/>
5511
+ # <link href="/ovirt-engine/api/datacenters/123/storagedomains" rel="storagedomains"/>
5512
+ # <link href="/ovirt-engine/api/datacenters/123/permissions" rel="permissions"/>
5513
+ # <link href="/ovirt-engine/api/datacenters/123/clusters" rel="clusters"/>
5514
+ # <link href="/ovirt-engine/api/datacenters/123/qoss" rel="qoss"/>
5515
+ # <link href="/ovirt-engine/api/datacenters/123/iscsibonds" rel="iscsibonds"/>
5516
+ # <link href="/ovirt-engine/api/datacenters/123/quotas" rel="quotas"/>
5517
+ # <local>false</local>
5518
+ # <quota_mode>disabled</quota_mode>
5519
+ # <status>up</status>
5520
+ # <supported_versions>
5521
+ # <version>
5522
+ # <major>4</major>
5523
+ # <minor>0</minor>
5524
+ # </version>
5525
+ # </supported_versions>
5526
+ # <version>
5527
+ # <major>4</major>
5528
+ # <minor>0</minor>
5529
+ # </version>
5530
+ # </data_center>
5531
+ # ----
5532
+ #
5533
+ # Note the `id` code of your `Default` data center. This code identifies this data center in relation to other
5534
+ # resources of your virtual environment.
5535
+ #
5536
+ # The data center also contains a link to the storage domains collection. The data center uses this collection to
5537
+ # attach storage domains from the storage domains main collection.
5289
5538
  #
5290
5539
  # @param opts [Hash] Additional options.
5291
5540
  #
@@ -5560,6 +5809,13 @@ module OvirtSDK4
5560
5809
  #
5561
5810
  # In this case the disk will be created and then attached to the virtual machine.
5562
5811
  #
5812
+ # In both cases, use the following URL for a virtual machine with an id `345`:
5813
+ #
5814
+ # [source]
5815
+ # ----
5816
+ # POST /ovirt-engine/api/vms/345/diskattachments
5817
+ # ----
5818
+ #
5563
5819
  # @param attachment [DiskAttachment] The `attachment` to add.
5564
5820
  #
5565
5821
  # @param opts [Hash] Additional options.
@@ -5581,7 +5837,7 @@ module OvirtSDK4
5581
5837
  end
5582
5838
  response = @connection.send(request)
5583
5839
  case response.code
5584
- when 201, 202
5840
+ when 200, 201, 202
5585
5841
  begin
5586
5842
  reader = XmlReader.new(response.body)
5587
5843
  return DiskAttachmentReader.read_one(reader)
@@ -5839,7 +6095,7 @@ module OvirtSDK4
5839
6095
  end
5840
6096
  response = @connection.send(request)
5841
6097
  case response.code
5842
- when 201, 202
6098
+ when 200, 201, 202
5843
6099
  begin
5844
6100
  reader = XmlReader.new(response.body)
5845
6101
  return DiskProfileReader.read_one(reader)
@@ -6111,7 +6367,31 @@ module OvirtSDK4
6111
6367
  end
6112
6368
 
6113
6369
  #
6114
- # Adds a new `disk`.
6370
+ # Adds a new floating disk.
6371
+ # When creating a new floating <<types/disk,Disk>>, the API requires the `storage_domain`, `provisioned_size` and
6372
+ # `format` attributes.
6373
+ #
6374
+ # To create a new floating disk with specified `provisioned_size`, `format` and `name` on a storage domain with an
6375
+ # id `e9fedf39-5edc-4e0a-8628-253f1b9c5693`, send a request as follows:
6376
+ #
6377
+ # [source]
6378
+ # ----
6379
+ # POST /ovirt-engine/api/disks
6380
+ # ----
6381
+ #
6382
+ # With a request body as follows:
6383
+ #
6384
+ # [source,xml]
6385
+ # ----
6386
+ # <disk>
6387
+ # <storage_domains>
6388
+ # <storage_domain id="e9fedf39-5edc-4e0a-8628-253f1b9c5693"/>
6389
+ # </storage_domains>
6390
+ # <name>disk1</name>
6391
+ # <provisioned_size>1048576</provisioned_size>
6392
+ # <format>cow</format>
6393
+ # </disk>
6394
+ # ----
6115
6395
  #
6116
6396
  # @param disk [Disk] The `disk` to add.
6117
6397
  #
@@ -6134,7 +6414,7 @@ module OvirtSDK4
6134
6414
  end
6135
6415
  response = @connection.send(request)
6136
6416
  case response.code
6137
- when 201, 202
6417
+ when 200, 201, 202
6138
6418
  begin
6139
6419
  reader = XmlReader.new(response.body)
6140
6420
  return DiskReader.read_one(reader)
@@ -6787,7 +7067,14 @@ module OvirtSDK4
6787
7067
  end
6788
7068
 
6789
7069
  #
6790
- # Deletes the object managed by this service.
7070
+ # Removes an event from internal audit log.
7071
+ #
7072
+ # An event can be removed by sending following request
7073
+ #
7074
+ # [source]
7075
+ # ----
7076
+ # DELETE /ovirt-engine/api/events/123
7077
+ # ----
6791
7078
  #
6792
7079
  # @param opts [Hash] Additional options.
6793
7080
  #
@@ -6905,7 +7192,7 @@ module OvirtSDK4
6905
7192
  end
6906
7193
  response = @connection.send(request)
6907
7194
  case response.code
6908
- when 201, 202
7195
+ when 200, 201, 202
6909
7196
  begin
6910
7197
  reader = XmlReader.new(response.body)
6911
7198
  return EventReader.read_one(reader)
@@ -6918,7 +7205,47 @@ module OvirtSDK4
6918
7205
  end
6919
7206
 
6920
7207
  #
6921
- # Returns the representation of the object managed by this service.
7208
+ # Get list of events.
7209
+ #
7210
+ # [source]
7211
+ # ----
7212
+ # GET /ovirt-engine/api/events
7213
+ # ----
7214
+ #
7215
+ # To the above request we get following reponse:
7216
+ #
7217
+ # [source,xml]
7218
+ # ----
7219
+ # <events>
7220
+ # <event href="/ovirt-engine/api/events/2" id="2">
7221
+ # <description>User admin@internal-authz logged out.</description>
7222
+ # <code>31</code>
7223
+ # <correlation_id>1e892ea9</correlation_id>
7224
+ # <custom_id>-1</custom_id>
7225
+ # <flood_rate>30</flood_rate>
7226
+ # <origin>oVirt</origin>
7227
+ # <severity>normal</severity>
7228
+ # <time>2016-09-14T12:14:34.541+02:00</time>
7229
+ # <user href="/ovirt-engine/api/users/57d91d48-00da-0137-0138-000000000244" id="57d91d48-00da-0137-0138-000000000244"/>
7230
+ # </event>
7231
+ # <event href="/ovirt-engine/api/events/1" id="1">
7232
+ # <description>User admin logged in.</description>
7233
+ # <code>30</code>
7234
+ # <correlation_id>1fbd81f4</correlation_id>
7235
+ # <custom_id>-1</custom_id>
7236
+ # <flood_rate>30</flood_rate>
7237
+ # <origin>oVirt</origin>
7238
+ # <severity>normal</severity>
7239
+ # <time>2016-09-14T11:54:35.229+02:00</time>
7240
+ # <user href="/ovirt-engine/api/users/57d91d48-00da-0137-0138-000000000244" id="57d91d48-00da-0137-0138-000000000244"/>
7241
+ # </event>
7242
+ # </events>
7243
+ # ----
7244
+ #
7245
+ # The following events occur:
7246
+ #
7247
+ # * id="1" - The API logs in the admin user account.
7248
+ # * id="2" - The API logs out of the admin user account.
6922
7249
  #
6923
7250
  # @param opts [Hash] Additional options.
6924
7251
  #
@@ -6941,7 +7268,68 @@ module OvirtSDK4
6941
7268
  #
6942
7269
  # @option opts [Integer] :max Sets the maximum number of events to return. If not specified all the events are returned.
6943
7270
  #
6944
- # @option opts [String] :search A query string used to restrict the returned events.
7271
+ # @option opts [String] :search The events service provides search queries similar to other resource services.
7272
+ #
7273
+ # We can search by providing specific severity.
7274
+ #
7275
+ # [source]
7276
+ # ----
7277
+ # GET /ovirt-engine/api/events?search=severity%3Dnormal
7278
+ # ----
7279
+ #
7280
+ # To the above request we get a list of events which severity is equal to `normal`:
7281
+ #
7282
+ # [source,xml]
7283
+ # ----
7284
+ # <events>
7285
+ # <event href="/ovirt-engine/api/events/2" id="2">
7286
+ # <description>User admin@internal-authz logged out.</description>
7287
+ # <code>31</code>
7288
+ # <correlation_id>1fbd81f4</correlation_id>
7289
+ # <custom_id>-1</custom_id>
7290
+ # <flood_rate>30</flood_rate>
7291
+ # <origin>oVirt</origin>
7292
+ # <severity>normal</severity>
7293
+ # <time>2016-09-14T11:54:35.229+02:00</time>
7294
+ # <user href="/ovirt-engine/api/users/57d91d48-00da-0137-0138-000000000244" id="57d91d48-00da-0137-0138-000000000244"/>
7295
+ # </event>
7296
+ # <event href="/ovirt-engine/api/events/1" id="1">
7297
+ # <description>Affinity Rules Enforcement Manager started.</description>
7298
+ # <code>10780</code>
7299
+ # <custom_id>-1</custom_id>
7300
+ # <flood_rate>30</flood_rate>
7301
+ # <origin>oVirt</origin>
7302
+ # <severity>normal</severity>
7303
+ # <time>2016-09-14T11:52:18.861+02:00</time>
7304
+ # </event>
7305
+ # </events>
7306
+ # ----
7307
+ #
7308
+ # A virtualization environment generates a large amount of events after
7309
+ # a period of time. However, the API only displays a default number of
7310
+ # events for one search query. To display more than the default, the API
7311
+ # separates results into pages with the page command in a search query.
7312
+ # The following search query tells the API to paginate results using a
7313
+ # page value in combination with the sortby clause:
7314
+ #
7315
+ # [source]
7316
+ # ----
7317
+ # sortby time asc page 1
7318
+ # ----
7319
+ #
7320
+ # Below example paginates event resources. The URL-encoded request is:
7321
+ #
7322
+ # [source]
7323
+ # ----
7324
+ # GET /ovirt-engine/api/events?search=sortby%20time%20asc%20page%201
7325
+ # ----
7326
+ #
7327
+ # Increase the page value to view the next page of results.
7328
+ #
7329
+ # [source]
7330
+ # ----
7331
+ # GET /ovirt-engine/api/events?search=sortby%20time%20asc%20page%202
7332
+ # ----
6945
7333
  #
6946
7334
  # @return [Array<Event>]
6947
7335
  #
@@ -7609,7 +7997,7 @@ module OvirtSDK4
7609
7997
  end
7610
7998
  response = @connection.send(request)
7611
7999
  case response.code
7612
- when 201, 202
8000
+ when 200, 201, 202
7613
8001
  begin
7614
8002
  reader = XmlReader.new(response.body)
7615
8003
  return ExternalHostProviderReader.read_one(reader)
@@ -8107,7 +8495,7 @@ module OvirtSDK4
8107
8495
  end
8108
8496
  response = @connection.send(request)
8109
8497
  case response.code
8110
- when 201, 202
8498
+ when 200, 201, 202
8111
8499
  begin
8112
8500
  reader = XmlReader.new(response.body)
8113
8501
  return ExternalVmImportReader.read_one(reader)
@@ -8312,7 +8700,7 @@ module OvirtSDK4
8312
8700
  end
8313
8701
  response = @connection.send(request)
8314
8702
  case response.code
8315
- when 201, 202
8703
+ when 200, 201, 202
8316
8704
  begin
8317
8705
  reader = XmlReader.new(response.body)
8318
8706
  return AgentReader.read_one(reader)
@@ -8694,7 +9082,7 @@ module OvirtSDK4
8694
9082
  end
8695
9083
  response = @connection.send(request)
8696
9084
  case response.code
8697
- when 201, 202
9085
+ when 200, 201, 202
8698
9086
  begin
8699
9087
  reader = XmlReader.new(response.body)
8700
9088
  return FilterReader.read_one(reader)
@@ -8859,7 +9247,7 @@ module OvirtSDK4
8859
9247
  end
8860
9248
  response = @connection.send(request)
8861
9249
  case response.code
8862
- when 201, 202
9250
+ when 200, 201, 202
8863
9251
  begin
8864
9252
  reader = XmlReader.new(response.body)
8865
9253
  return GlusterBrickReader.read_many(reader)
@@ -9334,7 +9722,7 @@ module OvirtSDK4
9334
9722
  end
9335
9723
  response = @connection.send(request)
9336
9724
  case response.code
9337
- when 201, 202
9725
+ when 200, 201, 202
9338
9726
  begin
9339
9727
  reader = XmlReader.new(response.body)
9340
9728
  return GlusterVolumeReader.read_one(reader)
@@ -9571,7 +9959,7 @@ module OvirtSDK4
9571
9959
  end
9572
9960
  response = @connection.send(request)
9573
9961
  case response.code
9574
- when 201, 202
9962
+ when 200, 201, 202
9575
9963
  begin
9576
9964
  reader = XmlReader.new(response.body)
9577
9965
  return GraphicsConsoleReader.read_one(reader)
@@ -9812,7 +10200,27 @@ module OvirtSDK4
9812
10200
  end
9813
10201
 
9814
10202
  #
9815
- # Adds a new `group`.
10203
+ # Add group from a directory service. Please note that domain name is name of the authorization provider.
10204
+ #
10205
+ # For example, to add the `Developers` group from the `internal-authz` authorization provider send a request
10206
+ # like this:
10207
+ #
10208
+ # [source]
10209
+ # ----
10210
+ # POST /ovirt-engine/api/groups
10211
+ # ----
10212
+ #
10213
+ # With a request body like this:
10214
+ #
10215
+ # [source,xml]
10216
+ # ----
10217
+ # <group>
10218
+ # <name>Developers</name>
10219
+ # <domain>
10220
+ # <name>internal-authz</name>
10221
+ # </domain>
10222
+ # </group>
10223
+ # ----
9816
10224
  #
9817
10225
  # @param group [Group] The `group` to add.
9818
10226
  #
@@ -9835,7 +10243,7 @@ module OvirtSDK4
9835
10243
  end
9836
10244
  response = @connection.send(request)
9837
10245
  case response.code
9838
- when 201, 202
10246
+ when 200, 201, 202
9839
10247
  begin
9840
10248
  reader = XmlReader.new(response.body)
9841
10249
  return GroupReader.read_one(reader)
@@ -10563,24 +10971,51 @@ module OvirtSDK4
10563
10971
  end
10564
10972
 
10565
10973
  #
10566
- # Creates a new host and adds it to the database. The host is created based on the properties of the `host`
10567
- # parameter. The `name`, `address` `rootPassword` properties are required.
10974
+ # Creates a new host.
10975
+ #
10976
+ # The host is created based on the attributes of the `host` parameter. The `name`, `address` and `root_password`
10977
+ # properties are required.
10978
+ #
10979
+ # For example, to add a host send the following request:
10980
+ #
10981
+ # [source]
10982
+ # ----
10983
+ # POST /ovirt-engine/api/hosts
10984
+ # ----
10985
+ #
10986
+ # With the following request body:
10987
+ #
10988
+ # [source,xml]
10989
+ # ----
10990
+ # <host>
10991
+ # <name>myhost</name>
10992
+ # <address>myhost.example.com</address>
10993
+ # <root_password>myrootpassword</root_password>
10994
+ # </host>
10995
+ # ----
10996
+ #
10997
+ # NOTE: The `root_password` element is only included in the client-provided initial representation and is not
10998
+ # exposed in the representations returned from subsequent requests.
10999
+ #
11000
+ # To add a hosted engine host, use the optional `deploy_hosted_engine` parameter:
11001
+ #
11002
+ # [source]
11003
+ # ----
11004
+ # POST /ovirt-engine/api/hosts?deploy_hosted_engine=true
11005
+ # ----
10568
11006
  #
10569
11007
  # @param host [Host] The host definition from which to create the new host is passed as parameter, and the newly created host
10570
11008
  # is returned.
10571
11009
  #
10572
11010
  # @param opts [Hash] Additional options.
10573
11011
  #
10574
- # @option opts [Boolean] :deploy_hosted_engine When set to `true` it means this host should deploy also hosted
10575
- # engine components. Missing value is treated as `true` i.e deploy.
10576
- # Omitting this parameter means `false` and will perform no operation
10577
- # in hosted engine area.
11012
+ # @option opts [Boolean] :deploy_hosted_engine When set to `true` it means this host should deploy also hosted engine components. Missing value is treated
11013
+ # as `true` i.e deploy. Omitting this parameter means `false` and will perform no operation in hosted engine
11014
+ # area.
10578
11015
  #
10579
- # @option opts [Boolean] :undeploy_hosted_engine When set to `true` it means this host should un-deploy hosted engine
10580
- # components and this host will not function as part of the High
10581
- # Availability cluster. Missing value is treated as `true` i.e un-deploy.
10582
- # Omitting this parameter means `false` and will perform no operation
10583
- # in hosted engine area.
11016
+ # @option opts [Boolean] :undeploy_hosted_engine When set to `true` it means this host should un-deploy hosted engine components and this host will not
11017
+ # function as part of the High Availability cluster. Missing value is treated as `true` i.e un-deploy.
11018
+ # Omitting this parameter means `false` and will perform no operation in hosted engine area.
10584
11019
  #
10585
11020
  # @return [Host]
10586
11021
  #
@@ -10609,7 +11044,7 @@ module OvirtSDK4
10609
11044
  end
10610
11045
  response = @connection.send(request)
10611
11046
  case response.code
10612
- when 201, 202
11047
+ when 200, 201, 202
10613
11048
  begin
10614
11049
  reader = XmlReader.new(response.body)
10615
11050
  return HostReader.read_one(reader)
@@ -10913,11 +11348,17 @@ module OvirtSDK4
10913
11348
  #
10914
11349
  # @option opts [Boolean] :async Indicates if the import should be performed asynchronously.
10915
11350
  #
10916
- # @option opts [Cluster] :cluster
11351
+ # @option opts [Cluster] :cluster Cluster where the image should be imported. Has effect only in case `import_as_template` parameter
11352
+ # is set to `true`.
10917
11353
  #
10918
- # @option opts [Disk] :disk
11354
+ # @option opts [Disk] :disk The disk which should be imported.
10919
11355
  #
10920
- # @option opts [Boolean] :import_as_template
11356
+ # @option opts [Boolean] :import_as_template Specify if template should be created from the imported disk.
11357
+ #
11358
+ # @option opts [StorageDomain] :storage_domain Storage domain where disk should be imported.
11359
+ #
11360
+ # @option opts [Template] :template Name of the template, which should be created. Has effect only in case `import_as_template` parameter
11361
+ # is set to `true`.
10921
11362
  #
10922
11363
  def import(opts = {})
10923
11364
  action = Action.new(opts)
@@ -11187,7 +11628,7 @@ module OvirtSDK4
11187
11628
  end
11188
11629
  response = @connection.send(request)
11189
11630
  case response.code
11190
- when 201, 202
11631
+ when 200, 201, 202
11191
11632
  begin
11192
11633
  reader = XmlReader.new(response.body)
11193
11634
  return ImageTransferReader.read_one(reader)
@@ -11690,7 +12131,7 @@ module OvirtSDK4
11690
12131
  end
11691
12132
  response = @connection.send(request)
11692
12133
  case response.code
11693
- when 201, 202
12134
+ when 200, 201, 202
11694
12135
  begin
11695
12136
  reader = XmlReader.new(response.body)
11696
12137
  return NicReader.read_one(reader)
@@ -11941,7 +12382,7 @@ module OvirtSDK4
11941
12382
  end
11942
12383
  response = @connection.send(request)
11943
12384
  case response.code
11944
- when 201, 202
12385
+ when 200, 201, 202
11945
12386
  begin
11946
12387
  reader = XmlReader.new(response.body)
11947
12388
  return WatchdogReader.read_one(reader)
@@ -12064,7 +12505,7 @@ module OvirtSDK4
12064
12505
  end
12065
12506
  response = @connection.send(request)
12066
12507
  case response.code
12067
- when 201, 202
12508
+ when 200, 201, 202
12068
12509
  begin
12069
12510
  reader = XmlReader.new(response.body)
12070
12511
  return InstanceTypeReader.read_one(reader)
@@ -12188,7 +12629,14 @@ module OvirtSDK4
12188
12629
  end
12189
12630
 
12190
12631
  #
12191
- # Deletes the object managed by this service.
12632
+ # Removes of an exisitng iSCSI bond.
12633
+ #
12634
+ # For example, to remove the iSCSI bond `456` send a request like this:
12635
+ #
12636
+ # [source]
12637
+ # ----
12638
+ # DELETE /ovirt-engine/api/datacenters/123/iscsibonds/456
12639
+ # ----
12192
12640
  #
12193
12641
  # @param opts [Hash] Additional options.
12194
12642
  #
@@ -12208,12 +12656,30 @@ module OvirtSDK4
12208
12656
  end
12209
12657
 
12210
12658
  #
12211
- # Updates the `bond`.
12659
+ # Updates an iSCSI bond.
12212
12660
  #
12213
- # @param bond [IscsiBond] The `bond` to update.
12214
- # @param opts [Hash] Additional options.
12215
- #
12216
- # @option opts [Boolean] :async Indicates if the update should be performed asynchronously.
12661
+ # Updating of an iSCSI bond can be done on the `name` and the `description` attributes only. For example, to
12662
+ # update the iSCSI bond `456` of data center `123`, send a request like this:
12663
+ #
12664
+ # [source]
12665
+ # ----
12666
+ # PUT /ovirt-engine/api/datacenters/123/iscsibonds/1234
12667
+ # ----
12668
+ #
12669
+ # The request body should look like this:
12670
+ #
12671
+ # [source,xml]
12672
+ # ----
12673
+ # <iscsi_bond>
12674
+ # <name>mybond</name>
12675
+ # <description>My iSCSI bond</description>
12676
+ # </iscsi_bond>
12677
+ # ----
12678
+ #
12679
+ # @param bond [IscsiBond] The `bond` to update.
12680
+ # @param opts [Hash] Additional options.
12681
+ #
12682
+ # @option opts [Boolean] :async Indicates if the update should be performed asynchronously.
12217
12683
  #
12218
12684
  # @return [IscsiBond]
12219
12685
  #
@@ -12320,7 +12786,31 @@ module OvirtSDK4
12320
12786
  end
12321
12787
 
12322
12788
  #
12323
- # Adds a new `bond`.
12789
+ # Create a new iSCSI bond on a data center.
12790
+ #
12791
+ # For example, to create a new iSCSI bond on data center `123` using storage connections `456` and `789`, send a
12792
+ # request like this:
12793
+ #
12794
+ # [source]
12795
+ # ----
12796
+ # POST /ovirt-engine/api/datacenters/123/iscsibonds
12797
+ # ----
12798
+ #
12799
+ # The request body should look like this:
12800
+ #
12801
+ # [source,xml]
12802
+ # ----
12803
+ # <iscsi_bond>
12804
+ # <name>mybond</name>
12805
+ # <storage_connections>
12806
+ # <storage_connection id="456"/>
12807
+ # <storage_connection id="789"/>
12808
+ # </storage_connections>
12809
+ # <networks>
12810
+ # <network id="abc"/>
12811
+ # </networks>
12812
+ # </iscsi_bond>
12813
+ # ----
12324
12814
  #
12325
12815
  # @param bond [IscsiBond] The `bond` to add.
12326
12816
  #
@@ -12343,7 +12833,7 @@ module OvirtSDK4
12343
12833
  end
12344
12834
  response = @connection.send(request)
12345
12835
  case response.code
12346
- when 201, 202
12836
+ when 200, 201, 202
12347
12837
  begin
12348
12838
  reader = XmlReader.new(response.body)
12349
12839
  return IscsiBondReader.read_one(reader)
@@ -12601,7 +13091,7 @@ module OvirtSDK4
12601
13091
  end
12602
13092
  response = @connection.send(request)
12603
13093
  case response.code
12604
- when 201, 202
13094
+ when 200, 201, 202
12605
13095
  begin
12606
13096
  reader = XmlReader.new(response.body)
12607
13097
  return JobReader.read_one(reader)
@@ -12877,7 +13367,14 @@ module OvirtSDK4
12877
13367
  end
12878
13368
 
12879
13369
  #
12880
- # Deletes the object managed by this service.
13370
+ # Removes a MAC address pool.
13371
+ #
13372
+ # For example, to remove the MAC address pool having id `123` send a request like this:
13373
+ #
13374
+ # [source]
13375
+ # ----
13376
+ # DELETE /ovirt-engine/api/macpools/123
13377
+ # ----
12881
13378
  #
12882
13379
  # @param opts [Hash] Additional options.
12883
13380
  #
@@ -12897,7 +13394,37 @@ module OvirtSDK4
12897
13394
  end
12898
13395
 
12899
13396
  #
12900
- # Updates the `pool`.
13397
+ # Updates a MAC address pool.
13398
+ #
13399
+ # The `name`, `description`, `allow_duplicates`, and `ranges` attributes can be updated.
13400
+ #
13401
+ # For example, to update the MAC address pool of id `123` send a request like this:
13402
+ #
13403
+ # [source]
13404
+ # ----
13405
+ # PUT /ovirt-engine/api/macpools/123
13406
+ # ----
13407
+ #
13408
+ # With a request body like this:
13409
+ #
13410
+ # [source,xml]
13411
+ # ----
13412
+ # <mac_pool>
13413
+ # <name>UpdatedMACPool</name>
13414
+ # <description>An updated MAC address pool</description>
13415
+ # <allow_duplicates>false</allow_duplicates>
13416
+ # <ranges>
13417
+ # <range>
13418
+ # <from>00:1A:4A:16:01:51</from>
13419
+ # <to>00:1A:4A:16:01:e6</to>
13420
+ # </range>
13421
+ # <range>
13422
+ # <from>02:1A:4A:01:00:00</from>
13423
+ # <to>02:1A:4A:FF:FF:FF</to>
13424
+ # </range>
13425
+ # </ranges>
13426
+ # </mac_pool>
13427
+ # ----
12901
13428
  #
12902
13429
  # @param pool [MacPool] The `pool` to update.
12903
13430
  # @param opts [Hash] Additional options.
@@ -12981,7 +13508,34 @@ module OvirtSDK4
12981
13508
  end
12982
13509
 
12983
13510
  #
12984
- # Adds a new `pool`.
13511
+ # Creates a new MAC address pool.
13512
+ #
13513
+ # Creation of a MAC address pool requires values for the `name` and `ranges` attributes.
13514
+ #
13515
+ # For example, to create MAC address pool send a request like this:
13516
+ #
13517
+ # [source]
13518
+ # ----
13519
+ # POST /ovirt-engine/api/macpools
13520
+ # ----
13521
+ #
13522
+ # With a request body like this:
13523
+ #
13524
+ # [source,xml]
13525
+ # ----
13526
+ # <mac_pool>
13527
+ # <name>MACPool</name>
13528
+ # <description>A MAC address pool</description>
13529
+ # <allow_duplicates>true</allow_duplicates>
13530
+ # <default_pool>false</default_pool>
13531
+ # <ranges>
13532
+ # <range>
13533
+ # <from>00:1A:4A:16:01:51</from>
13534
+ # <to>00:1A:4A:16:01:e6</to>
13535
+ # </range>
13536
+ # </ranges>
13537
+ # </mac_pool>
13538
+ # ----
12985
13539
  #
12986
13540
  # @param pool [MacPool] The `pool` to add.
12987
13541
  #
@@ -13004,7 +13558,7 @@ module OvirtSDK4
13004
13558
  end
13005
13559
  response = @connection.send(request)
13006
13560
  case response.code
13007
- when 201, 202
13561
+ when 200, 201, 202
13008
13562
  begin
13009
13563
  reader = XmlReader.new(response.body)
13010
13564
  return MacPoolReader.read_one(reader)
@@ -13251,7 +13805,14 @@ module OvirtSDK4
13251
13805
  end
13252
13806
 
13253
13807
  #
13254
- # Deletes the object managed by this service.
13808
+ # Removes a logical network.
13809
+ #
13810
+ # For example, to remove the logical network `123` send a request like this:
13811
+ #
13812
+ # [source]
13813
+ # ----
13814
+ # DELETE /ovirt-engine/api/networks/123
13815
+ # ----
13255
13816
  #
13256
13817
  # @param opts [Hash] Additional options.
13257
13818
  #
@@ -13271,7 +13832,25 @@ module OvirtSDK4
13271
13832
  end
13272
13833
 
13273
13834
  #
13274
- # Updates the `network`.
13835
+ # Updates a logical network.
13836
+ #
13837
+ # The `name`, `description`, `ip`, `vlan`, `stp` and `display` attributes can be updated.
13838
+ # ⁠
13839
+ # For example, to update the description of the logcial network `123` send a request like this:
13840
+ #
13841
+ # [source]
13842
+ # ----
13843
+ # PUT /ovirt-engine/api/networks/123
13844
+ # ----
13845
+ #
13846
+ # With a request body like this:
13847
+ #
13848
+ # [source,xml]
13849
+ # ----
13850
+ # <network>
13851
+ # <description>My updated description</description>
13852
+ # </network>
13853
+ # ----
13275
13854
  #
13276
13855
  # @param network [Network] The `network` to update.
13277
13856
  # @param opts [Hash] Additional options.
@@ -13548,7 +14127,7 @@ module OvirtSDK4
13548
14127
  end
13549
14128
  response = @connection.send(request)
13550
14129
  case response.code
13551
- when 201, 202
14130
+ when 200, 201, 202
13552
14131
  begin
13553
14132
  reader = XmlReader.new(response.body)
13554
14133
  return NetworkAttachmentReader.read_one(reader)
@@ -13817,7 +14396,14 @@ module OvirtSDK4
13817
14396
  end
13818
14397
 
13819
14398
  #
13820
- # Deletes the object managed by this service.
14399
+ # Removes a label from a logical network.
14400
+ #
14401
+ # For example, to remove the label `exemplary` from a logical network having id `123` send the following request:
14402
+ #
14403
+ # [source]
14404
+ # ----
14405
+ # DELETE /ovirt-engine/api/networks/123/labels/exemplary
14406
+ # ----
13821
14407
  #
13822
14408
  # @param opts [Hash] Additional options.
13823
14409
  #
@@ -13878,7 +14464,24 @@ module OvirtSDK4
13878
14464
  end
13879
14465
 
13880
14466
  #
13881
- # Adds a new `label`.
14467
+ # Attaches label to logical network.
14468
+ #
14469
+ # You can attach labels to a logical network to automate the association of that logical network with physical host
14470
+ # network interfaces to which the same label has been attached.
14471
+ # ⁠
14472
+ # For example, to attach the label `mylabel` to a logical network having id `123` send a request like this:
14473
+ #
14474
+ # [source]
14475
+ # ----
14476
+ # POST /ovirt-engine/api/networks/123/labels
14477
+ # ----
14478
+ #
14479
+ # With a request body like this:
14480
+ #
14481
+ # [source,xml]
14482
+ # ----
14483
+ # <label id="mylabel"/>
14484
+ # ----
13882
14485
  #
13883
14486
  # @param label [NetworkLabel] The `label` to add.
13884
14487
  #
@@ -13901,7 +14504,7 @@ module OvirtSDK4
13901
14504
  end
13902
14505
  response = @connection.send(request)
13903
14506
  case response.code
13904
- when 201, 202
14507
+ when 200, 201, 202
13905
14508
  begin
13906
14509
  reader = XmlReader.new(response.body)
13907
14510
  return NetworkLabelReader.read_one(reader)
@@ -14001,7 +14604,26 @@ module OvirtSDK4
14001
14604
  end
14002
14605
 
14003
14606
  #
14004
- # Adds a new `network`.
14607
+ # Creates new logical network.
14608
+ #
14609
+ # Creation of a new network requires the `name` and `data_center` elements.
14610
+ #
14611
+ # For example, to create a network named `mynetwork` for data center `123` send a request like this:
14612
+ #
14613
+ # [source]
14614
+ # ----
14615
+ # POST /ovirt-engine/api/networks
14616
+ # ----
14617
+ #
14618
+ # With a request body like this:
14619
+ #
14620
+ # [source,xml]
14621
+ # ----
14622
+ # <network>
14623
+ # <name>mynetwork</name>
14624
+ # <data_center id="123"/>
14625
+ # </network>
14626
+ # ----
14005
14627
  #
14006
14628
  # @param network [Network] The `network` to add.
14007
14629
  #
@@ -14024,7 +14646,7 @@ module OvirtSDK4
14024
14646
  end
14025
14647
  response = @connection.send(request)
14026
14648
  case response.code
14027
- when 201, 202
14649
+ when 200, 201, 202
14028
14650
  begin
14029
14651
  reader = XmlReader.new(response.body)
14030
14652
  return NetworkReader.read_one(reader)
@@ -14037,7 +14659,36 @@ module OvirtSDK4
14037
14659
  end
14038
14660
 
14039
14661
  #
14040
- # Returns the representation of the object managed by this service.
14662
+ # List logical networks.
14663
+ #
14664
+ # For example:
14665
+ #
14666
+ # [source]
14667
+ # ----
14668
+ # GET /ovirt-engine/api/networks
14669
+ # ----
14670
+ #
14671
+ # Will respond:
14672
+ #
14673
+ # [source,xml]
14674
+ # ----
14675
+ # <networks>
14676
+ # <network href="/ovirt-engine/api/networks/123" id="123">
14677
+ # <name>ovirtmgmt</name>
14678
+ # <description>Default Management Network</description>
14679
+ # <link href="/ovirt-engine/api/networks/123/permissions" rel="permissions"/>
14680
+ # <link href="/ovirt-engine/api/networks/123/vnicprofiles" rel="vnicprofiles"/>
14681
+ # <link href="/ovirt-engine/api/networks/123/networklabels" rel="networklabels"/>
14682
+ # <mtu>0</mtu>
14683
+ # <stp>false</stp>
14684
+ # <usages>
14685
+ # <usage>vm</usage>
14686
+ # </usages>
14687
+ # <data_center href="/ovirt-engine/api/datacenters/456" id="456"/>
14688
+ # </network>
14689
+ # ...
14690
+ # </networks>
14691
+ # ----
14041
14692
  #
14042
14693
  # @param opts [Hash] Additional options.
14043
14694
  #
@@ -14163,15 +14814,40 @@ module OvirtSDK4
14163
14814
  end
14164
14815
 
14165
14816
  #
14166
- # Executes the `import` method.
14817
+ # Imports a virtual machine from a Glance image storage domain.
14818
+ #
14819
+ # For example, to import the image with identifier `456` from the
14820
+ # storage domain with identifier `123` send a request like this:
14821
+ #
14822
+ # [source]
14823
+ # ----
14824
+ # POST /ovirt-engine/api/openstackimageproviders/123/images/456/import
14825
+ # ----
14826
+ #
14827
+ # With a request body like this:
14828
+ #
14829
+ # [source,xml]
14830
+ # ----
14831
+ # <action>
14832
+ # <storage_domain>
14833
+ # <name>images0</name>
14834
+ # </storage_domain>
14835
+ # <cluster>
14836
+ # <name>images0</name>
14837
+ # </cluster>
14838
+ # </action>
14839
+ # ----
14167
14840
  #
14168
14841
  # @param opts [Hash] Additional options.
14169
14842
  #
14170
14843
  # @option opts [Boolean] :async Indicates if the import should be performed asynchronously.
14171
14844
  #
14845
+ # @option opts [Cluster] :cluster This parameter is mandatory in case of using `import_as_template` and indicates which cluster should be used
14846
+ # for import glance image as template.
14847
+ #
14172
14848
  # @option opts [Disk] :disk
14173
14849
  #
14174
- # @option opts [Boolean] :import_as_template
14850
+ # @option opts [Boolean] :import_as_template Indicates whether the image should be imported as a template.
14175
14851
  #
14176
14852
  # @option opts [StorageDomain] :storage_domain
14177
14853
  #
@@ -14472,7 +15148,7 @@ module OvirtSDK4
14472
15148
  end
14473
15149
  response = @connection.send(request)
14474
15150
  case response.code
14475
- when 201, 202
15151
+ when 200, 201, 202
14476
15152
  begin
14477
15153
  reader = XmlReader.new(response.body)
14478
15154
  return OpenStackImageProviderReader.read_one(reader)
@@ -14572,7 +15248,7 @@ module OvirtSDK4
14572
15248
  end
14573
15249
 
14574
15250
  #
14575
- # Returns the representation of the object managed by this service.
15251
+ # Lists the images of a Glance image storage domain.
14576
15252
  #
14577
15253
  # @param opts [Hash] Additional options.
14578
15254
  #
@@ -14603,7 +15279,7 @@ module OvirtSDK4
14603
15279
  end
14604
15280
 
14605
15281
  #
14606
- # Locates the `image` service.
15282
+ # Returns a reference to the service that manages a specific image.
14607
15283
  #
14608
15284
  # @param id [String] The identifier of the `image`.
14609
15285
  #
@@ -15005,7 +15681,7 @@ module OvirtSDK4
15005
15681
  end
15006
15682
  response = @connection.send(request)
15007
15683
  case response.code
15008
- when 201, 202
15684
+ when 200, 201, 202
15009
15685
  begin
15010
15686
  reader = XmlReader.new(response.body)
15011
15687
  return OpenStackNetworkProviderReader.read_one(reader)
@@ -15300,7 +15976,7 @@ module OvirtSDK4
15300
15976
  end
15301
15977
  response = @connection.send(request)
15302
15978
  case response.code
15303
- when 201, 202
15979
+ when 200, 201, 202
15304
15980
  begin
15305
15981
  reader = XmlReader.new(response.body)
15306
15982
  return OpenStackSubnetReader.read_one(reader)
@@ -15544,7 +16220,7 @@ module OvirtSDK4
15544
16220
  end
15545
16221
  response = @connection.send(request)
15546
16222
  case response.code
15547
- when 201, 202
16223
+ when 200, 201, 202
15548
16224
  begin
15549
16225
  reader = XmlReader.new(response.body)
15550
16226
  return OpenstackVolumeAuthenticationKeyReader.read_one(reader)
@@ -15868,7 +16544,31 @@ module OvirtSDK4
15868
16544
  end
15869
16545
 
15870
16546
  #
15871
- # Adds a new `provider`.
16547
+ # Adds a new volume provider.
16548
+ #
16549
+ # For example:
16550
+ #
16551
+ # [source]
16552
+ # ----
16553
+ # POST /ovirt-engine/api/openstackvolumeproviders
16554
+ # ----
16555
+ #
16556
+ # With a request body like this:
16557
+ #
16558
+ # [source,xml]
16559
+ # ----
16560
+ # <openstack_volume_provider>
16561
+ # <name>mycinder</name>
16562
+ # <url>https://mycinder.example.com:8776</url>
16563
+ # <data_center>
16564
+ # <name>mydc</name>
16565
+ # </data_center>
16566
+ # <requires_authentication>true</requires_authentication>
16567
+ # <username>admin</username>
16568
+ # <password>mypassword</password>
16569
+ # <tenant_name>mytenant</tenant_name>
16570
+ # </openstack_volume_provider>
16571
+ # ----
15872
16572
  #
15873
16573
  # @param provider [OpenStackVolumeProvider] The `provider` to add.
15874
16574
  #
@@ -15891,7 +16591,7 @@ module OvirtSDK4
15891
16591
  end
15892
16592
  response = @connection.send(request)
15893
16593
  case response.code
15894
- when 201, 202
16594
+ when 200, 201, 202
15895
16595
  begin
15896
16596
  reader = XmlReader.new(response.body)
15897
16597
  return OpenStackVolumeProviderReader.read_one(reader)
@@ -15904,7 +16604,7 @@ module OvirtSDK4
15904
16604
  end
15905
16605
 
15906
16606
  #
15907
- # Returns the representation of the object managed by this service.
16607
+ # Retrieves the list of volume providers.
15908
16608
  #
15909
16609
  # @param opts [Hash] Additional options.
15910
16610
  #
@@ -16489,7 +17189,7 @@ module OvirtSDK4
16489
17189
  end
16490
17190
  response = @connection.send(request)
16491
17191
  case response.code
16492
- when 201, 202
17192
+ when 200, 201, 202
16493
17193
  begin
16494
17194
  reader = XmlReader.new(response.body)
16495
17195
  return PermitReader.read_one(reader)
@@ -16740,7 +17440,7 @@ module OvirtSDK4
16740
17440
  end
16741
17441
  response = @connection.send(request)
16742
17442
  case response.code
16743
- when 201, 202
17443
+ when 200, 201, 202
16744
17444
  begin
16745
17445
  reader = XmlReader.new(response.body)
16746
17446
  return QosReader.read_one(reader)
@@ -16840,7 +17540,26 @@ module OvirtSDK4
16840
17540
  end
16841
17541
 
16842
17542
  #
16843
- # Returns the representation of the object managed by this service.
17543
+ # Retrieves a quota.
17544
+ #
17545
+ # An example of retrieving a quota:
17546
+ #
17547
+ # [source]
17548
+ # ----
17549
+ # GET /ovirt-engine/api/datacenters/123/quotas/456
17550
+ # ----
17551
+ #
17552
+ # [source,xml]
17553
+ # ----
17554
+ # <quota id="456">
17555
+ # <name>myquota</name>
17556
+ # <description>My new quota for virtual machines</description>
17557
+ # <cluster_hard_limit_pct>20</cluster_hard_limit_pct>
17558
+ # <cluster_soft_limit_pct>80</cluster_soft_limit_pct>
17559
+ # <storage_hard_limit_pct>20</storage_hard_limit_pct>
17560
+ # <storage_soft_limit_pct>80</storage_soft_limit_pct>
17561
+ # </quota>
17562
+ # ----
16844
17563
  #
16845
17564
  # @param opts [Hash] Additional options.
16846
17565
  #
@@ -16864,7 +17583,17 @@ module OvirtSDK4
16864
17583
  end
16865
17584
 
16866
17585
  #
16867
- # Deletes the object managed by this service.
17586
+ # Delete a quota.
17587
+ #
17588
+ # An example of deleting a quota:
17589
+ #
17590
+ # [source]
17591
+ # ----
17592
+ # DELETE /ovirt-engine/api/datacenters/123-456/quotas/654-321
17593
+ # -0472718ab224 HTTP/1.1
17594
+ # Accept: application/xml
17595
+ # Content-type: application/xml
17596
+ # ----
16868
17597
  #
16869
17598
  # @param opts [Hash] Additional options.
16870
17599
  #
@@ -16884,7 +17613,24 @@ module OvirtSDK4
16884
17613
  end
16885
17614
 
16886
17615
  #
16887
- # Updates the `quota`.
17616
+ # Updates a quota.
17617
+ #
17618
+ # An example of updating a quota:
17619
+ #
17620
+ # [source]
17621
+ # ----
17622
+ # PUT /ovirt-engine/api/datacenters/123/quotas/456
17623
+ # ----
17624
+ #
17625
+ # [source,xml]
17626
+ # ----
17627
+ # <quota>
17628
+ # <cluster_hard_limit_pct>30</cluster_hard_limit_pct>
17629
+ # <cluster_soft_limit_pct>70</cluster_soft_limit_pct>
17630
+ # <storage_hard_limit_pct>20</storage_hard_limit_pct>
17631
+ # <storage_soft_limit_pct>80</storage_soft_limit_pct>
17632
+ # </quota>
17633
+ # ----
16888
17634
  #
16889
17635
  # @param quota [Quota] The `quota` to update.
16890
17636
  # @param opts [Hash] Additional options.
@@ -17118,7 +17864,7 @@ module OvirtSDK4
17118
17864
  end
17119
17865
  response = @connection.send(request)
17120
17866
  case response.code
17121
- when 201, 202
17867
+ when 200, 201, 202
17122
17868
  begin
17123
17869
  reader = XmlReader.new(response.body)
17124
17870
  return QuotaClusterLimitReader.read_one(reader)
@@ -17326,7 +18072,7 @@ module OvirtSDK4
17326
18072
  end
17327
18073
  response = @connection.send(request)
17328
18074
  case response.code
17329
- when 201, 202
18075
+ when 200, 201, 202
17330
18076
  begin
17331
18077
  reader = XmlReader.new(response.body)
17332
18078
  return QuotaStorageLimitReader.read_one(reader)
@@ -17426,7 +18172,22 @@ module OvirtSDK4
17426
18172
  end
17427
18173
 
17428
18174
  #
17429
- # Adds a new `quota`.
18175
+ # Creates a new quota.
18176
+ #
18177
+ # An example of creating a new quota:
18178
+ #
18179
+ # [source]
18180
+ # ----
18181
+ # POST /ovirt-engine/api/datacenters/123/quotas
18182
+ # ----
18183
+ #
18184
+ # [source,xml]
18185
+ # ----
18186
+ # <quota>
18187
+ # <name>myquota</name>
18188
+ # <description>My new quota for virtual machines</description>
18189
+ # </quota>
18190
+ # ----
17430
18191
  #
17431
18192
  # @param quota [Quota] The `quota` to add.
17432
18193
  #
@@ -17449,7 +18210,7 @@ module OvirtSDK4
17449
18210
  end
17450
18211
  response = @connection.send(request)
17451
18212
  case response.code
17452
- when 201, 202
18213
+ when 200, 201, 202
17453
18214
  begin
17454
18215
  reader = XmlReader.new(response.body)
17455
18216
  return QuotaReader.read_one(reader)
@@ -17462,7 +18223,7 @@ module OvirtSDK4
17462
18223
  end
17463
18224
 
17464
18225
  #
17465
- # Returns the representation of the object managed by this service.
18226
+ # Lists quotas of a data center
17466
18227
  #
17467
18228
  # @param opts [Hash] Additional options.
17468
18229
  #
@@ -17573,7 +18334,14 @@ module OvirtSDK4
17573
18334
  end
17574
18335
 
17575
18336
  #
17576
- # Deletes the object managed by this service.
18337
+ # Removes the role.
18338
+ #
18339
+ # To remove the role you need to know its id, then send request like this:
18340
+ #
18341
+ # [source]
18342
+ # ----
18343
+ # DELETE /ovirt-engine/api/roles/{role_id}
18344
+ # ----
17577
18345
  #
17578
18346
  # @param opts [Hash] Additional options.
17579
18347
  #
@@ -17593,7 +18361,27 @@ module OvirtSDK4
17593
18361
  end
17594
18362
 
17595
18363
  #
17596
- # Updates the `role`.
18364
+ # Updates a role. You are allowed to update `name`, `description` and `administrative` attributes after role is
18365
+ # created. Within this endpoint you can't add or remove roles permits you need to use
18366
+ # <<services/permits, service>> that manages permits of role.
18367
+ #
18368
+ # For example to update role's `name`, `description` and `administrative` attributes send a request like this:
18369
+ #
18370
+ # [source]
18371
+ # ----
18372
+ # PUT /ovirt-engine/api/roles/123
18373
+ # ----
18374
+ #
18375
+ # With a request body like this:
18376
+ #
18377
+ # [source,xml]
18378
+ # ----
18379
+ # <role>
18380
+ # <name>MyNewRoleName</name>
18381
+ # <description>My new description of the role</description>
18382
+ # <administrative>true</administrative>
18383
+ # </group>
18384
+ # ----
17597
18385
  #
17598
18386
  # @param role [Role] The `role` to update.
17599
18387
  # @param opts [Hash] Additional options.
@@ -17691,7 +18479,30 @@ module OvirtSDK4
17691
18479
  end
17692
18480
 
17693
18481
  #
17694
- # Adds a new `role`.
18482
+ # Create a new role. The role can be administrative or non-administrative and can have different permits.
18483
+ #
18484
+ # For example, to add the `MyRole` non-administrative role with permits to login and create virtual machines
18485
+ # send a request like this (note that you have to pass permit id):
18486
+ #
18487
+ # [source]
18488
+ # ----
18489
+ # POST /ovirt-engine/api/roles
18490
+ # ----
18491
+ #
18492
+ # With a request body like this:
18493
+ #
18494
+ # [source,xml]
18495
+ # ----
18496
+ # <role>
18497
+ # <name>MyRole</name>
18498
+ # <description>My custom role to create virtual machines</description>
18499
+ # <administrative>false</administrative>
18500
+ # <permits>
18501
+ # <permit id="1"/>
18502
+ # <permit id="1300"/>
18503
+ # </permits>
18504
+ # </group>
18505
+ # ----
17695
18506
  #
17696
18507
  # @param role [Role] The `role` to add.
17697
18508
  #
@@ -17714,7 +18525,7 @@ module OvirtSDK4
17714
18525
  end
17715
18526
  response = @connection.send(request)
17716
18527
  case response.code
17717
- when 201, 202
18528
+ when 200, 201, 202
17718
18529
  begin
17719
18530
  reader = XmlReader.new(response.body)
17720
18531
  return RoleReader.read_one(reader)
@@ -17837,7 +18648,7 @@ module OvirtSDK4
17837
18648
  end
17838
18649
  response = @connection.send(request)
17839
18650
  case response.code
17840
- when 201, 202
18651
+ when 200, 201, 202
17841
18652
  begin
17842
18653
  reader = XmlReader.new(response.body)
17843
18654
  return SchedulingPolicyReader.read_one(reader)
@@ -18351,7 +19162,22 @@ module OvirtSDK4
18351
19162
  end
18352
19163
 
18353
19164
  #
18354
- # Executes the `restore` method.
19165
+ # Restores a virtual machine snapshot.
19166
+ #
19167
+ # For example, to restore the snapshot with identifier `456` of virtual machine with identifier `123` send a
19168
+ # request like this:
19169
+ #
19170
+ # [source]
19171
+ # ----
19172
+ # POST /ovirt-engine/api/vms/123/snapshots/456/restore
19173
+ # ----
19174
+ #
19175
+ # With an empty `action` in the body:
19176
+ #
19177
+ # [source,xml]
19178
+ # ----
19179
+ # <action/>
19180
+ # ----
18355
19181
  #
18356
19182
  # @param opts [Hash] Additional options.
18357
19183
  #
@@ -18921,7 +19747,23 @@ module OvirtSDK4
18921
19747
  end
18922
19748
 
18923
19749
  #
18924
- # Adds a new `snapshot`.
19750
+ # Creates a virtual machine snapshot.
19751
+ #
19752
+ # For example, to create a new snapshot for virtual machine `123` send a request like this:
19753
+ #
19754
+ # [source]
19755
+ # ----
19756
+ # POST /ovirt-engine/api/vms/123/snapshots
19757
+ # ----
19758
+ #
19759
+ # With a request body like this:
19760
+ #
19761
+ # [source,xml]
19762
+ # ----
19763
+ # <snapshot>
19764
+ # <description>My snapshot</description>
19765
+ # </snapshot>
19766
+ # ----
18925
19767
  #
18926
19768
  # @param snapshot [Snapshot] The `snapshot` to add.
18927
19769
  #
@@ -18944,7 +19786,7 @@ module OvirtSDK4
18944
19786
  end
18945
19787
  response = @connection.send(request)
18946
19788
  case response.code
18947
- when 201, 202
19789
+ when 200, 201, 202
18948
19790
  begin
18949
19791
  reader = XmlReader.new(response.body)
18950
19792
  return SnapshotReader.read_one(reader)
@@ -19195,7 +20037,7 @@ module OvirtSDK4
19195
20037
  end
19196
20038
  response = @connection.send(request)
19197
20039
  case response.code
19198
- when 201, 202
20040
+ when 200, 201, 202
19199
20041
  begin
19200
20042
  reader = XmlReader.new(response.body)
19201
20043
  return SshPublicKeyReader.read_one(reader)
@@ -19586,7 +20428,7 @@ module OvirtSDK4
19586
20428
  end
19587
20429
  response = @connection.send(request)
19588
20430
  case response.code
19589
- when 201, 202
20431
+ when 200, 201, 202
19590
20432
  begin
19591
20433
  reader = XmlReader.new(response.body)
19592
20434
  return StepReader.read_one(reader)
@@ -19869,13 +20711,37 @@ module OvirtSDK4
19869
20711
  end
19870
20712
 
19871
20713
  #
19872
- # Executes the `refresh_luns` method.
20714
+ # This operation refreshes the LUN size.
20715
+ #
20716
+ # After increasing the size of the underlying LUN on the storage server,
20717
+ # the user can refresh the LUN size.
20718
+ # This action forces a rescan of the provided LUNs and
20719
+ # updates the database with the new size if required.
20720
+ #
20721
+ # For example, in order to refresh the size of two LUNs send a request like this:
20722
+ #
20723
+ # [source]
20724
+ # ----
20725
+ # POST /ovirt-engine/api/storagedomains/262b056b-aede-40f1-9666-b883eff59d40/refreshluns
20726
+ # ----
20727
+ #
20728
+ # With a request body like this:
20729
+ #
20730
+ # [source,xml]
20731
+ # ----
20732
+ # <action>
20733
+ # <logical_units>
20734
+ # <logical_unit id="1IET_00010001"/>
20735
+ # <logical_unit id="1IET_00010002"/>
20736
+ # </logical_units>
20737
+ # </action>
20738
+ # ----
19873
20739
  #
19874
20740
  # @param opts [Hash] Additional options.
19875
20741
  #
19876
20742
  # @option opts [Boolean] :async Indicates if the refresh should be performed asynchronously.
19877
20743
  #
19878
- # @option opts [Array<LogicalUnit>] :logical_units
20744
+ # @option opts [Array<LogicalUnit>] :logical_units The LUNs that need to be refreshed.
19879
20745
  #
19880
20746
  def refresh_luns(opts = {})
19881
20747
  action = Action.new(opts)
@@ -19916,9 +20782,19 @@ module OvirtSDK4
19916
20782
  # @option opts [Boolean] :destroy Indicates if the operation should succeed, and the storage domain removed from the database, even if the
19917
20783
  # storage isn't accessible.
19918
20784
  #
20785
+ # [source]
20786
+ # ----
20787
+ # DELETE /ovirt-engine/api/storagedomains/123?destroy=true
20788
+ # ----
20789
+ #
19919
20790
  # This parameter is optional, and the default value is `false`.
19920
20791
  # @option opts [Boolean] :format Indicates if the actual storage should be formatted, removing all the metadata from the underlying LUN or
19921
- # directory.
20792
+ # directory:
20793
+ #
20794
+ # [source]
20795
+ # ----
20796
+ # DELETE /ovirt-engine/api/storagedomains/123?format=true
20797
+ # ----
19922
20798
  #
19923
20799
  # This parameter is optional, and the default value is `false`.
19924
20800
  # @option opts [String] :host Indicates what host should be used to remove the storage domain.
@@ -19959,7 +20835,30 @@ module OvirtSDK4
19959
20835
  end
19960
20836
 
19961
20837
  #
19962
- # Updates the `storage_domain`.
20838
+ # Updates a storage domain.
20839
+ #
20840
+ # Not all of the <<types/storage_domain,StorageDomain>>'s attributes are updatable post-creation. Those that can be
20841
+ # updated are: `name`, `description`, `comment`, `warning_low_space_indicator`, `critical_space_action_blocker` and
20842
+ # `wipe_after_delete` (note that changing the `wipe_after_delete` attribute will not change the wipe after delete
20843
+ # property of disks that already exist).
20844
+ #
20845
+ # To update the `name` and `wipe_after_delete` attributes of a storage domain with an identifier `123`, send a
20846
+ # request as follows:
20847
+ #
20848
+ # [source]
20849
+ # ----
20850
+ # PUT /ovirt-engine/api/storagedomains/123
20851
+ # ----
20852
+ #
20853
+ # With a request body as follows:
20854
+ #
20855
+ # [source,xml]
20856
+ # ----
20857
+ # <storage_domain>
20858
+ # <name>data2</name>
20859
+ # <wipe_after_delete>true</wipe_after_delete>
20860
+ # </storage_domain>
20861
+ # ----
19963
20862
  #
19964
20863
  # @param storage_domain [StorageDomain] The `storage_domain` to update.
19965
20864
  # @param opts [Hash] Additional options.
@@ -20068,7 +20967,7 @@ module OvirtSDK4
20068
20967
  end
20069
20968
 
20070
20969
  #
20071
- # Locates the `files` service.
20970
+ # Returns a reference to the service that manages the files available in the storage domain.
20072
20971
  #
20073
20972
  # @return [FilesService] A reference to `files` service.
20074
20973
  def files_service
@@ -20092,7 +20991,7 @@ module OvirtSDK4
20092
20991
  end
20093
20992
 
20094
20993
  #
20095
- # Locates the `storage_connections` service.
20994
+ # Returns a reference to the service that manages the storage connections.
20096
20995
  #
20097
20996
  # @return [StorageDomainServerConnectionsService] A reference to `storage_connections` service.
20098
20997
  def storage_connections_service
@@ -20409,7 +21308,7 @@ module OvirtSDK4
20409
21308
  end
20410
21309
 
20411
21310
  #
20412
- # Deletes the object managed by this service.
21311
+ # Detaches a storage connection from storage.
20413
21312
  #
20414
21313
  # @param opts [Hash] Additional options.
20415
21314
  #
@@ -20493,7 +21392,7 @@ module OvirtSDK4
20493
21392
  end
20494
21393
  response = @connection.send(request)
20495
21394
  case response.code
20496
- when 201, 202
21395
+ when 200, 201, 202
20497
21396
  begin
20498
21397
  reader = XmlReader.new(response.body)
20499
21398
  return StorageConnectionReader.read_one(reader)
@@ -20877,11 +21776,69 @@ module OvirtSDK4
20877
21776
  end
20878
21777
 
20879
21778
  #
20880
- # Executes the `import` method.
20881
- #
20882
- # @param opts [Hash] Additional options.
21779
+ # Imports a virtual machine from an export storage domain.
20883
21780
  #
20884
- # @option opts [Boolean] :async Indicates if the import should be performed asynchronously.
21781
+ # For example, send a request like this:
21782
+ #
21783
+ # [source]
21784
+ # ----
21785
+ # POST /ovirt-engine/api/storagedomains/123/vms/456/import
21786
+ # ----
21787
+ #
21788
+ # With a request body like this:
21789
+ #
21790
+ # [source,xml]
21791
+ # ----
21792
+ # <action>
21793
+ # <storage_domain>
21794
+ # <name>mydata</name>
21795
+ # </storage_domain>
21796
+ # <cluster>
21797
+ # <name>mycluster</name>
21798
+ # </cluster>
21799
+ # </action>
21800
+ # ----
21801
+ #
21802
+ # To import a virtual machine as a new entity add the `clone` parameter:
21803
+ #
21804
+ # [source,xml]
21805
+ # ----
21806
+ # <action>
21807
+ # <storage_domain>
21808
+ # <name>mydata</name>
21809
+ # </storage_domain>
21810
+ # <cluster>
21811
+ # <name>mycluster</name>
21812
+ # </cluster>
21813
+ # <clone>true</clone>
21814
+ # <vm>
21815
+ # <name>myvm</name>
21816
+ # </vm>
21817
+ # </action>
21818
+ # ----
21819
+ #
21820
+ # Include an optional `disks` parameter to choose which disks to import. For example, to import the disks
21821
+ # of the template that have the identifiers `123` and `456` send the following request body:
21822
+ #
21823
+ # [source,xml]
21824
+ # ----
21825
+ # <action>
21826
+ # <cluster>
21827
+ # <name>mycluster</name>
21828
+ # </cluster>
21829
+ # <vm>
21830
+ # <name>myvm</name>
21831
+ # </vm>
21832
+ # <disks>
21833
+ # <disk id="123"/>
21834
+ # <disk id="456"/>
21835
+ # </disks>
21836
+ # </action>
21837
+ # ----
21838
+ #
21839
+ # @param opts [Hash] Additional options.
21840
+ #
21841
+ # @option opts [Boolean] :async Indicates if the import should be performed asynchronously.
20885
21842
  #
20886
21843
  # @option opts [Boolean] :clone Indicates if the identifiers of the imported virtual machine
20887
21844
  # should be regenerated.
@@ -20898,7 +21855,7 @@ module OvirtSDK4
20898
21855
  # should be collapsed, so that the result will be a virtual machine
20899
21856
  # without snapshots.
20900
21857
  #
20901
- # This parameter is optional, and if it isn't explicity specified the
21858
+ # This parameter is optional, and if it isn't explicitly specified the
20902
21859
  # default value is `false`.
20903
21860
  #
20904
21861
  # @option opts [StorageDomain] :storage_domain
@@ -20959,7 +21916,14 @@ module OvirtSDK4
20959
21916
  end
20960
21917
 
20961
21918
  #
20962
- # Deletes the object managed by this service.
21919
+ # Deletes a virtual machine from an export storage domain.
21920
+ #
21921
+ # For example, to delete the virtual machine `456` from the storage domain `123`, send a request like this:
21922
+ #
21923
+ # [source]
21924
+ # ----
21925
+ # DELETE /ovirt-engine/api/storagedomains/123/vms/456
21926
+ # ----
20963
21927
  #
20964
21928
  # @param opts [Hash] Additional options.
20965
21929
  #
@@ -20978,6 +21942,14 @@ module OvirtSDK4
20978
21942
  end
20979
21943
  end
20980
21944
 
21945
+ #
21946
+ # Returns a reference to the service that manages the disk attachments of the virtual machine.
21947
+ #
21948
+ # @return [StorageDomainVmDiskAttachmentsService] A reference to `disk_attachments` service.
21949
+ def disk_attachments_service
21950
+ return StorageDomainVmDiskAttachmentsService.new(@connection, "#{@path}/diskattachments")
21951
+ end
21952
+
20981
21953
  #
20982
21954
  # Locates the `disks` service.
20983
21955
  #
@@ -20997,6 +21969,12 @@ module OvirtSDK4
20997
21969
  if path.nil? || path == ''
20998
21970
  return self
20999
21971
  end
21972
+ if path == 'diskattachments'
21973
+ return disk_attachments_service
21974
+ end
21975
+ if path.start_with?('diskattachments/')
21976
+ return disk_attachments_service.service(path[16..-1])
21977
+ end
21000
21978
  if path == 'disks'
21001
21979
  return disks_service
21002
21980
  end
@@ -21017,6 +21995,151 @@ module OvirtSDK4
21017
21995
 
21018
21996
  end
21019
21997
 
21998
+ class StorageDomainVmDiskAttachmentService < Service
21999
+
22000
+ #
22001
+ # Creates a new implementation of the service.
22002
+ #
22003
+ # @param connection [Connection] The connection to be used by this service.
22004
+ #
22005
+ # @param path [String] The relative path of this service, for example `vms/123/disks`.
22006
+ #
22007
+ # @api private
22008
+ #
22009
+ def initialize(connection, path)
22010
+ @connection = connection
22011
+ @path = path
22012
+ end
22013
+
22014
+ #
22015
+ # Returns the details of the attachment with all its properties and a link to the disk.
22016
+ #
22017
+ # @param opts [Hash] Additional options.
22018
+ #
22019
+ # @return [DiskAttachment]
22020
+ #
22021
+ def get(opts = {})
22022
+ query = {}
22023
+ request = HttpRequest.new(:method => :GET, :url => @path, :query => query)
22024
+ response = @connection.send(request)
22025
+ case response.code
22026
+ when 200
22027
+ begin
22028
+ reader = XmlReader.new(response.body)
22029
+ return DiskAttachmentReader.read_one(reader)
22030
+ ensure
22031
+ reader.close
22032
+ end
22033
+ else
22034
+ check_fault(response)
22035
+ end
22036
+ end
22037
+
22038
+ #
22039
+ # Locates the service corresponding to the given path.
22040
+ #
22041
+ # @param path [String] The path of the service.
22042
+ #
22043
+ # @return [Service] A reference to the service.
22044
+ #
22045
+ def service(path)
22046
+ if path.nil? || path == ''
22047
+ return self
22048
+ end
22049
+ raise Error.new("The path \"#{path}\" doesn't correspond to any service")
22050
+ end
22051
+
22052
+ #
22053
+ # Returns an string representation of this service.
22054
+ #
22055
+ # @return [String]
22056
+ #
22057
+ def to_s
22058
+ return "#<#{StorageDomainVmDiskAttachmentService}:#{@path}>"
22059
+ end
22060
+
22061
+ end
22062
+
22063
+ class StorageDomainVmDiskAttachmentsService < Service
22064
+
22065
+ #
22066
+ # Creates a new implementation of the service.
22067
+ #
22068
+ # @param connection [Connection] The connection to be used by this service.
22069
+ #
22070
+ # @param path [String] The relative path of this service, for example `vms/123/disks`.
22071
+ #
22072
+ # @api private
22073
+ #
22074
+ def initialize(connection, path)
22075
+ @connection = connection
22076
+ @path = path
22077
+ end
22078
+
22079
+ #
22080
+ # List the disks that are attached to the virtual machine.
22081
+ #
22082
+ # @param opts [Hash] Additional options.
22083
+ #
22084
+ # @return [Array<DiskAttachment>]
22085
+ #
22086
+ def list(opts = {})
22087
+ query = {}
22088
+ request = HttpRequest.new(:method => :GET, :url => @path, :query => query)
22089
+ response = @connection.send(request)
22090
+ case response.code
22091
+ when 200
22092
+ begin
22093
+ reader = XmlReader.new(response.body)
22094
+ return DiskAttachmentReader.read_many(reader)
22095
+ ensure
22096
+ reader.close
22097
+ end
22098
+ else
22099
+ check_fault(response)
22100
+ end
22101
+ end
22102
+
22103
+ #
22104
+ # Reference to the service that manages a specific attachment.
22105
+ #
22106
+ # @param id [String] The identifier of the `attachment`.
22107
+ #
22108
+ # @return [StorageDomainVmDiskAttachmentService] A reference to the `attachment` service.
22109
+ #
22110
+ def attachment_service(id)
22111
+ return StorageDomainVmDiskAttachmentService.new(@connection, "#{@path}/#{id}")
22112
+ end
22113
+
22114
+ #
22115
+ # Locates the service corresponding to the given path.
22116
+ #
22117
+ # @param path [String] The path of the service.
22118
+ #
22119
+ # @return [Service] A reference to the service.
22120
+ #
22121
+ def service(path)
22122
+ if path.nil? || path == ''
22123
+ return self
22124
+ end
22125
+ index = path.index('/')
22126
+ if index.nil?
22127
+ return attachment_service(path)
22128
+ end
22129
+ return attachment_service(path[0..(index - 1)]).service(path[(index +1)..-1])
22130
+ end
22131
+
22132
+ #
22133
+ # Returns an string representation of this service.
22134
+ #
22135
+ # @return [String]
22136
+ #
22137
+ def to_s
22138
+ return "#<#{StorageDomainVmDiskAttachmentsService}:#{@path}>"
22139
+ end
22140
+
22141
+ end
22142
+
21020
22143
  class StorageDomainVmsService < Service
21021
22144
 
21022
22145
  #
@@ -21122,7 +22245,57 @@ module OvirtSDK4
21122
22245
  end
21123
22246
 
21124
22247
  #
21125
- # Adds a new `storage_domain`.
22248
+ # Adds a new storage domain.
22249
+ #
22250
+ # Creation of a new <<types/storage_domain,StorageDomain>> requires the `name`, `type`, `host` and `storage`
22251
+ # attributes. Identify the `host` attribute with the `id` or `name` attributes. In oVirt 3.6 and later you can
22252
+ # enable the wipe after delete option by default on the storage domain. To configure this, specify
22253
+ # `wipe_after_delete` in the POST request. This option can be edited after the domain is created, but doing so will
22254
+ # not change the wipe after delete property of disks that already exist.
22255
+ #
22256
+ # To add a new storage domain with specified `name`, `type`, `storage.type`, `storage.address` and `storage.path`
22257
+ # and by using a host with an id `123`, send a request as follows:
22258
+ #
22259
+ # [source]
22260
+ # ----
22261
+ # POST /ovirt-engine/api/storagedomains
22262
+ # ----
22263
+ #
22264
+ # With a request body as follows:
22265
+ #
22266
+ # [source,xml]
22267
+ # ----
22268
+ # <storage_domain>
22269
+ # <name>mydata</name>
22270
+ # <type>data</type>
22271
+ # <storage>
22272
+ # <type>nfs</type>
22273
+ # <address>mynfs.example.com</address>
22274
+ # <path>/exports/mydata</path>
22275
+ # </storage>
22276
+ # <host>
22277
+ # <name>myhost</name>
22278
+ # </host>
22279
+ # </storage_domain>
22280
+ # ----
22281
+ #
22282
+ # To create a new NFS ISO storage domain send a request like this:
22283
+ #
22284
+ # [source,xml]
22285
+ # ----
22286
+ # <storage_domain>
22287
+ # <name>myisos</name>
22288
+ # <type>iso</type>
22289
+ # <storage>
22290
+ # <type>nfs</type>
22291
+ # <address>mynfs.example.com</address>
22292
+ # <path>/export/myisos</path>
22293
+ # </storage>
22294
+ # <host>
22295
+ # <name>myhost</name>
22296
+ # </host>
22297
+ # </storage_domain>
22298
+ # ----
21126
22299
  #
21127
22300
  # @param storage_domain [StorageDomain] The `storage_domain` to add.
21128
22301
  #
@@ -21145,7 +22318,7 @@ module OvirtSDK4
21145
22318
  end
21146
22319
  response = @connection.send(request)
21147
22320
  case response.code
21148
- when 201, 202
22321
+ when 200, 201, 202
21149
22322
  begin
21150
22323
  reader = XmlReader.new(response.body)
21151
22324
  return StorageDomainReader.read_one(reader)
@@ -21291,11 +22464,24 @@ module OvirtSDK4
21291
22464
  end
21292
22465
 
21293
22466
  #
21294
- # Deletes the object managed by this service.
22467
+ # Removes a storage connection.
22468
+ #
22469
+ # A storage connection can only be deleted if neither storage domain nor LUN disks reference it. The host name or
22470
+ # id is optional; providing it disconnects (unmounts) the connection from that host.
21295
22471
  #
21296
22472
  # @param opts [Hash] Additional options.
21297
22473
  #
21298
22474
  # @option opts [Boolean] :async Indicates if the remove should be performed asynchronously.
22475
+ # @option opts [String] :host The name or identifier of the host from which the connection would be unmounted (disconnected). If not
22476
+ # provided, no host will be disconnected.
22477
+ #
22478
+ # For example, to use the host with identifier `456` to delete the storage connection with identifier `123`
22479
+ # send a request like this:
22480
+ #
22481
+ # [source]
22482
+ # ----
22483
+ # DELETE /ovirt-engine/api/storageconnections/123?host=456
22484
+ # ----
21299
22485
  def remove(opts = {})
21300
22486
  query = {}
21301
22487
  value = opts[:async]
@@ -21303,6 +22489,10 @@ module OvirtSDK4
21303
22489
  value = Writer.render_boolean(value)
21304
22490
  query['async'] = value
21305
22491
  end
22492
+ value = opts[:host]
22493
+ unless value.nil?
22494
+ query['host'] = value
22495
+ end
21306
22496
  request = HttpRequest.new(:method => :DELETE, :url => @path, :query => query)
21307
22497
  response = @connection.send(request)
21308
22498
  unless response.code == 200
@@ -21311,13 +22501,37 @@ module OvirtSDK4
21311
22501
  end
21312
22502
 
21313
22503
  #
21314
- # Updates the `connection`.
22504
+ # Updates the storage connection.
22505
+ #
22506
+ # For example, to change the address of the storage server send a request like this:
22507
+ #
22508
+ # [source,xml]
22509
+ # ----
22510
+ # PUT /ovirt-engine/api/storageconnections/123
22511
+ # ----
22512
+ #
22513
+ # With a request body like this:
22514
+ #
22515
+ # [source,xml]
22516
+ # ----
22517
+ # <storage_connection>
22518
+ # <address>mynewnfs.example.com</address>
22519
+ # <host>
22520
+ # <name>myhost</name>
22521
+ # </host>
22522
+ # </storage_connection>
22523
+ # ----
21315
22524
  #
21316
22525
  # @param connection [StorageConnection] The `connection` to update.
21317
22526
  # @param opts [Hash] Additional options.
21318
22527
  #
21319
22528
  # @option opts [Boolean] :async Indicates if the update should be performed asynchronously.
21320
22529
  #
22530
+ # @option opts [Boolean] :force Indicates if the operation should succeed regardless to the relevant storage domain's status
22531
+ # (i.e. updating is also applicable when storage domain's status is not maintenance).
22532
+ #
22533
+ # This parameter is optional, and the default value is `false`.
22534
+ #
21321
22535
  # @return [StorageConnection]
21322
22536
  #
21323
22537
  def update(connection, opts = {})
@@ -21330,6 +22544,11 @@ module OvirtSDK4
21330
22544
  value = Writer.render_boolean(value)
21331
22545
  query['async'] = value
21332
22546
  end
22547
+ value = opts[:force]
22548
+ unless value.nil?
22549
+ value = Writer.render_boolean(value)
22550
+ query['force'] = value
22551
+ end
21333
22552
  request = HttpRequest.new(:method => :PUT, :url => @path, :query => query)
21334
22553
  begin
21335
22554
  writer = XmlWriter.new(nil, true)
@@ -21439,7 +22658,25 @@ module OvirtSDK4
21439
22658
  end
21440
22659
 
21441
22660
  #
21442
- # Updates the `extension`.
22661
+ # Update a storage server connection extension for the given host.
22662
+ #
22663
+ # To update the storage connection `456` of host `123` send a request like this:
22664
+ #
22665
+ # [source]
22666
+ # ----
22667
+ # PUT /ovirt-engine/api/hosts/123/storageconnectionextensions/456
22668
+ # ----
22669
+ #
22670
+ # With a request body like this:
22671
+ #
22672
+ # [source,xml]
22673
+ # ----
22674
+ # <storage_connection_extension>
22675
+ # <target>iqn.2016-01.com.example:mytarget</target>
22676
+ # <username>myuser</username>
22677
+ # <password>mypassword</password>
22678
+ # </storage_connection_extension>
22679
+ # ----
21443
22680
  #
21444
22681
  # @param extension [StorageConnectionExtension] The `extension` to update.
21445
22682
  # @param opts [Hash] Additional options.
@@ -21523,7 +22760,27 @@ module OvirtSDK4
21523
22760
  end
21524
22761
 
21525
22762
  #
21526
- # Adds a new `extension`.
22763
+ # Creates a new storage server connection extension for the given host.
22764
+ #
22765
+ # The extension lets the user define credentials for an iSCSI target for a specific host. For example to use
22766
+ # `myuser` and `mypassword` as the credentials when connecting to the iSCSI target from host `123` send a request
22767
+ # like this:
22768
+ #
22769
+ # [source]
22770
+ # ----
22771
+ # POST /ovirt-engine/api/hosts/123/storageconnectionextensions
22772
+ # ----
22773
+ #
22774
+ # With a request body like this:
22775
+ #
22776
+ # [source,xml]
22777
+ # ----
22778
+ # <storage_connection_extension>
22779
+ # <target>iqn.2016-01.com.example:mytarget</target>
22780
+ # <username>myuser</username>
22781
+ # <password>mypassword</password>
22782
+ # </storage_connection_extension>
22783
+ # ----
21527
22784
  #
21528
22785
  # @param extension [StorageConnectionExtension] The `extension` to add.
21529
22786
  #
@@ -21546,7 +22803,7 @@ module OvirtSDK4
21546
22803
  end
21547
22804
  response = @connection.send(request)
21548
22805
  case response.code
21549
- when 201, 202
22806
+ when 200, 201, 202
21550
22807
  begin
21551
22808
  reader = XmlReader.new(response.body)
21552
22809
  return StorageConnectionExtensionReader.read_one(reader)
@@ -21646,7 +22903,29 @@ module OvirtSDK4
21646
22903
  end
21647
22904
 
21648
22905
  #
21649
- # Adds a new `connection`.
22906
+ # Creates a new storage connection.
22907
+ #
22908
+ # For example, to create a new storage connection for the NFS server `mynfs.example.com` and NFS share
22909
+ # `/export/mydata` send a request like this:
22910
+ #
22911
+ # [source]
22912
+ # ----
22913
+ # POST /ovirt-engine/api/storageconnections
22914
+ # ----
22915
+ #
22916
+ # With a request body like this:
22917
+ #
22918
+ # [source,xml]
22919
+ # ----
22920
+ # <storage_connection>
22921
+ # <type>nfs</type>
22922
+ # <address>mynfs.example.com</address>
22923
+ # <path>/export/mydata</path>
22924
+ # <host>
22925
+ # <name>myhost</name>
22926
+ # </host>
22927
+ # </storage_connection>
22928
+ # ----
21650
22929
  #
21651
22930
  # @param connection [StorageConnection] The `connection` to add.
21652
22931
  #
@@ -21669,7 +22948,7 @@ module OvirtSDK4
21669
22948
  end
21670
22949
  response = @connection.send(request)
21671
22950
  case response.code
21672
- when 201, 202
22951
+ when 200, 201, 202
21673
22952
  begin
21674
22953
  reader = XmlReader.new(response.body)
21675
22954
  return StorageConnectionReader.read_one(reader)
@@ -21772,6 +23051,83 @@ module OvirtSDK4
21772
23051
  # Returns basic information describing the API, like the product name, the version number and a summary of the
21773
23052
  # number of relevant objects.
21774
23053
  #
23054
+ # [source]
23055
+ # ----
23056
+ # GET /ovirt-engine/api
23057
+ # ----
23058
+ #
23059
+ # We get following response:
23060
+ #
23061
+ # [source,xml]
23062
+ # ----
23063
+ # <api>
23064
+ # <link rel="capabilities" href="/api/capabilities"/>
23065
+ # <link rel="clusters" href="/api/clusters"/>
23066
+ # <link rel="clusters/search" href="/api/clusters?search={query}"/>
23067
+ # <link rel="datacenters" href="/api/datacenters"/>
23068
+ # <link rel="datacenters/search" href="/api/datacenters?search={query}"/>
23069
+ # <link rel="events" href="/api/events"/>
23070
+ # <link rel="events/search" href="/api/events?search={query}"/>
23071
+ # <link rel="hosts" href="/api/hosts"/>
23072
+ # <link rel="hosts/search" href="/api/hosts?search={query}"/>
23073
+ # <link rel="networks" href="/api/networks"/>
23074
+ # <link rel="roles" href="/api/roles"/>
23075
+ # <link rel="storagedomains" href="/api/storagedomains"/>
23076
+ # <link rel="storagedomains/search" href="/api/storagedomains?search={query}"/>
23077
+ # <link rel="tags" href="/api/tags"/>
23078
+ # <link rel="templates" href="/api/templates"/>
23079
+ # <link rel="templates/search" href="/api/templates?search={query}"/>
23080
+ # <link rel="users" href="/api/users"/>
23081
+ # <link rel="groups" href="/api/groups"/>
23082
+ # <link rel="domains" href="/api/domains"/>
23083
+ # <link rel="vmpools" href="/api/vmpools"/>
23084
+ # <link rel="vmpools/search" href="/api/vmpools?search={query}"/>
23085
+ # <link rel="vms" href="/api/vms"/>
23086
+ # <link rel="vms/search" href="/api/vms?search={query}"/>
23087
+ # <product_info>
23088
+ # <name>oVirt Engine</name>
23089
+ # <vendor>ovirt.org</vendor>
23090
+ # <version>
23091
+ # <build>4</build>
23092
+ # <full_version>4.0.4</full_version>
23093
+ # <major>4</major>
23094
+ # <minor>0</minor>
23095
+ # <revision>0</revision>
23096
+ # </version>
23097
+ # </product_info>
23098
+ # <special_objects>
23099
+ # <blank_template href="/ovirt-engine/api/templates/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000"/>
23100
+ # <root_tag href="/ovirt-engine/api/tags/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000"/>
23101
+ # </special_objects>
23102
+ # <summary>
23103
+ # <hosts>
23104
+ # <active>0</active>
23105
+ # <total>0</total>
23106
+ # </hosts>
23107
+ # <storage_domains>
23108
+ # <active>0</active>
23109
+ # <total>1</total>
23110
+ # </storage_domains>
23111
+ # <users>
23112
+ # <active>1</active>
23113
+ # <total>1</total>
23114
+ # </users>
23115
+ # <vms>
23116
+ # <active>0</active>
23117
+ # <total>0</total>
23118
+ # </vms>
23119
+ # </summary>
23120
+ # <time>2016-09-14T12:00:48.132+02:00</time>
23121
+ # </api>
23122
+ # ----
23123
+ #
23124
+ # The entry point provides a user with links to the collections in a
23125
+ # virtualization environment. The `rel` attribute of each collection link
23126
+ # provides a reference point for each link.
23127
+ #
23128
+ # The entry point also contains other data such as `product_info`,
23129
+ # `special_objects` and `summary`.
23130
+ #
21775
23131
  # @param opts [Hash] Additional options.
21776
23132
  #
21777
23133
  # @return [Api]
@@ -22418,7 +23774,7 @@ module OvirtSDK4
22418
23774
  end
22419
23775
  response = @connection.send(request)
22420
23776
  case response.code
22421
- when 201, 202
23777
+ when 200, 201, 202
22422
23778
  begin
22423
23779
  reader = XmlReader.new(response.body)
22424
23780
  return PermissionReader.read_one(reader)
@@ -22663,7 +24019,7 @@ module OvirtSDK4
22663
24019
  end
22664
24020
  response = @connection.send(request)
22665
24021
  case response.code
22666
- when 201, 202
24022
+ when 200, 201, 202
22667
24023
  begin
22668
24024
  reader = XmlReader.new(response.body)
22669
24025
  return TagReader.read_one(reader)
@@ -22763,13 +24119,33 @@ module OvirtSDK4
22763
24119
  end
22764
24120
 
22765
24121
  #
22766
- # Executes the `export` method.
24122
+ # Exports a template to the data center export domain.
24123
+ #
24124
+ # For example, the operation can be facilitated using the following request:
24125
+ #
24126
+ # [source]
24127
+ # ----
24128
+ # POST /ovirt-engine/api/templates/123/export
24129
+ # ----
24130
+ #
24131
+ # With a request body like this:
24132
+ #
24133
+ # [source,xml]
24134
+ # ----
24135
+ # <action>
24136
+ # <storage_domain id="456"/>
24137
+ # <exclusive>true<exclusive/>
24138
+ # </action>
24139
+ # ----
22767
24140
  #
22768
24141
  # @param opts [Hash] Additional options.
22769
24142
  #
22770
- # @option opts [Boolean] :exclussive
24143
+ # @option opts [Boolean] :exclusive Indicates if the existing templates with the same name should be overwritten.
24144
+ #
24145
+ # The export action reports a failed action if a template of the same name exists in the destination domain.
24146
+ # Set this parameter to `true` to change this behavior and overwrite any existing template.
22771
24147
  #
22772
- # @option opts [StorageDomain] :storage_domain
24148
+ # @option opts [StorageDomain] :storage_domain Specifies the destination export storage domain.
22773
24149
  #
22774
24150
  def export(opts = {})
22775
24151
  action = Action.new(opts)
@@ -22823,7 +24199,12 @@ module OvirtSDK4
22823
24199
  end
22824
24200
 
22825
24201
  #
22826
- # Deletes the object managed by this service.
24202
+ # Removas a virtual machine template.
24203
+ #
24204
+ # [source]
24205
+ # ----
24206
+ # DELETE /ovirt-engine/api/templates/123
24207
+ # ----
22827
24208
  #
22828
24209
  # @param opts [Hash] Additional options.
22829
24210
  #
@@ -22843,7 +24224,38 @@ module OvirtSDK4
22843
24224
  end
22844
24225
 
22845
24226
  #
22846
- # Updates the `template`.
24227
+ # Updates the template.
24228
+ #
24229
+ # The `name`, `description`, `type`, `memory`, `cpu`, `topology`, `os`, `high_availability`, `display`,
24230
+ # `stateless`, `usb` and `timezone` elements can be updated after a template has been created.
24231
+ #
24232
+ # For example, to update a template to so that it has 1 GiB of memory send a request like this:
24233
+ #
24234
+ # [source]
24235
+ # ----
24236
+ # PUT /ovirt-engine/api/templates/123
24237
+ # ----
24238
+ #
24239
+ # With the following request body:
24240
+ #
24241
+ # [source,xml]
24242
+ # ----
24243
+ # <template>
24244
+ # <memory>1073741824</memory>
24245
+ # </template>
24246
+ # ----
24247
+ #
24248
+ # The `version_name` name attribute is the only one that can be updated within the `version` attribute used for
24249
+ # template versions:
24250
+ #
24251
+ # [source,xml]
24252
+ # ----
24253
+ # <template>
24254
+ # <version>
24255
+ # <version_name>mytemplate_2</version_name>
24256
+ # </version>
24257
+ # </template>
24258
+ # ----
22847
24259
  #
22848
24260
  # @param template [Template] The `template` to update.
22849
24261
  # @param opts [Hash] Additional options.
@@ -23738,7 +25150,7 @@ module OvirtSDK4
23738
25150
  end
23739
25151
  response = @connection.send(request)
23740
25152
  case response.code
23741
- when 201, 202
25153
+ when 200, 201, 202
23742
25154
  begin
23743
25155
  reader = XmlReader.new(response.body)
23744
25156
  return NicReader.read_one(reader)
@@ -23989,7 +25401,7 @@ module OvirtSDK4
23989
25401
  end
23990
25402
  response = @connection.send(request)
23991
25403
  case response.code
23992
- when 201, 202
25404
+ when 200, 201, 202
23993
25405
  begin
23994
25406
  reader = XmlReader.new(response.body)
23995
25407
  return WatchdogReader.read_one(reader)
@@ -24089,7 +25501,41 @@ module OvirtSDK4
24089
25501
  end
24090
25502
 
24091
25503
  #
24092
- # Adds a new `template`.
25504
+ # Creates a new template.
25505
+ #
25506
+ # This requires the `name` and `vm` elements. Identify the virtual machine with the `id` `name` attributes.
25507
+ #
25508
+ # [source]
25509
+ # ----
25510
+ # POST /ovirt-engine/api/templates
25511
+ # ----
25512
+ #
25513
+ # With a request body like this:
25514
+ #
25515
+ # [source,xml]
25516
+ # ----
25517
+ # <template>
25518
+ # <name>mytemplate</name>
25519
+ # <vm id="123"/>
25520
+ # </template>
25521
+ # ----
25522
+ #
25523
+ # The template can be created as a sub version of an existing template.This requires the `name` and `vm` attributes
25524
+ # for the new template, and the `base_template` and `version_name` attributes for the new template version. The
25525
+ # `base_template` and `version_name` attributes must be specified within a `version` section enclosed in the
25526
+ # `template` section. Identify the virtual machine with the `id` or `name` attributes.
25527
+ #
25528
+ # [source,xml]
25529
+ # ----
25530
+ # <template>
25531
+ # <name>mytemplate</name>
25532
+ # <vm id="123"/>
25533
+ # <version>
25534
+ # <base_template id="456"/>
25535
+ # <version_name>mytemplate_001</version_name>
25536
+ # </version>
25537
+ # </template>
25538
+ # ----
24093
25539
  #
24094
25540
  # @param template [Template] The `template` to add.
24095
25541
  #
@@ -24140,7 +25586,7 @@ module OvirtSDK4
24140
25586
  end
24141
25587
  response = @connection.send(request)
24142
25588
  case response.code
24143
- when 201, 202
25589
+ when 200, 201, 202
24144
25590
  begin
24145
25591
  reader = XmlReader.new(response.body)
24146
25592
  return TemplateReader.read_one(reader)
@@ -24575,7 +26021,45 @@ module OvirtSDK4
24575
26021
  end
24576
26022
 
24577
26023
  #
24578
- # Adds a new `user`.
26024
+ # Add user from a directory service.
26025
+ #
26026
+ # For example, to add the `myuser` user from the `myextension-authz` authorization provider send a request
26027
+ # like this:
26028
+ #
26029
+ # [source]
26030
+ # ----
26031
+ # POST /ovirt-engine/api/users
26032
+ # ----
26033
+ #
26034
+ # With a request body like this:
26035
+ #
26036
+ # [source,xml]
26037
+ # ----
26038
+ # <user>
26039
+ # <user_name>myuser@myextension-authz</user_name>
26040
+ # <domain>
26041
+ # <name>myextension-authz</name>
26042
+ # </domain>
26043
+ # </user>
26044
+ # ----
26045
+ #
26046
+ # In case you are working with Active Directory you have to pass user principal name (UPN) as `username`, followed
26047
+ # by authorization provider name. Due to https://bugzilla.redhat.com/1147900[bug 1147900] you need to provide
26048
+ # also `principal` parameter set to UPN of the user.
26049
+ #
26050
+ # For example, to add the user with UPN `myuser@mysubdomain.mydomain.com` from the `myextension-authz`
26051
+ # authorization provider send a request body like this:
26052
+ #
26053
+ # [source,xml]
26054
+ # ----
26055
+ # <user>
26056
+ # <principal>myuser@mysubdomain.mydomain.com</principal>
26057
+ # <user_name>myuser@mysubdomain.mydomain.com@myextension-authz</user_name>
26058
+ # <domain>
26059
+ # <name>myextension-authz</name>
26060
+ # </domain>
26061
+ # </user>
26062
+ # ----
24579
26063
  #
24580
26064
  # @param user [User] The `user` to add.
24581
26065
  #
@@ -24598,7 +26082,7 @@ module OvirtSDK4
24598
26082
  end
24599
26083
  response = @connection.send(request)
24600
26084
  case response.code
24601
- when 201, 202
26085
+ when 200, 201, 202
24602
26086
  begin
24603
26087
  reader = XmlReader.new(response.body)
24604
26088
  return UserReader.read_one(reader)
@@ -24821,7 +26305,7 @@ module OvirtSDK4
24821
26305
  end
24822
26306
  response = @connection.send(request)
24823
26307
  case response.code
24824
- when 201, 202
26308
+ when 200, 201, 202
24825
26309
  begin
24826
26310
  reader = XmlReader.new(response.body)
24827
26311
  return NetworkReader.read_one(reader)
@@ -24921,7 +26405,20 @@ module OvirtSDK4
24921
26405
  end
24922
26406
 
24923
26407
  #
24924
- # Executes the `cancel_migration` method.
26408
+ # This operation stops any migration of a virtual machine to another physical host.
26409
+ #
26410
+ # [source]
26411
+ # ----
26412
+ # POST /ovirt-engine/api/vms/123/cancelmigration
26413
+ # ----
26414
+ #
26415
+ # The cancel migration action does not take any action specific parameters,
26416
+ # so the request body should contain an empty `action`:
26417
+ #
26418
+ # [source,xml]
26419
+ # ----
26420
+ # <action/>
26421
+ # ----
24925
26422
  #
24926
26423
  # @param opts [Hash] Additional options.
24927
26424
  #
@@ -25004,7 +26501,20 @@ module OvirtSDK4
25004
26501
  end
25005
26502
 
25006
26503
  #
25007
- # Executes the `detach` method.
26504
+ # Detaches a virtual machine from a pool.
26505
+ #
26506
+ # [source]
26507
+ # ----
26508
+ # POST /ovirt-engine/api/vms/123/detach
26509
+ # ----
26510
+ #
26511
+ # The detach action does not take any action specific parameters, so the request body should contain an
26512
+ # empty `action`:
26513
+ #
26514
+ # [source,xml]
26515
+ # ----
26516
+ # <action/>
26517
+ # ----
25008
26518
  #
25009
26519
  # @param opts [Hash] Additional options.
25010
26520
  #
@@ -25031,15 +26541,37 @@ module OvirtSDK4
25031
26541
  end
25032
26542
 
25033
26543
  #
25034
- # Executes the `export` method.
26544
+ # Export a virtual machine to an export domain.
26545
+ #
26546
+ # For example to export virtual machine `123` to the export domain `myexport`, send a request like this:
26547
+ #
26548
+ # [source]
26549
+ # ----
26550
+ # POST /ovirt-engine/api/vms/123/export
26551
+ # ----
26552
+ #
26553
+ # With a request body like this:
26554
+ #
26555
+ # [source,xml]
26556
+ # ----
26557
+ # <action>
26558
+ # <storage_domain>
26559
+ # <name>myexport</name>
26560
+ # </storage_domain>
26561
+ # <exclusive>true</exclusive>
26562
+ # <discard_snapshots>true</discard_snapshots>
26563
+ # </action>
26564
+ # ----
25035
26565
  #
25036
26566
  # @param opts [Hash] Additional options.
25037
26567
  #
25038
26568
  # @option opts [Boolean] :async Indicates if the export should be performed asynchronously.
25039
26569
  #
25040
- # @option opts [Boolean] :discard_snapshots
26570
+ # @option opts [Boolean] :discard_snapshots The `discard_snapshots` parameter is to be used when the virtual machine should be exported with all its
26571
+ # snapshots collapsed.
25041
26572
  #
25042
- # @option opts [Boolean] :exclusive
26573
+ # @option opts [Boolean] :exclusive The `exclusive` parameter is to be used when the virtual machine should be exported even if another copy of
26574
+ # it already exists in the export domain (override).
25043
26575
  #
25044
26576
  # @option opts [StorageDomain] :storage_domain
25045
26577
  #
@@ -25064,7 +26596,23 @@ module OvirtSDK4
25064
26596
  end
25065
26597
 
25066
26598
  #
25067
- # Executes the `freeze_filesystems` method.
26599
+ # Freeze virtual machine file systems.
26600
+ #
26601
+ # This operation freezes a virtual machine's file systems using the QEMU guest agent when taking a live snapshot of
26602
+ # a running virtual machine. Normally, this is done automatically by the manager, but this must be executed
26603
+ # manually with the API for virtual machines using OpenStack Volume (Cinder) disks.
26604
+ #
26605
+ # Example:
26606
+ #
26607
+ # [source]
26608
+ # ----
26609
+ # POST /ovirt-engine/api/vms/123/freezefilesystems
26610
+ # ----
26611
+ #
26612
+ # [source,xml]
26613
+ # ----
26614
+ # <action/>
26615
+ # ----
25068
26616
  #
25069
26617
  # @param opts [Hash] Additional options.
25070
26618
  #
@@ -25093,29 +26641,27 @@ module OvirtSDK4
25093
26641
  #
25094
26642
  # Retrieves the description of the virtual machine.
25095
26643
  #
25096
- # Note that some elements of the description of the virtual machine won't be returned unless the `All-Content`
25097
- # header is present in the request and has the value `true`. The elements that aren't currently returned are
25098
- # the following:
25099
- #
25100
- # - `console`
25101
- # - `initialization.configuration.data` - The OVF document describing the virtual machine.
25102
- # - `rng_source`
25103
- # - `soundcard`
25104
- # - `virtio_scsi`
25105
- #
25106
- # With the Python SDK the `All-Content` header can be set using the `all_content` parameter of the `get`
25107
- # method:
25108
- #
25109
- # [source,python]
25110
- # ----
25111
- # api.vms.get(name="myvm", all_content=True)
25112
- # ----
25113
- #
25114
- # Note that the reason for not including these elements is performance: they are seldom used and they require
25115
- # additional queries in the server. So try to use the `All-Content` header only when it is really needed.
25116
- #
25117
26644
  # @param opts [Hash] Additional options.
25118
26645
  #
26646
+ # @option opts [Boolean] :all_content Indicates if all the attributes of the virtual machine should be included in the response.
26647
+ #
26648
+ # By default the following attributes are excluded:
26649
+ #
26650
+ # - `console`
26651
+ # - `initialization.configuration.data` - The OVF document describing the virtual machine.
26652
+ # - `rng_source`
26653
+ # - `soundcard`
26654
+ # - `virtio_scsi`
26655
+ #
26656
+ # For example, to retrieve the complete representation of the virtual machine '123' send a request like this:
26657
+ #
26658
+ # ....
26659
+ # GET /ovirt-engine/api/vms/123?all_content=true
26660
+ # ....
26661
+ #
26662
+ # NOTE: The reason for not including these attributes is performance: they are seldom used and they require
26663
+ # additional queries to the database. So try to use the this parameter only when it is really needed.
26664
+ #
25119
26665
  # @option opts [Boolean] :filter Indicates if the results should be filtered according to the permissions of the user.
25120
26666
  #
25121
26667
  # @option opts [Boolean] :next_run Indicates if the returned result describes the virtual machine as it is currently running, or if describes
@@ -25141,6 +26687,11 @@ module OvirtSDK4
25141
26687
  #
25142
26688
  def get(opts = {})
25143
26689
  query = {}
26690
+ value = opts[:all_content]
26691
+ unless value.nil?
26692
+ value = Writer.render_boolean(value)
26693
+ query['all_content'] = value
26694
+ end
25144
26695
  value = opts[:filter]
25145
26696
  unless value.nil?
25146
26697
  value = Writer.render_boolean(value)
@@ -25167,7 +26718,27 @@ module OvirtSDK4
25167
26718
  end
25168
26719
 
25169
26720
  #
25170
- # Executes the `logon` method.
26721
+ # Initiates the automatic user logon to access a virtual machine from an external console.
26722
+ #
26723
+ # This action requires the `ovirt-guest-agent-gdm-plugin` and the `ovirt-guest-agent-pam-module` packages to be
26724
+ # installed and the `ovirt-guest-agent` service to be running on the virtual machine.
26725
+ #
26726
+ # Users require the appropriate user permissions for the virtual machine in order to access the virtual machine
26727
+ # from an external console.
26728
+ #
26729
+ # This is how an example request would look like:
26730
+ #
26731
+ # [source]
26732
+ # ----
26733
+ # POST /ovirt-engine/api/vms/123/logon
26734
+ # ----
26735
+ #
26736
+ # Request body:
26737
+ #
26738
+ # [source,xml]
26739
+ # ----
26740
+ # <action/>
26741
+ # ----
25171
26742
  #
25172
26743
  # @param opts [Hash] Additional options.
25173
26744
  #
@@ -25223,17 +26794,35 @@ module OvirtSDK4
25223
26794
  end
25224
26795
 
25225
26796
  #
25226
- # Executes the `migrate` method.
26797
+ # This operation migrates a virtual machine to another physical host.
26798
+ #
26799
+ # [source]
26800
+ # ----
26801
+ # POST /ovirt-engine/api/vms/123/migrate
26802
+ # ----
26803
+ #
26804
+ # One can specify a specific host to migrate the virtual machine to:
26805
+ #
26806
+ # [source,xml]
26807
+ # ----
26808
+ # <action>
26809
+ # <host id="2ab5e1da-b726-4274-bbf7-0a42b16a0fc3"/>
26810
+ # </action>
26811
+ # ----
25227
26812
  #
25228
26813
  # @param opts [Hash] Additional options.
25229
26814
  #
25230
26815
  # @option opts [Boolean] :async Indicates if the migration should be performed asynchronously.
25231
26816
  #
25232
- # @option opts [Cluster] :cluster
26817
+ # @option opts [Cluster] :cluster Specifies the cluster the virtual machine should migrate to. This is an optional parameter. By default, the
26818
+ # virtual machine is migrated to another host within the same cluster.
25233
26819
  #
25234
- # @option opts [Boolean] :force
26820
+ # @option opts [Boolean] :force Specifies the virtual machine should migrate although it might be defined as non migratable. This is an
26821
+ # optional parameter. By default, it is set to `false`.
25235
26822
  #
25236
- # @option opts [Host] :host
26823
+ # @option opts [Host] :host Specifies a specific host the virtual machine should migrate to. This is an optional parameters. By default,
26824
+ # the oVirt Engine automatically selects a default host for migration within the same cluster. If an API user
26825
+ # requires a specific host, the user can specify the host with either an `id` or `name` parameter.
25237
26826
  #
25238
26827
  def migrate(opts = {})
25239
26828
  action = Action.new(opts)
@@ -25291,7 +26880,20 @@ module OvirtSDK4
25291
26880
  end
25292
26881
 
25293
26882
  #
25294
- # Executes the `reboot` method.
26883
+ # This operation sends a reboot request to a virtual machine.
26884
+ #
26885
+ # [source]
26886
+ # ----
26887
+ # POST /ovirt-engine/api/vms/123/reboot
26888
+ # ----
26889
+ #
26890
+ # The reboot action does not take any action specific parameters, so the request body should contain an
26891
+ # empty `action`:
26892
+ #
26893
+ # [source,xml]
26894
+ # ----
26895
+ # <action/>
26896
+ # ----
25295
26897
  #
25296
26898
  # @param opts [Hash] Additional options.
25297
26899
  #
@@ -25318,11 +26920,23 @@ module OvirtSDK4
25318
26920
  end
25319
26921
 
25320
26922
  #
25321
- # Deletes the object managed by this service.
26923
+ # Removes the virtual machine, including the virtual disks attached to it.
26924
+ #
26925
+ # For example, to remove the virtual machine with identifier `123` send a request like this:
26926
+ #
26927
+ # [source]
26928
+ # ----
26929
+ # DELETE /ovirt-engine/api/vms/123
26930
+ # ----
25322
26931
  #
25323
26932
  # @param opts [Hash] Additional options.
25324
26933
  #
25325
26934
  # @option opts [Boolean] :async Indicates if the remove should be performed asynchronously.
26935
+ # @option opts [Boolean] :detach_only Indicates if the attached virtual disks should be detached first and preserved instead of being removed.
26936
+ # @option opts [Boolean] :force Indicates if the virtual machine should be forcibly removed.
26937
+ #
26938
+ # Locked virtual machines and virtual machines with locked disk images
26939
+ # cannot be removed without this flag set to true.
25326
26940
  def remove(opts = {})
25327
26941
  query = {}
25328
26942
  value = opts[:async]
@@ -25330,6 +26944,16 @@ module OvirtSDK4
25330
26944
  value = Writer.render_boolean(value)
25331
26945
  query['async'] = value
25332
26946
  end
26947
+ value = opts[:detach_only]
26948
+ unless value.nil?
26949
+ value = Writer.render_boolean(value)
26950
+ query['detach_only'] = value
26951
+ end
26952
+ value = opts[:force]
26953
+ unless value.nil?
26954
+ value = Writer.render_boolean(value)
26955
+ query['force'] = value
26956
+ end
25333
26957
  request = HttpRequest.new(:method => :DELETE, :url => @path, :query => query)
25334
26958
  response = @connection.send(request)
25335
26959
  unless response.code == 200
@@ -25365,7 +26989,20 @@ module OvirtSDK4
25365
26989
  end
25366
26990
 
25367
26991
  #
25368
- # Executes the `shutdown` method.
26992
+ # This operation sends a shutdown request to a virtual machine.
26993
+ #
26994
+ # [source]
26995
+ # ----
26996
+ # POST /ovirt-engine/api/vms/123/shutdown
26997
+ # ----
26998
+ #
26999
+ # The shutdown action does not take any action specific parameters,
27000
+ # so the request body should contain an empty `action`:
27001
+ #
27002
+ # [source,xml]
27003
+ # ----
27004
+ # <action/>
27005
+ # ----
25369
27006
  #
25370
27007
  # @param opts [Hash] Additional options.
25371
27008
  #
@@ -25392,7 +27029,24 @@ module OvirtSDK4
25392
27029
  end
25393
27030
 
25394
27031
  #
25395
- # Executes the `start` method.
27032
+ # Starts the virtual machine.
27033
+ #
27034
+ # If the virtual environment is complete and the virtual machine contains all necessary components to function,
27035
+ # it can be started.
27036
+ #
27037
+ # This example starts the virtual machine:
27038
+ #
27039
+ # [source]
27040
+ # ----
27041
+ # POST /ovirt-engine/api/vms/123/start
27042
+ # ----
27043
+ #
27044
+ # With a request body:
27045
+ #
27046
+ # [source,xml]
27047
+ # ----
27048
+ # <action/>
27049
+ # ----
25396
27050
  #
25397
27051
  # @param opts [Hash] Additional options.
25398
27052
  #
@@ -25400,13 +27054,35 @@ module OvirtSDK4
25400
27054
  #
25401
27055
  # @option opts [Boolean] :filter Indicates if the results should be filtered according to the permissions of the user.
25402
27056
  #
25403
- # @option opts [Boolean] :pause
27057
+ # @option opts [Boolean] :pause If set to `true`, start the virtual machine in paused mode. Default is `false`.
25404
27058
  #
25405
- # @option opts [Boolean] :use_cloud_init
27059
+ # @option opts [Boolean] :use_cloud_init If set to `true`, the initialization type is set to _cloud-init_. The default value is `false`.
27060
+ # See https://cloudinit.readthedocs.io/en/latest[this] for details.
25406
27061
  #
25407
- # @option opts [Boolean] :use_sysprep
27062
+ # @option opts [Boolean] :use_sysprep If set to `true`, the initialization type is set to _Sysprep_. The default value is `false`.
27063
+ # See https://en.wikipedia.org/wiki/Sysprep[this] for details.
25408
27064
  #
25409
- # @option opts [Vm] :vm
27065
+ # @option opts [Vm] :vm The definition of the virtual machine for this specific run.
27066
+ #
27067
+ # For example:
27068
+ #
27069
+ # [source,xml]
27070
+ # ----
27071
+ # <action>
27072
+ # <vm>
27073
+ # <os>
27074
+ # <boot>
27075
+ # <devices>
27076
+ # <device>cdrom</device>
27077
+ # </devices>
27078
+ # </boot>
27079
+ # </os>
27080
+ # </vm>
27081
+ # </action>
27082
+ # ----
27083
+ #
27084
+ # This will set the boot device to the CDROM only for this specific start. After the virtual machine will be
27085
+ # powered off, this definition will be reverted.
25410
27086
  #
25411
27087
  def start(opts = {})
25412
27088
  action = Action.new(opts)
@@ -25429,7 +27105,20 @@ module OvirtSDK4
25429
27105
  end
25430
27106
 
25431
27107
  #
25432
- # Executes the `stop` method.
27108
+ # This operation forces a virtual machine to power-off.
27109
+ #
27110
+ # [source]
27111
+ # ----
27112
+ # POST /ovirt-engine/api/vms/123/stop
27113
+ # ----
27114
+ #
27115
+ # The stop action does not take any action specific parameters,
27116
+ # so the request body should contain an empty `action`:
27117
+ #
27118
+ # [source,xml]
27119
+ # ----
27120
+ # <action/>
27121
+ # ----
25433
27122
  #
25434
27123
  # @param opts [Hash] Additional options.
25435
27124
  #
@@ -25456,7 +27145,21 @@ module OvirtSDK4
25456
27145
  end
25457
27146
 
25458
27147
  #
25459
- # Executes the `suspend` method.
27148
+ # This operation saves the virtual machine state to disk and stops it.
27149
+ # Start a suspended virtual machine and restore the virtual machine state with the start action.
27150
+ #
27151
+ # [source]
27152
+ # ----
27153
+ # POST /ovirt-engine/api/vms/123/suspend
27154
+ # ----
27155
+ #
27156
+ # The suspend action does not take any action specific parameters,
27157
+ # so the request body should contain an empty `action`:
27158
+ #
27159
+ # [source,xml]
27160
+ # ----
27161
+ # <action/>
27162
+ # ----
25460
27163
  #
25461
27164
  # @param opts [Hash] Additional options.
25462
27165
  #
@@ -25483,7 +27186,23 @@ module OvirtSDK4
25483
27186
  end
25484
27187
 
25485
27188
  #
25486
- # Executes the `thaw_filesystems` method.
27189
+ # Thaw virtual machine file systems.
27190
+ #
27191
+ # This operation thaws a virtual machine's file systems using the QEMU guest agent when taking a live snapshot of a
27192
+ # running virtual machine. Normally, this is done automatically by the manager, but this must be executed manually
27193
+ # with the API for virtual machines using OpenStack Volume (Cinder) disks.
27194
+ #
27195
+ # Example:
27196
+ #
27197
+ # [source]
27198
+ # ----
27199
+ # POST /api/vms/123/thawfilesystems
27200
+ # ----
27201
+ #
27202
+ # [source,xml]
27203
+ # ----
27204
+ # <action/>
27205
+ # ----
25487
27206
  #
25488
27207
  # @param opts [Hash] Additional options.
25489
27208
  #
@@ -25510,7 +27229,26 @@ module OvirtSDK4
25510
27229
  end
25511
27230
 
25512
27231
  #
25513
- # Executes the `ticket` method.
27232
+ # Generates a time-sensitive authentication token for accessing a virtual machine's display.
27233
+ #
27234
+ # [source]
27235
+ # ----
27236
+ # POST /ovirt-engine/api/vms/123/ticket
27237
+ # ----
27238
+ #
27239
+ # The client-provided action optionally includes a desired ticket value and/or an expiry time in seconds.
27240
+ #
27241
+ # In any case, the response specifies the actual ticket value and expiry used.
27242
+ #
27243
+ # [source,xml]
27244
+ # ----
27245
+ # <action>
27246
+ # <ticket>
27247
+ # <value>abcd12345</value>
27248
+ # <expiry>120</expiry>
27249
+ # </ticket>
27250
+ # </action>
27251
+ # ----
25514
27252
  #
25515
27253
  # @param opts [Hash] Additional options.
25516
27254
  #
@@ -25574,6 +27312,10 @@ module OvirtSDK4
25574
27312
  #
25575
27313
  # @option opts [Boolean] :async Indicates if the update should be performed asynchronously.
25576
27314
  #
27315
+ # @option opts [Boolean] :next_run Indicates if the update should be applied to the virtual machine immediately, or if it should be applied only
27316
+ # when the virtual machine is restarted. The default value is `false`, so by default changes are applied
27317
+ # immediately.
27318
+ #
25577
27319
  # @return [Vm]
25578
27320
  #
25579
27321
  def update(vm, opts = {})
@@ -25586,6 +27328,11 @@ module OvirtSDK4
25586
27328
  value = Writer.render_boolean(value)
25587
27329
  query['async'] = value
25588
27330
  end
27331
+ value = opts[:next_run]
27332
+ unless value.nil?
27333
+ value = Writer.render_boolean(value)
27334
+ query['next_run'] = value
27335
+ end
25589
27336
  request = HttpRequest.new(:method => :PUT, :url => @path, :query => query)
25590
27337
  begin
25591
27338
  writer = XmlWriter.new(nil, true)
@@ -25698,7 +27445,7 @@ module OvirtSDK4
25698
27445
  end
25699
27446
 
25700
27447
  #
25701
- # Locates the `sessions` service.
27448
+ # Reference to the service that provides information about virtual machine user sessions.
25702
27449
  #
25703
27450
  # @return [VmSessionsService] A reference to `sessions` service.
25704
27451
  def sessions_service
@@ -26541,7 +28288,7 @@ module OvirtSDK4
26541
28288
  end
26542
28289
  response = @connection.send(request)
26543
28290
  case response.code
26544
- when 201, 202
28291
+ when 200, 201, 202
26545
28292
  begin
26546
28293
  reader = XmlReader.new(response.body)
26547
28294
  return DiskReader.read_one(reader)
@@ -26878,7 +28625,7 @@ module OvirtSDK4
26878
28625
  end
26879
28626
  response = @connection.send(request)
26880
28627
  case response.code
26881
- when 201, 202
28628
+ when 200, 201, 202
26882
28629
  begin
26883
28630
  reader = XmlReader.new(response.body)
26884
28631
  return HostDeviceReader.read_one(reader)
@@ -27056,7 +28803,25 @@ module OvirtSDK4
27056
28803
  end
27057
28804
 
27058
28805
  #
27059
- # Deletes the object managed by this service.
28806
+ # Removes the NIC.
28807
+ #
28808
+ # For example, to remove the NIC with id `456` from the virtual machine with id `123` send a request like this:
28809
+ #
28810
+ # [source]
28811
+ # ----
28812
+ # DELETE /ovirt-engine/api/vms/123/nics/456
28813
+ # ----
28814
+ #
28815
+ # [IMPORTANT]
28816
+ # ====
28817
+ # The hotplugging feature only supports virtual machine operating systems with hotplugging operations.
28818
+ # Example operating systems include:
28819
+ #
28820
+ # - Red Hat Enterprise Linux 6
28821
+ # - Red Hat Enterprise Linux 5
28822
+ # - Windows Server 2008 and
28823
+ # - Windows Server 2003
28824
+ # ====
27060
28825
  #
27061
28826
  # @param opts [Hash] Additional options.
27062
28827
  #
@@ -27076,7 +28841,36 @@ module OvirtSDK4
27076
28841
  end
27077
28842
 
27078
28843
  #
27079
- # Updates the `nic`.
28844
+ # Updates the NIC.
28845
+ #
28846
+ # For example, to update the NIC having with `456` belonging to virtual the machine with id `123` send a request
28847
+ # like this:
28848
+ #
28849
+ # [source]
28850
+ # ----
28851
+ # PUT /ovirt-engine/api/vms/123/nics/456
28852
+ # ----
28853
+ #
28854
+ # With a request body like this:
28855
+ #
28856
+ # [source,xml]
28857
+ # ----
28858
+ # <nic>
28859
+ # <name>mynic</name>
28860
+ # <interface>e1000</interface>
28861
+ # </nic>
28862
+ # ----
28863
+ #
28864
+ # [IMPORTANT]
28865
+ # ====
28866
+ # The hotplugging feature only supports virtual machine operating systems with hotplugging operations.
28867
+ # Example operating systems include:
28868
+ #
28869
+ # - Red Hat Enterprise Linux 6
28870
+ # - Red Hat Enterprise Linux 5
28871
+ # - Windows Server 2008 and
28872
+ # - Windows Server 2003
28873
+ # ====
27080
28874
  #
27081
28875
  # @param nic [Nic] The `nic` to update.
27082
28876
  # @param opts [Hash] Additional options.
@@ -27188,7 +28982,59 @@ module OvirtSDK4
27188
28982
  end
27189
28983
 
27190
28984
  #
27191
- # Adds a new `nic`.
28985
+ # Adds a NIC to the virtual machine.
28986
+ #
28987
+ # The following example adds a network interface named `mynic` using `virtio` and the `ovirtmgmt` network to the
28988
+ # virtual machine.
28989
+ #
28990
+ # [source]
28991
+ # ----
28992
+ # POST /ovirt-engine/api/vms/123/nics
28993
+ # ----
28994
+ #
28995
+ # [source,xml]
28996
+ # ----
28997
+ # <nic>
28998
+ # <interface>virtio</interface>
28999
+ # <name>mynic</name>
29000
+ # <network>
29001
+ # <name>ovirtmgmt</name>
29002
+ # </network>
29003
+ # </nic>
29004
+ # ----
29005
+ #
29006
+ # The following example sends that request using `curl`:
29007
+ #
29008
+ # [source,bash]
29009
+ # ----
29010
+ # curl \
29011
+ # --request POST \
29012
+ # --header "Version: 4" \
29013
+ # --header "Content-Type: application/xml" \
29014
+ # --header "Accept: application/xml" \
29015
+ # --user "admin@internal:mypassword" \
29016
+ # --cacert /etc/pki/ovirt-engine/ca.pem \
29017
+ # --data '
29018
+ # <nic>
29019
+ # <name>mynic</name>
29020
+ # <network>
29021
+ # <name>ovirtmgmt</name>
29022
+ # </network>
29023
+ # </nic>
29024
+ # ' \
29025
+ # https://myengine.example.com/ovirt-engine/api/vms/123/nics
29026
+ # ----
29027
+ #
29028
+ # [IMPORTANT]
29029
+ # ====
29030
+ # The hotplugging feature only supports virtual machine operating systems with hotplugging operations.
29031
+ # Example operating systems include:
29032
+ #
29033
+ # - Red Hat Enterprise Linux 6
29034
+ # - Red Hat Enterprise Linux 5
29035
+ # - Windows Server 2008 and
29036
+ # - Windows Server 2003
29037
+ # ====
27192
29038
  #
27193
29039
  # @param nic [Nic] The `nic` to add.
27194
29040
  #
@@ -27211,7 +29057,7 @@ module OvirtSDK4
27211
29057
  end
27212
29058
  response = @connection.send(request)
27213
29059
  case response.code
27214
- when 201, 202
29060
+ when 200, 201, 202
27215
29061
  begin
27216
29062
  reader = XmlReader.new(response.body)
27217
29063
  return NicReader.read_one(reader)
@@ -27335,7 +29181,14 @@ module OvirtSDK4
27335
29181
  end
27336
29182
 
27337
29183
  #
27338
- # Deletes the object managed by this service.
29184
+ # Removes a virtual NUMA node.
29185
+ #
29186
+ # An example of removing a virtual NUMA node:
29187
+ #
29188
+ # [source]
29189
+ # ----
29190
+ # DELETE /ovirt-engine/api/vms/123/numanodes/456
29191
+ # ----
27339
29192
  #
27340
29193
  # @param opts [Hash] Additional options.
27341
29194
  #
@@ -27355,7 +29208,29 @@ module OvirtSDK4
27355
29208
  end
27356
29209
 
27357
29210
  #
27358
- # Updates the `node`.
29211
+ # Updates a virtual NUMA node.
29212
+ #
29213
+ # An example of pinning a virtual NUMA node to a physical NUMA node on the host:
29214
+ #
29215
+ # [source]
29216
+ # ----
29217
+ # PUT /ovirt-engine/api/vms/123/numanodes/456
29218
+ # ----
29219
+ #
29220
+ # The request body should contain the following:
29221
+ #
29222
+ # [source,xml]
29223
+ # ----
29224
+ # <vm_numa_node>
29225
+ # <numa_node_pins>
29226
+ # <numa_node_pin>
29227
+ # <host_numa_node id="789"/>
29228
+ # <index>0</index>
29229
+ # <pinned>true</pinned>
29230
+ # </numa_node_pin>
29231
+ # </numa_node_pins>
29232
+ # </vm_numa_node>
29233
+ # ----
27359
29234
  #
27360
29235
  # @param node [VirtualNumaNode] The `node` to update.
27361
29236
  # @param opts [Hash] Additional options.
@@ -27439,7 +29314,31 @@ module OvirtSDK4
27439
29314
  end
27440
29315
 
27441
29316
  #
27442
- # Adds a new `node`.
29317
+ # Creates a new virtual NUMA node for the virtual machine.
29318
+ #
29319
+ # An example of creating a NUMA node:
29320
+ #
29321
+ # [source]
29322
+ # ----
29323
+ # POST /ovirt-engine/api/vms/c7ecd2dc/numanodes
29324
+ # Accept: application/xml
29325
+ # Content-type: application/xml
29326
+ # ----
29327
+ # The request body can contain the following:
29328
+ # [source,xml]
29329
+ # ----
29330
+ # <vm_numa_node>
29331
+ # <cpu>
29332
+ # <cores>
29333
+ # <core>
29334
+ # <index>0</index>
29335
+ # </core>
29336
+ # </cores>
29337
+ # </cpu>
29338
+ # <index>0</index>
29339
+ # <memory>1024</memory>
29340
+ # </vm_numa_node>
29341
+ # ----
27443
29342
  #
27444
29343
  # @param node [VirtualNumaNode] The `node` to add.
27445
29344
  #
@@ -27462,7 +29361,7 @@ module OvirtSDK4
27462
29361
  end
27463
29362
  response = @connection.send(request)
27464
29363
  case response.code
27465
- when 201, 202
29364
+ when 200, 201, 202
27466
29365
  begin
27467
29366
  reader = XmlReader.new(response.body)
27468
29367
  return VirtualNumaNodeReader.read_one(reader)
@@ -27475,7 +29374,7 @@ module OvirtSDK4
27475
29374
  end
27476
29375
 
27477
29376
  #
27478
- # Returns the representation of the object managed by this service.
29377
+ # Lists virtual NUMA nodes of a virtual machine.
27479
29378
  #
27480
29379
  # @param opts [Hash] Additional options.
27481
29380
  #
@@ -27562,7 +29461,20 @@ module OvirtSDK4
27562
29461
  end
27563
29462
 
27564
29463
  #
27565
- # Executes the `allocate_vm` method.
29464
+ # This operation allocates a virtual machine in the virtual machine pool.
29465
+ #
29466
+ # [source]
29467
+ # ----
29468
+ # POST /ovirt-engine/api/vmpools/123/allocatevm
29469
+ # ----
29470
+ #
29471
+ # The allocate virtual machine action does not take any action specific parameters, so the request body should
29472
+ # contain an empty `action`:
29473
+ #
29474
+ # [source,xml]
29475
+ # ----
29476
+ # <action/>
29477
+ # ----
27566
29478
  #
27567
29479
  # @param opts [Hash] Additional options.
27568
29480
  #
@@ -27620,7 +29532,12 @@ module OvirtSDK4
27620
29532
  end
27621
29533
 
27622
29534
  #
27623
- # Deletes the object managed by this service.
29535
+ # Removes a virtual machine pool.
29536
+ #
29537
+ # [source]
29538
+ # ----
29539
+ # DELETE /ovirt-engine/api/vmpools/123
29540
+ # ----
27624
29541
  #
27625
29542
  # @param opts [Hash] Additional options.
27626
29543
  #
@@ -27640,9 +29557,29 @@ module OvirtSDK4
27640
29557
  end
27641
29558
 
27642
29559
  #
27643
- # Updates the `pool`.
29560
+ # Update the virtual machine pool.
29561
+ #
29562
+ # [source]
29563
+ # ----
29564
+ # PUT /ovirt-engine/api/vmpools/123
29565
+ # ----
29566
+ #
29567
+ # The `name`, `description`, `size`, `prestarted_vms` and `max_user_vms`
29568
+ # attributes can be updated after the virtual machine pool has been
29569
+ # created.
29570
+ #
29571
+ # [source,xml]
29572
+ # ----
29573
+ # <vmpool>
29574
+ # <name>VM_Pool_B</name>
29575
+ # <description>Virtual Machine Pool B</description>
29576
+ # <size>3</size>
29577
+ # <prestarted_vms>1</size>
29578
+ # <max_user_vms>2</size>
29579
+ # </vmpool>
29580
+ # ----
27644
29581
  #
27645
- # @param pool [VmPool] The `pool` to update.
29582
+ # @param pool [VmPool] The virtual machine pool that is being updated.
27646
29583
  # @param opts [Hash] Additional options.
27647
29584
  #
27648
29585
  # @option opts [Boolean] :async Indicates if the update should be performed asynchronously.
@@ -27738,7 +29675,26 @@ module OvirtSDK4
27738
29675
  end
27739
29676
 
27740
29677
  #
27741
- # Adds a new `pool`.
29678
+ # Creates a new virtual machine pool.
29679
+ #
29680
+ # A new pool requires the `name`, `cluster` and `template` attributes. Identify the cluster and template with the
29681
+ # `id` or `name` nested attributes:
29682
+ #
29683
+ # [source]
29684
+ # ----
29685
+ # POST /ovirt-engine/api/vmpools
29686
+ # ----
29687
+ #
29688
+ # With the following body:
29689
+ #
29690
+ # [source,xml]
29691
+ # ----
29692
+ # <vmpool>
29693
+ # <name>mypool</name>
29694
+ # <cluster id="123"/>
29695
+ # <template id="456"/>
29696
+ # </vmpool>
29697
+ # ----
27742
29698
  #
27743
29699
  # @param pool [VmPool] The `pool` to add.
27744
29700
  #
@@ -27761,7 +29717,7 @@ module OvirtSDK4
27761
29717
  end
27762
29718
  response = @connection.send(request)
27763
29719
  case response.code
27764
- when 201, 202
29720
+ when 200, 201, 202
27765
29721
  begin
27766
29722
  reader = XmlReader.new(response.body)
27767
29723
  return VmPoolReader.read_one(reader)
@@ -28100,7 +30056,31 @@ module OvirtSDK4
28100
30056
  end
28101
30057
 
28102
30058
  #
28103
- # Returns the representation of the object managed by this service.
30059
+ # Lists all user sessions for this virtual machine.
30060
+ #
30061
+ # For example, to retrieve the session information for virtual machine `123` send a request like this:
30062
+ #
30063
+ # [source]
30064
+ # ----
30065
+ # GET /ovirt-engine/api/vms/123/sessions
30066
+ # ----
30067
+ #
30068
+ # The response body will contain something like this:
30069
+ #
30070
+ # [source,xml]
30071
+ # ----
30072
+ # <sessions>
30073
+ # <session href="/ovirt-engine/api/vms/123/sessions/456" id="456">
30074
+ # <console_user>true</console_user>
30075
+ # <ip>
30076
+ # <address>192.168.122.1</address>
30077
+ # </ip>
30078
+ # <user href="/ovirt-engine/api/users/789" id="789"/>
30079
+ # <vm href="/ovirt-engine/api/vms/123" id="123"/>
30080
+ # </session>
30081
+ # ...
30082
+ # </sessions>
30083
+ # ----
28104
30084
  #
28105
30085
  # @param opts [Hash] Additional options.
28106
30086
  #
@@ -28131,7 +30111,7 @@ module OvirtSDK4
28131
30111
  end
28132
30112
 
28133
30113
  #
28134
- # Locates the `session` service.
30114
+ # Reference to the service that manages a specific session.
28135
30115
  #
28136
30116
  # @param id [String] The identifier of the `session`.
28137
30117
  #
@@ -28338,7 +30318,7 @@ module OvirtSDK4
28338
30318
  end
28339
30319
  response = @connection.send(request)
28340
30320
  case response.code
28341
- when 201, 202
30321
+ when 200, 201, 202
28342
30322
  begin
28343
30323
  reader = XmlReader.new(response.body)
28344
30324
  return WatchdogReader.read_one(reader)
@@ -28545,6 +30525,51 @@ module OvirtSDK4
28545
30525
  # </vm>
28546
30526
  # ----
28547
30527
  #
30528
+ # It is possible to specify additional virtual machine parameters in the XML description, e.g. a virtual machine
30529
+ # of `desktop` type, with 2 GiB of RAM and additional description can be added sending a request body like the
30530
+ # following:
30531
+ #
30532
+ # [source,xml]
30533
+ # ----
30534
+ # <vm>
30535
+ # <name>myvm</name>
30536
+ # <description>My Desktop Virtual Machine</description>
30537
+ # <type>desktop</type>
30538
+ # <memory>2147483648</memory>
30539
+ # ...
30540
+ # </vm>
30541
+ # ----
30542
+ #
30543
+ # A bootable CDROM device can be set like this:
30544
+ #
30545
+ # [source,xml]
30546
+ # ----
30547
+ # <vm>
30548
+ # ...
30549
+ # <os>
30550
+ # <boot dev="cdrom"/>
30551
+ # </os>
30552
+ # </vm>
30553
+ # ----
30554
+ #
30555
+ # In order to boot from CDROM, you first need to insert a disk, as described in the
30556
+ # <<services/vm_cdrom, CDROM service>>. Then booting from that CDROM can be specified using the `os.boot.devices`
30557
+ # attribute:
30558
+ #
30559
+ # [source,xml]
30560
+ # ----
30561
+ # <vm>
30562
+ # ...
30563
+ # <os>
30564
+ # <boot>
30565
+ # <devices>
30566
+ # <device>cdrom</device>
30567
+ # </devices>
30568
+ # </boot>
30569
+ # </os>
30570
+ # </vm>
30571
+ # ----
30572
+ #
28548
30573
  # In all cases the name or identifier of the cluster where the virtual machine will be created is mandatory.
28549
30574
  #
28550
30575
  # @param vm [Vm] The `vm` to add.
@@ -28635,7 +30660,7 @@ module OvirtSDK4
28635
30660
  end
28636
30661
  response = @connection.send(request)
28637
30662
  case response.code
28638
- when 201, 202
30663
+ when 200, 201, 202
28639
30664
  begin
28640
30665
  reader = XmlReader.new(response.body)
28641
30666
  return VmReader.read_one(reader)
@@ -28652,6 +30677,25 @@ module OvirtSDK4
28652
30677
  #
28653
30678
  # @param opts [Hash] Additional options.
28654
30679
  #
30680
+ # @option opts [Boolean] :all_content Indicates if all the attributes of the virtual machines should be included in the response.
30681
+ #
30682
+ # By default the following attributes are excluded:
30683
+ #
30684
+ # - `console`
30685
+ # - `initialization.configuration.data` - The OVF document describing the virtual machine.
30686
+ # - `rng_source`
30687
+ # - `soundcard`
30688
+ # - `virtio_scsi`
30689
+ #
30690
+ # For example, to retrieve the complete representation of the virtual machines send a request like this:
30691
+ #
30692
+ # ....
30693
+ # GET /ovirt-engine/api/vms?all_content=true
30694
+ # ....
30695
+ #
30696
+ # NOTE: The reason for not including these attributes is performance: they are seldom used and they require
30697
+ # additional queries to the database. So try to use the this parameter only when it is really needed.
30698
+ #
28655
30699
  # @option opts [Boolean] :case_sensitive Indicates if the search performed using the `search` parameter should be performed taking case into
28656
30700
  # account. The default value is `true`, which means that case is taken into account. If you want to search
28657
30701
  # ignoring case set it to `false`.
@@ -28666,6 +30710,11 @@ module OvirtSDK4
28666
30710
  #
28667
30711
  def list(opts = {})
28668
30712
  query = {}
30713
+ value = opts[:all_content]
30714
+ unless value.nil?
30715
+ value = Writer.render_boolean(value)
30716
+ query['all_content'] = value
30717
+ end
28669
30718
  value = opts[:case_sensitive]
28670
30719
  unless value.nil?
28671
30720
  value = Writer.render_boolean(value)
@@ -28922,7 +30971,7 @@ module OvirtSDK4
28922
30971
  end
28923
30972
  response = @connection.send(request)
28924
30973
  case response.code
28925
- when 201, 202
30974
+ when 200, 201, 202
28926
30975
  begin
28927
30976
  reader = XmlReader.new(response.body)
28928
30977
  return VnicProfileReader.read_one(reader)
@@ -29137,7 +31186,7 @@ module OvirtSDK4
29137
31186
  end
29138
31187
  response = @connection.send(request)
29139
31188
  case response.code
29140
- when 201, 202
31189
+ when 200, 201, 202
29141
31190
  begin
29142
31191
  reader = XmlReader.new(response.body)
29143
31192
  return WeightReader.read_one(reader)
@@ -29244,7 +31293,26 @@ module OvirtSDK4
29244
31293
  end
29245
31294
 
29246
31295
  #
29247
- # Executes the `copy` method.
31296
+ # This operation copies a disk to the specified storage domain.
31297
+ #
31298
+ # For example, copy of a disk can be facilitated using the following request:
31299
+ #
31300
+ # [source]
31301
+ # ----
31302
+ # POST /ovirt-engine/api/disks/123/copy
31303
+ # ----
31304
+ #
31305
+ # With a request body like this:
31306
+ #
31307
+ # [source,xml]
31308
+ # ----
31309
+ # <action>
31310
+ # <storage_domain id="456"/>
31311
+ # <disk>
31312
+ # <name>mydisk</name>
31313
+ # </disk>
31314
+ # </action>
31315
+ # ----
29248
31316
  #
29249
31317
  # @param opts [Hash] Additional options.
29250
31318
  #
@@ -29332,7 +31400,24 @@ module OvirtSDK4
29332
31400
  end
29333
31401
 
29334
31402
  #
29335
- # Executes the `move` method.
31403
+ # Moves a disk to another storage domain.
31404
+ #
31405
+ # For example, to move the disk with identifier `123` to a storage domain with identifier `456` send the following
31406
+ # request:
31407
+ #
31408
+ # [source]
31409
+ # ----
31410
+ # POST /ovirt-engine/api/disks/123/move
31411
+ # ----
31412
+ #
31413
+ # With the following request body:
31414
+ #
31415
+ # [source,xml]
31416
+ # ----
31417
+ # <action>
31418
+ # <storage_domain id="456"/>
31419
+ # </action>
31420
+ # ----
29336
31421
  #
29337
31422
  # @param opts [Hash] Additional options.
29338
31423
  #
@@ -30317,7 +32402,7 @@ module OvirtSDK4
30317
32402
  end
30318
32403
 
30319
32404
  #
30320
- # Executes the `activate` method.
32405
+ # Activate the host for use, such as running virtual machines.
30321
32406
  #
30322
32407
  # @param opts [Hash] Additional options.
30323
32408
  #
@@ -30344,7 +32429,9 @@ module OvirtSDK4
30344
32429
  end
30345
32430
 
30346
32431
  #
30347
- # Executes the `approve` method.
32432
+ # Approve a pre-installed Hypervisor host for usage in the virtualization environment.
32433
+ #
32434
+ # This action also accepts an optional cluster element to define the target cluster for this host.
30348
32435
  #
30349
32436
  # @param opts [Hash] Additional options.
30350
32437
  #
@@ -30375,6 +32462,27 @@ module OvirtSDK4
30375
32462
  #
30376
32463
  # Marks the network configuration as good and persists it inside the host.
30377
32464
  #
32465
+ # An API user commits the network configuration to persist a host network interface attachment or detachment, or
32466
+ # persist the creation and deletion of a bonded interface.
32467
+ #
32468
+ # IMPORTANT: Networking configuration is only committed after the engine has established that host connectivity is
32469
+ # not lost as a result of the configuration changes. If host connectivity is lost, the host requires a reboot and
32470
+ # automatically reverts to the previous networking configuration.
32471
+ #
32472
+ # For example, to commit the network configuration of host with id `123` send a request like this:
32473
+ #
32474
+ # [source]
32475
+ # ----
32476
+ # POST /ovirt-engine/api/hosts/123/commitnetconfig
32477
+ # ----
32478
+ #
32479
+ # With a request body like this:
32480
+ #
32481
+ # [source,xml]
32482
+ # ----
32483
+ # <action/>
32484
+ # ----
32485
+ #
30378
32486
  # @param opts [Hash] Additional options.
30379
32487
  #
30380
32488
  # @option opts [Boolean] :async Indicates if the action should be performed asynchronously.
@@ -30400,7 +32508,7 @@ module OvirtSDK4
30400
32508
  end
30401
32509
 
30402
32510
  #
30403
- # Executes the `deactivate` method.
32511
+ # Deactivate the host to perform maintenance tasks.
30404
32512
  #
30405
32513
  # @param opts [Hash] Additional options.
30406
32514
  #
@@ -30432,7 +32540,7 @@ module OvirtSDK4
30432
32540
  end
30433
32541
 
30434
32542
  #
30435
- # Executes the `enroll_certificate` method.
32543
+ # Enroll certificate of the host. Useful in case you get a warning that it is about to, or already expired.
30436
32544
  #
30437
32545
  # @param opts [Hash] Additional options.
30438
32546
  #
@@ -30459,7 +32567,33 @@ module OvirtSDK4
30459
32567
  end
30460
32568
 
30461
32569
  #
30462
- # Executes the `fence` method.
32570
+ # Controls host's power management device.
32571
+ #
32572
+ # For example, let's assume you want to start the host. This can be done via:
32573
+ #
32574
+ # [source]
32575
+ # ----
32576
+ # #!/bin/sh -ex
32577
+ #
32578
+ # url="https://engine.example.com/ovirt-engine/api"
32579
+ # user="admin@internal"
32580
+ # password="..."
32581
+ #
32582
+ # curl \
32583
+ # --verbose \
32584
+ # --cacert /etc/pki/ovirt-engine/ca.pem \
32585
+ # --user "${user}:${password}" \
32586
+ # --request POST \
32587
+ # --header "Version: 4" \
32588
+ # --header "Content-Type: application/xml" \
32589
+ # --header "Accept: application/xml" \
32590
+ # --data '
32591
+ # <action>
32592
+ # <fence_type>start</fence_type>
32593
+ # </action>
32594
+ # ' \
32595
+ # "${url}/hosts/123/fence"
32596
+ # ----
30463
32597
  #
30464
32598
  # @param opts [Hash] Additional options.
30465
32599
  #
@@ -30491,7 +32625,19 @@ module OvirtSDK4
30491
32625
  end
30492
32626
 
30493
32627
  #
30494
- # Executes the `force_select_spm` method.
32628
+ # Manually set a host as the storage pool manager (SPM).
32629
+ #
32630
+ # [source]
32631
+ # ----
32632
+ # POST /ovirt-engine/api/hosts/123/forceselectspm
32633
+ # ----
32634
+ #
32635
+ # With a request body like this:
32636
+ #
32637
+ # [source,xml]
32638
+ # ----
32639
+ # <action/>
32640
+ # ----
30495
32641
  #
30496
32642
  # @param opts [Hash] Additional options.
30497
32643
  #
@@ -30518,7 +32664,7 @@ module OvirtSDK4
30518
32664
  end
30519
32665
 
30520
32666
  #
30521
- # Returns the representation of the object managed by this service.
32667
+ # Get the host details.
30522
32668
  #
30523
32669
  # @param opts [Hash] Additional options.
30524
32670
  #
@@ -30549,7 +32695,48 @@ module OvirtSDK4
30549
32695
  end
30550
32696
 
30551
32697
  #
30552
- # Executes the `install` method.
32698
+ # Install VDSM and related software on the host. The host type defines additional parameters for the action.
32699
+ #
32700
+ # Example of installing a host, using `curl` and JSON, plain:
32701
+ #
32702
+ # [source,bash]
32703
+ # ----
32704
+ # curl \
32705
+ # --verbose \
32706
+ # --cacert /etc/pki/ovirt-engine/ca.pem \
32707
+ # --request PUT \
32708
+ # --header "Content-Type: application/json" \
32709
+ # --header "Accept: application/json" \
32710
+ # --header "Version: 4" \
32711
+ # --user "admin@internal:..." \
32712
+ # --data '
32713
+ # {
32714
+ # "root_password": "myrootpassword"
32715
+ # }
32716
+ # ' \
32717
+ # "https://engine.example.com/ovirt-engine/api/hosts/123"
32718
+ # ----
32719
+ #
32720
+ # Example of installing a host, using `curl` and JSON, with hosted engine components:
32721
+ #
32722
+ # [source,bash]
32723
+ # ----
32724
+ # curl \
32725
+ # curl \
32726
+ # --verbose \
32727
+ # --cacert /etc/pki/ovirt-engine/ca.pem \
32728
+ # --request PUT \
32729
+ # --header "Content-Type: application/json" \
32730
+ # --header "Accept: application/json" \
32731
+ # --header "Version: 4" \
32732
+ # --user "admin@internal:..." \
32733
+ # --data '
32734
+ # {
32735
+ # "root_password": "myrootpassword"
32736
+ # }
32737
+ # ' \
32738
+ # "https://engine.example.com/ovirt-engine/api/hosts/123?deploy_hosted_engine=true"
32739
+ # ----
30553
32740
  #
30554
32741
  # @param opts [Hash] Additional options.
30555
32742
  #
@@ -30684,7 +32871,24 @@ module OvirtSDK4
30684
32871
  end
30685
32872
 
30686
32873
  #
30687
- # Deletes the object managed by this service.
32874
+ # Remove the host from the system.
32875
+ #
32876
+ # [source]
32877
+ # ----
32878
+ # #!/bin/sh -ex
32879
+ #
32880
+ # url="https://engine.example.com/ovirt-engine/api"
32881
+ # user="admin@internal"
32882
+ # password="..."
32883
+ #
32884
+ # curl \
32885
+ # --verbose \
32886
+ # --cacert /etc/pki/ovirt-engine/ca.pem \
32887
+ # --user "${user}:${password}" \
32888
+ # --request DELETE \
32889
+ # --header "Version: 4" \
32890
+ # "${url}/hosts/1ff7a191-2f3b-4eff-812b-9f91a30c3acc"
32891
+ # ----
30688
32892
  #
30689
32893
  # @param opts [Hash] Additional options.
30690
32894
  #
@@ -30838,7 +33042,7 @@ module OvirtSDK4
30838
33042
  # ----
30839
33043
  #
30840
33044
  # IMPORTANT: To make sure that the network configuration has been saved in the host, and that it will be applied
30841
- # when the host is rebooted, remember to call <<services/host/methods/commitnetconfig, commitnetconfig>>.
33045
+ # when the host is rebooted, remember to call <<services/host/methods/commit_net_config, commitnetconfig>>.
30842
33046
  #
30843
33047
  # @param opts [Hash] Additional options.
30844
33048
  #
@@ -30915,7 +33119,25 @@ module OvirtSDK4
30915
33119
  end
30916
33120
 
30917
33121
  #
30918
- # Updates the `host`.
33122
+ # Update the host properties.
33123
+ #
33124
+ # For example, to update a the kernel command line of a host send a request like this:
33125
+ #
33126
+ # [source]
33127
+ # ----
33128
+ # PUT /ovirt-engine/api/hosts/123
33129
+ # ----
33130
+ #
33131
+ # With request body like this:
33132
+ #
33133
+ # [source, xml]
33134
+ # ----
33135
+ # <host>
33136
+ # <os>
33137
+ # <custom_kernel_cmdline>vfio_iommu_type1.allow_unsafe_interrupts=1</custom_kernel_cmdline>
33138
+ # </os>
33139
+ # </host>
33140
+ # ----
30919
33141
  #
30920
33142
  # @param host [Host] The `host` to update.
30921
33143
  # @param opts [Hash] Additional options.
@@ -30958,7 +33180,7 @@ module OvirtSDK4
30958
33180
  end
30959
33181
 
30960
33182
  #
30961
- # Executes the `upgrade` method.
33183
+ # Upgrade VDSM and selected software on the host.
30962
33184
  #
30963
33185
  # @param opts [Hash] Additional options.
30964
33186
  #
@@ -31033,7 +33255,7 @@ module OvirtSDK4
31033
33255
  end
31034
33256
 
31035
33257
  #
31036
- # Locates the `nics` service.
33258
+ # Reference to the service that manages the network interface devices on the host.
31037
33259
  #
31038
33260
  # @return [HostNicsService] A reference to `nics` service.
31039
33261
  def nics_service