Exemplo n.º 1
0
func (cmd *Policies) Run(c *cli.Context) {
	policies := entity_policies.PolicyList(cmd.network, c.Args()[0], c.Args()[1])
	table := terminal.NewTable([]string{"Name", "State"})
	for _, policy := range policies {
		table.Add(policy.Name, string(policy.State))
	}
	table.Print()
}
Exemplo n.º 2
0
func (cmd *Policy) list(application, entity string) {
	policies, err := entity_policies.PolicyList(cmd.network, application, entity)
	if nil != err {
		error_handler.ErrorExit(err)
	}
	table := terminal.NewTable([]string{"Id", "Name", "State"})
	for _, policy := range policies {
		table.Add(policy.Id, policy.Name, string(policy.State))
	}
	table.Print()
}