MCPcopy Create free account
hub / github.com/auth0/auth0-cli / showNetworkACLCmd

Function showNetworkACLCmd

internal/cli/network_acl.go:577–612  ·  view source on GitHub ↗
(cli *cli)

Source from the content-addressed store, hash-verified

575}
576
577func showNetworkACLCmd(cli *cli) *cobra.Command {
578 var inputs struct {
579 ID string
580 }
581
582 cmd := &cobra.Command{
583 Use: "show",
584 Args: cobra.MaximumNArgs(1),
585 Short: "Show a network ACL",
586 Long: "Show the details of a network ACL.",
587 Example: ` auth0 network-acl show <id>
588 auth0 network-acl show <id> --json
589 auth0 network-acl show <id> --json-compact`,
590 RunE: func(cmd *cobra.Command, args []string) error {
591 if len(args) > 0 {
592 inputs.ID = args[0]
593 } else {
594 if err := networkACLID.Pick(cmd, &inputs.ID, cli.networkACLPickerOptions); err != nil {
595 return err
596 }
597 }
598
599 acl, err := cli.api.NetworkACL.Read(cmd.Context(), inputs.ID)
600 if err != nil {
601 return fmt.Errorf("failed to get network ACL with ID %q: %w", inputs.ID, err)
602 }
603
604 cli.renderer.NetworkACLShow(acl)
605 return nil
606 },
607 }
608
609 cmd.Flags().BoolVar(&cli.json, "json", false, "Output in JSON format")
610
611 return cmd
612}
613
614func createNetworkACLCmd(cli *cli) *cobra.Command {
615 var inputs struct {

Callers 1

networkACLCmdFunction · 0.85

Calls 4

ErrorfMethod · 0.80
NetworkACLShowMethod · 0.80
ReadMethod · 0.65
PickMethod · 0.45

Tested by

no test coverage detected