chore: refactor influxid.ID
, cleanup organization checking (#326)
This commit is contained in:
@ -3,7 +3,6 @@ package main
|
||||
import (
|
||||
"github.com/influxdata/influx-cli/v2/clients/org"
|
||||
"github.com/influxdata/influx-cli/v2/pkg/cli/middleware"
|
||||
"github.com/influxdata/influx-cli/v2/pkg/influxid"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
@ -54,18 +53,18 @@ func newOrgCreateCmd() cli.Command {
|
||||
}
|
||||
|
||||
func newOrgDeleteCmd() cli.Command {
|
||||
var id influxid.ID
|
||||
var id string
|
||||
return cli.Command{
|
||||
Name: "delete",
|
||||
Usage: "Delete organization",
|
||||
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
|
||||
Flags: append(
|
||||
commonFlags(),
|
||||
&cli.GenericFlag{
|
||||
Name: "id, i",
|
||||
Usage: "The organization ID",
|
||||
EnvVar: "INFLUX_ORG_ID",
|
||||
Value: &id,
|
||||
&cli.StringFlag{
|
||||
Name: "id, i",
|
||||
Usage: "The organization ID",
|
||||
EnvVar: "INFLUX_ORG_ID",
|
||||
Destination: &id,
|
||||
},
|
||||
),
|
||||
Action: func(ctx *cli.Context) error {
|
||||
@ -91,13 +90,13 @@ func newOrgListCmd() cli.Command {
|
||||
Name: "name, n",
|
||||
Usage: "The organization name",
|
||||
EnvVar: "INFLUX_ORG",
|
||||
Destination: ¶ms.Name,
|
||||
Destination: ¶ms.OrgName,
|
||||
},
|
||||
&cli.GenericFlag{
|
||||
Name: "id, i",
|
||||
Usage: "The organization ID",
|
||||
EnvVar: "INFLUX_ORG_ID",
|
||||
Value: ¶ms.ID,
|
||||
&cli.StringFlag{
|
||||
Name: "id, i",
|
||||
Usage: "The organization ID",
|
||||
EnvVar: "INFLUX_ORG_ID",
|
||||
Destination: ¶ms.OrgID,
|
||||
},
|
||||
),
|
||||
Action: func(ctx *cli.Context) error {
|
||||
@ -118,18 +117,18 @@ func newOrgUpdateCmd() cli.Command {
|
||||
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
|
||||
Flags: append(
|
||||
commonFlags(),
|
||||
&cli.GenericFlag{
|
||||
Name: "id, i",
|
||||
Usage: "The organization ID",
|
||||
EnvVar: "INFLUX_ORG_ID",
|
||||
Required: true,
|
||||
Value: ¶ms.ID,
|
||||
&cli.StringFlag{
|
||||
Name: "id, i",
|
||||
Usage: "The organization ID",
|
||||
EnvVar: "INFLUX_ORG_ID",
|
||||
Required: true,
|
||||
Destination: ¶ms.OrgID,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "name, n",
|
||||
Usage: "New name to set on the organization",
|
||||
EnvVar: "INFLUX_ORG",
|
||||
Destination: ¶ms.Name,
|
||||
Destination: ¶ms.OrgName,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "description, d",
|
||||
|
Reference in New Issue
Block a user