Forum Discussion
LTConfig::Field::get_values question
In [297]: b.LTConfig.Field.get_value.params
Out[297]:
[(class_instance_key, u'LTConfig.ClassInstanceKey'),
(field_instance_name, u'string')]
In [298]: syslog_instance = b.LTConfig.Class.typefactory.create('LTConfig.ClassInstanceKey')
In [299]: syslog_instance
Out[299]:
(LTConfig.ClassInstanceKey){
container = None
container_class = None
class_name = None
name = None
}
In [300]: syslog_instance.class_name = "syslog"
In [301]: syslog_instance.name = "syslog"
In [302]: b.LTConfig.Field.get_value(class_instance_key = syslog_instance, field_instance_name = 'include')
Out[302]: destination loghost { udp(10.20.5.11 port (514)); udp(10.20.4.167 port (514)); };
In [303]:
In [303]: b.LTConfig.Field.get_values.params
Out[303]:
[(class_instance_keys, u'LTConfig.ClassInstanceKeySequence'),
(field_instance_names, u'Common.StringSequenceSequence')]
In [304]: class_instance_key_seq = b.LTConfig.Class.typefactory.create('LTConfig.ClassInstanceKeySequence')
In [305]: class_instance_key_seq
Out[305]:
(LTConfig.ClassInstanceKeySequence){
_arrayType = ""
_offset = ""
_id = ""
_href=""
_arrayType = ""
}
In [306]: class_instance_key_seq.item = [ syslog_instance ]
In [307]: class_instance_key_seq
Out[307]:
(LTConfig.ClassInstanceKeySequence){
_arrayType = ""
_offset = ""
_id = ""
_href=""
item[] =
(LTConfig.ClassInstanceKey){
container = None
container_class = None
class_name = "syslog"
name = "syslog"
},
}
In [308]: field_instance_names_seq = b.LTConfig.Class.typefactory.create('Common.StringSequenceSequence')
In [309]: field_instance_names_seq
Out[309]:
(Common.StringSequenceSequence){
_arrayType = ""
_offset = ""
_id = ""
_href=""
_arrayType = ""
}
In [310]: field_instance_names_seq.item = [ 'include' ]
In [311]: field_instance_names_seq
Out[311]:
(Common.StringSequenceSequence){
_arrayType = ""
_offset = ""
_id = ""
_href=""
item[] =
"include",
}
In [312]: b.LTConfig.Field.get_values(class_instance_keys = class_instance_key_seq, field_instance_names = field_instance_names_seq )
Out[312]: [[]]
Note: I don't get an error but don't get any return values. Much less when trying to get multiple fields,
- hoolio
Cirrostratus
Am missing something stupid. - This looks to me like Python which is foreign to me. Anyone with PyControl knowledge that can shed any insight here. One of these days I'll have to brush up on Python...
- Alex__Applebaum
Employee
Yeah, must be something specific to python or pycontrol I'm not getting as powershell works just fine. - Alex__Applebaum
Employee
Ahhh Duhhh. Was something stupid as suspected. After doing it in perl and powershell just fine and looking at the xml going across the wire, finally figured it out. I just had to double wrap that python object (can't just feed it an array syntax like perl/powershell, etc.). - Todd_Cromwell_9
Nimbostratus
You may want to isolate this LTConfig code from other parts of your application so it is easy to switch out. We have gotten requests for canned (specific) interfaces for some of the items now supported via LTConfig. We are evaluating whether it is actually worth spending heaps of effort to make an internal bridge that would make the old LTConfig access work if and when we do this.- John_Gruber_432Historic F5 AccountSo 15 months later... is there a canned interface to set the syslog servers yet?
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com