OpenIxia / IxNetwork

A central location for IxNetwork sample scripts and utilities. Please also visit http://openixia.com
MIT License
50 stars 59 forks source link

configure IxNetwork licensing setting is failing #61

Closed MichaelLindner1 closed 5 years ago

MichaelLindner1 commented 5 years ago

Hello, when using a REST client with a PATCH to the link: https://192.168.45.131/api/v1/sessions/2/ixnetwork/globals/licensing Body { "licensingServers": [ "192.168.45.133" ], "mode": "subscription", "tier": "tier3" } everything is working. But when using RestPy it is failing.

license_server = ['192.168.45.133'] license_mode = 'mixed' license_tier = 'tier3'

ixnetwork.Globals.Licensing.LicensingServers(license_server) 2019-05-14 07:31:15 [ixnetwork_restpy.connection] [DEBUG] POST https://192.168.45.131:443/api/v1/sessions/2/ixnetwork/operations/select?deprecated=true {"selects": [{"from": "/api/v1/sessions/2/ixnetwork/", "properties": [], "children": [{"child": "globals", "properties": [""], "filters": []}], "inlines": []}]} 2019-05-14 07:31:15 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted b'' 2019-05-14 07:31:15 [ixnetwork_restpy.connection] [DEBUG] POST https://192.168.45.131:443/api/v1/sessions/2/ixnetwork/operations/select?deprecated=true {"selects": [{"from": "/api/v1/sessions/2/ixnetwork/globals", "properties": [], "children": [{"child": "licensing", "properties": [""], "filters": []}], "inlines": []}]} 2019-05-14 07:31:15 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted b'' Traceback (most recent call last): File "", line 1, in TypeError: 'list' object is not callable

ixnetwork.Globals.Licensing.Mode(license_mode) 2019-05-14 07:31:20 [ixnetwork_restpy.connection] [DEBUG] POST https://192.168.45.131:443/api/v1/sessions/2/ixnetwork/operations/select?deprecated=true {"selects": [{"from": "/api/v1/sessions/2/ixnetwork/", "properties": [], "children": [{"child": "globals", "properties": [""], "filters": []}], "inlines": []}]} 2019-05-14 07:31:21 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted b'' 2019-05-14 07:31:21 [ixnetwork_restpy.connection] [DEBUG] POST https://192.168.45.131:443/api/v1/sessions/2/ixnetwork/operations/select?deprecated=true {"selects": [{"from": "/api/v1/sessions/2/ixnetwork/globals", "properties": [], "children": [{"child": "licensing", "properties": [""], "filters": []}], "inlines": []}]} 2019-05-14 07:31:21 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted b'' Traceback (most recent call last): File "", line 1, in TypeError: 'str' object is not callable

ixnetwork.Globals.Licensing.Tier(license_tier) 2019-05-14 07:31:25 [ixnetwork_restpy.connection] [DEBUG] POST https://192.168.45.131:443/api/v1/sessions/2/ixnetwork/operations/select?deprecated=true {"selects": [{"from": "/api/v1/sessions/2/ixnetwork/", "properties": [], "children": [{"child": "globals", "properties": [""], "filters": []}], "inlines": []}]} 2019-05-14 07:31:26 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted b'' 2019-05-14 07:31:26 [ixnetwork_restpy.connection] [DEBUG] POST https://192.168.45.131:443/api/v1/sessions/2/ixnetwork/operations/select?deprecated=true {"selects": [{"from": "/api/v1/sessions/2/ixnetwork/globals", "properties": [], "children": [{"child": "licensing", "properties": [""], "filters": []}], "inlines": []}]} 2019-05-14 07:31:26 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted b'' Traceback (most recent call last): File "", line 1, in TypeError: 'str' object is not callable

Could you please tell me, what is going wrong? The version is IxNetwork 8.50 EA. Application Version: 8.50.1.41IxNetwork API Server Version: 8.50.1.53

Thanks, Michael

ajbalogh commented 5 years ago

.LicensingServers, .Mode, and .Tier are properties not methods. Please assign to them as opposed to calling them.

e.g,, Licensing.LicensingServers = license_server