Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Missing Query Parameter at /api/2.0/services/securitygroup/securitygroupId /members/member-moref #40

Open
Asayu123 opened this issue Feb 27, 2017 · 2 comments

Comments

@Asayu123
Copy link

Hello, I found some problem in raml file, so I'll write it down here.

Abstract

Query parameter "failIfExists" and "failIfAbsent" defined in "NSX vSphere API Guide - NSX 6.2 for vSphere" at Title URI are not defined in nsxraml.

Happend in

RAML version: 6.2.3 (defined in nsxvapi.raml, line-11)

Effect to other project

nsxramlclient crashes when we add query parameters in client.update / delete method like following

Code
targer_resource = 'secGroupMember'
uri_parameters = {'objectId': sec_group_id, 'memberMoref': vm_id}
query_parameters = {'failIfExists': False}
res = self.client_session.update(targer_resource, uri_parameters=uri_parameters,
                                         query_parameters_dict=query_parameters)
OutPut
File "/Users/user_name/virtual_env_name/lib/python3.5/site-packages/nsxramlclient/client.py", line 156, in _request
    query_parameters_dict)
  File "/Users/user_name/virtual_env_name/lib/python3.5/site-packages/nsxramlclient/client.py", line 390, in add_query_parameter_url
    found_res_object[1].methods[method].queryParameters.keys() if
AttributeError: 'NoneType' object has no attribute 'keys'

Thank you.

@lmcfarlane
Copy link
Contributor

Thanks for the feedback. We will include this in the next revision of the RAML file.

@aldevar
Copy link

aldevar commented Apr 5, 2017

I have the same problème on vnicStats (https:///api/4.0/edges//statistics/interfaces)

Code

raml_vnics = client_session.read('vnicStats', uri_parameters={'edgeId': edgeId}, query_parameters_dict={'startTime': timestamp}) 

Outpout

  File "./nsx_test.py", line 58, in <module>
    timestamp})
  File "/usr/local/lib/python2.7/dist-packages/nsxramlclient/client.py", line 85, in read
    additional_headers)
  File "/usr/local/lib/python2.7/dist-packages/nsxramlclient/client.py", line 154, in _request
    query_parameters_dict)
  File "/usr/local/lib/python2.7/dist-packages/nsxramlclient/client.py", line 392, in add_query_parameter_url
    found_res_object[1].methods[method].queryParameters.keys() if
AttributeError: 'NoneType' object has no attribute 'keys'

We should be able to add startTime, endTime and interval query_parameters_dict.

Should I open an other Issue for the endpoint?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants