network throughput test using delphixpy

  • 0
  • 1
  • Problem
  • Updated 2 weeks ago
  • Solved
I am using delphixpy to perform throughput test. I am able to successfully perform latency test for the given host using delphixpy. 
But i am getting type error when I assign remote_host to NetworkThroughputTestParameters..
anyone can help me here?
thanks in advance.
Photo of Guru

Guru

  • 130 Points 100 badge 2x thumb

Posted 3 weeks ago

  • 0
  • 1
Photo of Scott MacDonald

Scott MacDonald, Staff Engineer

  • 2,632 Points 2k badge 2x thumb
Hi Guru,Can you share your code block and exact error?Cheers,Scott.
Photo of Guru

Guru

  • 130 Points 100 badge 2x thumb
Scott, 
I tried with couple of options. I am posting all of them here with respective error messages.. i am missing something here..
Let me know if any additional details required. 

-------attempt1------
network_test_param_objtx = NetworkThroughputTestParameters()
network_test_param_objtx.remoteHost = "host1"
try:
    throughput.create(dx_session_obj.server_session,network_test_param_objtx)
ERROR: #'The field "{0}" is required.'
------attempt2------------
hst = Host()
hst.address = "host1"
network_test_param_objtx = NetworkThroughputTestParameters()
network_test_param_objtx.remoteHost = hst 
try:
    throughput.create(dx_session_obj.server_session,network_test_param_objtx)
ERROR: #'The field "{0}" is required.'
--------attempt3-------------------------
network_test_param_objtx = NetworkThroughputTestParameters()
network_test_param_objtx.remote_host = "host1"
try:
    throughput.create(dx_session_obj.server_session,network_test_param_objtx)
ERROR:The provided string "host1" is not a valid object reference.'

================
definition of remote_host in NetworkThroughputTestParameters.py; expects string value, but validates against objectReference. 
---------
        if obj._remote_host[0] is not None and obj._remote_host[0] is not obj.__undef__:
            assert isinstance(obj._remote_host[0], basestring), ("Expected one of [u'string'], but got %s" % type(obj._remote_host[0]))
            common.validate_format(obj._remote_host[0], "objectReference", None, None)
---------

Photo of Guru

Guru

  • 130 Points 100 badge 2x thumb
sorry for delayed reply. 

yes. it is working after using host_object.reference after retrieving host list from engine.
Photo of Scott MacDonald

Scott MacDonald, Staff Engineer

  • 2,632 Points 2k badge 2x thumb
Official Response
Hi Guru,

Ah I see. Per the API docs, the parameter "remoteHost" in a NetworkThroughputTestParameters object should be a Reference to a Host. This is not the hostname, this is the object name, which will have the form "HOST-nnn" where nnn is an integer ID number. For example "HOST-12". If you replace the hostname "host1" with it's corresponding reference this should work.

Many Thanks,

Scott.