Bug 830511

Summary: RESTAPI: RSDL does not expose add for /api/templates/xxx/nics
Product: Red Hat Enterprise Virtualization Manager Reporter: Elena <edolinin>
Component: ovirt-engine-restapiAssignee: Ori Liel <oliel>
Status: CLOSED DUPLICATE QA Contact: Elena <edolinin>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: acathrow, dyasny, ecohen, iheim, mkolesni, mpastern, Rhev-m-bugs, srevivo, yeylon, ykaul
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: si13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-14 05:43:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Elena 2012-06-10 09:54:07 UTC
response = collection.add(entity) 

where collection is templates nics and entity=new nic

Got exception:
  File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/common.py", line 28, in __getattr__ 
    return self.__getattribute__(item) 
AttributeError: 'TemplateNics' object has no attribute 'add'

Comment 3 Ori Liel 2012-07-15 13:33:35 UTC
merged, commit 5b89e03de3fb9a5e0f9a8828c68b40efc9d2526e

Comment 4 Elena 2012-08-08 14:19:11 UTC
si13, rhevm-sdk-3.1.0.5-1.el6ev.noarch: same error as before:

    response = collection.add(entity)
  File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/common.py", line 28, in __getattr__
    return self.__getattribute__(item)
AttributeError: 'TemplateNics' object has no attribute 'add'

Comment 5 Michael Pasternak 2012-08-08 15:04:42 UTC
ori?

Comment 6 Ori Liel 2012-08-09 09:03:23 UTC
This signature for add template-nic was added to yaml file in commit: 5b89e03de3fb9a5e0f9a8828c68b40efc9d2526e
about three weeks ago:

+- name: /api/templates/{template:id}/nics|rel=add
+  request:
+    body:
+      parameterType: NIC
+      signatures:
+      - mandatoryArguments: {nic.network.id|name: 'xs:string', nic.name: 'xs:string'}
+        optionalArguments: {nic.mac.address: 'xs:string', nic.interface: 'xs:string', nic.port_mirroring.networks.network--COLLECTION: {network.id: 'xs:string'}}
+    urlparams: {}
+    headers: {Content-Type: application/xml|json, Expect: 201-created}


If sdk was generated since then it should be in

Comment 7 Ori Liel 2012-08-12 08:00:11 UTC
Another issue is causing the problem, being fixed in the context of another bug by Michael Kolesnik; patch will be sent shortly by him

Comment 8 Itamar Heim 2012-08-13 21:44:19 UTC
mike - duplicate of bug 846950?

Comment 9 Mike Kolesnik 2012-08-14 05:43:46 UTC
(In reply to comment #8)
> mike - duplicate of bug 846950?

Yes, therefore I am closing as duplicate (as the other bug is already in proccess of being merged into the product).

*** This bug has been marked as a duplicate of bug 846950 ***