Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NodeListCmd = &cobra.Command{ Use: "nodelist [nodes.json]", Short: "Generate a node list to seed a node", Args: cobra.MinimumNArgs(1), PreRunE: func(cmd *cobra.Command, args []string) (err error) { inputNodeListParams.OutputFile = args[0] inputNodeListParams.ProjectID, err = cmd.Flags().GetString("project-id") return err }, RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() db := database.NewDatastore(cmd.Context(), database.DatastoreOptions{ ProjectID: inputNodeListParams.ProjectID, }) nodes, err := db.NodeList(ctx, inputNodeListParams.Limit) if err != nil { return err } bytes, err := json.MarshalIndent(nodes, "", jsonIndent) if err != nil { return err } if err = os.WriteFile(inputNodeListParams.OutputFile, bytes, 0644); err != nil { return err } return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.