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

a table without keys #35

Open
yhx-coder opened this issue Jun 1, 2022 · 4 comments
Open

a table without keys #35

yhx-coder opened this issue Jun 1, 2022 · 4 comments

Comments

@yhx-coder
Copy link

I have a table without keys, and I try to down some entries for it through sswitch_thrift_API.SimpleSwitchThriftAPI.table_add.Unfortunately, thrift_API.SwitchInfo.load_json_str could not load the table. Could you give me some advice? Thanks a lot!

@edgar-costa
Copy link
Collaborator

What do you want to add if there are no keys? You can only have a default action no? Or can you explain a bit more what are you trying to do?

@yhx-coder
Copy link
Author

This is my definition of table.
table swid { actions = { set_swid; NoAction; } default_action=NoAction(); }
the action set_swid tries to set switch id for each device. And I want to down the switch id.

@edgar-costa
Copy link
Collaborator

But if you have no keys, the only way to make that action to be "executed" is by setting it as default. Thus, table_add can not be used with keyless tables, you need to match to something.

@yhx-coder
Copy link
Author

Thanks for your reply.
I made some fixes in my thrift_API.SwitchInfo.load_json_str to make it work for this case. I think it is reasonable. Because even if I set it as default, I need the control plane to add parameters. But at this time, the key is redundant. This behavior is supported in CLI. So if the official will support this kind of table in the future?
By the way, I think you are right. I do need to modify my definition of table.

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