Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interfaces lists #85

Open
Xrou opened this issue Mar 28, 2022 · 1 comment
Open

interfaces lists #85

Xrou opened this issue Mar 28, 2022 · 1 comment

Comments

@Xrou
Copy link

Xrou commented Mar 28, 2022

Hi, i m using tik4net. I need to add elements in these two lists (screenshot). I didn't found any classes describing these lists in Objects.Interfaces.
How to add elements in thsese lists?
scrsht

@Deantwo
Copy link
Contributor

Deantwo commented Mar 5, 2024

I haven't tried the Objects portion of this library, but doing it with normal API commands is simple.

Example code:

TikConnection con = ConnectionFactory.OpenConnection(Type.Api, _host, _username, _password);

ITikCommand cmd = conn.CreateCommand("/interface/list/add"
                                    , conn.Connection.CreateParameter("name", _listName)
                                    );
cmd.ExecuteNonQuery();
System.Diagnostics.Debug.WriteLine($"Interface list ({_listName}) created.");

ITikCommand cmd = conn.CreateCommand("/interface/list/add"
                                    , conn.Connection.CreateParameter("list", _listName)
                                    , conn.Connection.CreateParameter("interface", _interfaceName)
                                    );
cmd.ExecuteNonQuery();
System.Diagnostics.Debug.WriteLine($"Interface list ({_listName}) member ({_interfaceName}) created.");

This is untested, but it should be easy to get working from here.

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

No branches or pull requests

2 participants