
This is a multi-part message in MIME format. ------=_001_NextPart335580042548_=---- Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: base64 SGVsbG8sDQoNCkknbSB1c2luZyBvdmlydDMuNi43LCBhbmQgaSB3YW50IHRvIHVzZSBRb1MgZnVu Y3Rpb24gYnkgcmVzdGFwaS4gQnV0IGkgZm91bnQgaSBjYW4ndCB1cGRhdGUgdGhlIHFvcyB0byB1 bmxpbWl0ZWQuIA0KRm9yIGV4YW1wbGUsIGkgYXNzaWduZWQgYSBxb3MgbmFtZWQgcW9zMSB0byBh IHZuaWMgcHJvZmlsZSBuYW1lZCB2cHJvZmlsZTEsIHRoZW4gaSB3YW50IHRvIHNldCB0aGUgcW9z IG9mIHZwcm9maWxlMSB0byB1bmxpbWl0ZWQsDQpzbyBpIHNldCB0aGUgcW9zIHRvIE5vbmUgaW4g c2RrIHdoZW4gdXBkYXRlIHZuaWMgcHJvZmlsZSwgYnV0IGFmdGVyIHVwZGF0ZSB0aGUgdm5pYyBw cm9maWxlIHN0aWxsIGhhcyBxb3MgbmFtZWQgcW9zMS4NCg0KU28sIGhvdyBzaG91bGQgaSBkbyBp ZiBpIHdhbnQgdG8gc2V0IHFvcyBvZiBhIHZuaWMgcHJvZmlsZSB0byB1bmxpbWl0ZWQ/DQoNCkxv b2sgZm9yd2FyZCB0byB5b3VyIGhlbHAhDQpUaGFua3MgDQoNCg0KDQpsaWtlLm1hQGNzMmMuY29t LmNuDQo= ------=_001_NextPart335580042548_=---- Content-Type: text/html; charset="GB2312" Content-Transfer-Encoding: quoted-printable <html><head><meta http-equiv=3D"content-type" content=3D"text/html; charse= t=3DGB2312"><style>body { line-height: 1.5; }body { font-size: 10.5pt; fon= t-family: =CE=A2=C8=ED=D1=C5=BA=DA; color: rgb(0, 0, 0); line-height: 1.5;= }</style></head><body>=0A<div><span></span><div style=3D"font-family: =CE= =A2=C8=ED=D1=C5=BA=DA, Tahoma; line-height: normal;"><div>Hello,<br><br></= div>I'm using ovirt3.6.7, and i want to use QoS function by restapi. But i= fount i can't update the qos to unlimited. </div></div><div style=3D= "font-family: =CE=A2=C8=ED=D1=C5=BA=DA, Tahoma; line-height: normal;">For = example, i assigned a qos named qos1 to a vnic profile named vprofile1, th= en i want to set the qos of vprofile1 to unlimited,</div><div style=3D"fon= t-family: =CE=A2=C8=ED=D1=C5=BA=DA, Tahoma; line-height: normal;">so i set= the qos to None in sdk when update vnic profile, but after update the vni= c profile still has qos named qos1.</div><div style=3D"font-family: =CE=A2= =C8=ED=D1=C5=BA=DA, Tahoma; line-height: normal;"><br></div><div style=3D"= font-family: =CE=A2=C8=ED=D1=C5=BA=DA, Tahoma; line-height: normal;">So, h= ow should i do if i want to set qos of a vnic profile to unlimited?</div><= div style=3D"font-family: =CE=A2=C8=ED=D1=C5=BA=DA, Tahoma; line-height: n= ormal;"><br></div><div style=3D"font-family: =CE=A2=C8=ED=D1=C5=BA=DA, Tah= oma; line-height: normal;">Look forward to your help!</div><div style=3D"f= ont-family: =CE=A2=C8=ED=D1=C5=BA=DA, Tahoma; line-height: normal;">Thanks= </div>=0A<div><br></div><hr style=3D"width: 210px; height: 1px;" col= or=3D"#b5c4df" size=3D"1" align=3D"left">=0A<div><span><div style=3D"MARGI= N: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div>like.ma@cs2c.com.cn</= div></div></span></div>=0A</body></html> ------=_001_NextPart335580042548_=------

+yzaspitsk, danken yzaspitsk isn't an empty network qos means unlimited? Anyhow, you can meanwhile, simply create a new network qos that is unlimited, and update profile1 to point to it. On 16 August 2016 at 04:52, like.ma@cs2c.com.cn <like.ma@cs2c.com.cn> wrote:
Hello,
I'm using ovirt3.6.7, and i want to use QoS function by restapi. But i fount i can't update the qos to unlimited. For example, i assigned a qos named qos1 to a vnic profile named vprofile1, then i want to set the qos of vprofile1 to unlimited, so i set the qos to None in sdk when update vnic profile, but after update the vnic profile still has qos named qos1.
So, how should i do if i want to set qos of a vnic profile to unlimited?
Look forward to your help! Thanks
------------------------------ like.ma@cs2c.com.cn
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

On 08/16/2016 03:52 AM, like.ma@cs2c.com.cn wrote:
Hello,
I'm using ovirt3.6.7, and i want to use QoS function by restapi. But i fount i can't update the qos to unlimited. For example, i assigned a qos named qos1 to a vnic profile named vprofile1, then i want to set the qos of vprofile1 to unlimited, so i set the qos to None in sdk when update vnic profile, but after update the vnic profile still has qos named qos1.
So, how should i do if i want to set qos of a vnic profile to unlimited?
Look forward to your help! Thanks
This is a general issue with the way the API works: we don't have different methods for updating or replacing completely the representation of an object, we use PUT for everything. This means that we have to assume that when you send a request without an attribute what you mean is that you want to preserve it. For example, when you send something like this: PUT /ovirt-engine/api/vnicprofiles/123 <vnic_profile> <!-- Empty, trying to reset the QoS, but won't work :-( --> </vnic_profile> We have to assume that you want to preserve the attributes, as otherwise we would just remove all of them. A side effect of this is that there is no way to express that what you want to do is remove the QoS. The workaround for that is to create an unlimited QoS (manually or via the API) and then update the VNIC profile to use that instead of the previous one. For example: ---8<--- # Find the data center: dc = api.datacenters.get(name='mydc') # Find the "unlimited" QoS, or create it if it doesn't exit # yet: unlimited = dc.qoss.get(name='unlimitednetwork') if unlimited is None: unlimited = dc.qoss.add( params.QoS( name='unlimitednetwork', type_='network', ) ) # Find the VNIC profile: profile = api.vnicprofiles.get(name='myprofile') # Change the VNIC profile to use the unlimited QoS: profile.set_qos( params.QoS(id=unlimited.get_id()) ) profile.update() --->8--- -- Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta 3ºD, 28016 Madrid, Spain Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.
participants (3)
-
Juan Hernández
-
like.ma@cs2c.com.cn
-
Roy Golan