Quantcast
Channel: THWACK: Popular Discussions - Orion SDK
Viewing all articles
Browse latest Browse all 3719

Exception adding Orion.Container with dynamic query via Python

$
0
0

Below is what i'm using to invoke CreateContainer call and the trace is below it. What am i doing wrong here? I've tried this with both filter:/Orion.Nodes[CustomProperties.Site={0}] and filter:/Orion.Nodes[CustomProperties.Site='{0}'] thinking maybe since the filter is a string that's why it couldn't cast my member definition correctly but it's still bombing with the same error.

 

group_member_def = '''

<ArrayOfMemberDefinitionInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance"

    xmlns="http://schemas.solarwinds.com/2008/Orion">

<MemberDefinitionInfo>

<Name>{0}_Devices</Name>

<Definition>filter:/Orion.Nodes[CustomProperties.Site={0}]</Definition>

</MemberDefinitionInfo></ArrayOfMemberDefinitionInfo>

'''

 

swis.invoke(

    'Orion.Container',

    'CreateContainer',

    'name', #name

    'Core', #owner

    60, #frequency

    0, #statusCalculator

    'description', #description

    'true', #pollingEnable

    group_member_def.format('test') #memberDef

)

 

 

'SolarWinds.InformationService.Verb.VerbExecutorException: Verb Orion.Container.CreateContainer cannot unpackage parameter 6 with type SolarWinds.Data.Providers.Orion.Containers.DataProvider.MemberDefinitionInfo[] ---> Newtonsoft.Json.JsonSerializationException: Error converting value "<ArrayOfMemberDefinitionInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance"    xmlns="http://schemas.solarwinds.com/2008/Orion"><MemberDefinitionInfo><Name>test_Devices</Name><Definition>filter:/Orion.Nodes[CustomProperties.Site=test]</Definition></MemberDefinitionInfo></ArrayOfMemberDefinitionInfo>" to type \'SolarWinds.Data.Providers.Orion.Containers.DataProvider.MemberDefinitionInfo[]\'. Path \'\'. ---> System.ArgumentException: Could not cast or convert from System.String to SolarWinds.Data.Providers.Orion.Containers.DataProvider.MemberDefinitionInfo[].\r\n   at Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable(Object value, Type initialType, Type targetType)\r\n   at Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast(Object initialValue, CultureInfo culture, Type targetType)\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)\r\n   --- End of inner exception stack trace ---\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)\r\n   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)\r\n   at SolarWinds.InformationService.Verb.VerbExecutorContext.<>c__DisplayClass22_0.<UnpackageParameters>b__0(Int32 index)\r\n   --- End of inner exception stack trace ---\r\n   at SolarWinds.InformationService.Verb.VerbExecutorContext.<>c__DisplayClass22_0.<UnpackageParameters>b__0(Int32 index)\r\n   at SolarWinds.InformationService.Verb.VerbExecutorContext.CreateParameters(Func`2 getParameterAt, Int32 parametersCount, Stream stream)\r\n   at SolarWinds.InformationService.Verb.VerbExecutorContext.UnpackageParameters(JArray parameters)\r\n   at SolarWinds.InformationService.Core.InformationService.Invoke[T](String entity, String verb, Action`1 setupParameters, Func`2 extractReturnValue)'


Viewing all articles
Browse latest Browse all 3719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>