MCPcopy Create free account
hub / github.com/NVIDIA/nvcf / runTaskUpdateSecrets

Function runTaskUpdateSecrets

src/clis/nvcf-cli/cmd/task.go:1100–1143  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

1098 return err
1099 }
1100
1101 clientConfig, err := client.LoadConfig()
1102 if err != nil {
1103 return fmt.Errorf("failed to load configuration: %w", err)
1104 }
1105 c, err := client.NewClient(clientConfig)
1106 if err != nil {
1107 return fmt.Errorf("failed to create client: %w", err)
1108 }
1109 defer c.Close()
1110
1111 ctx, cancel, err := newTaskRequestContext(taskResultsPaginationFlags.timeoutSeconds)
1112 if err != nil {
1113 return err
1114 }
1115 defer cancel()
1116
1117 resp, err := c.GetTaskResults(ctx, taskID, &client.PaginationOptions{
1118 Limit: taskResultsPaginationFlags.limit,
1119 Cursor: taskResultsPaginationFlags.cursor,
1120 })
1121 if err != nil {
1122 return fmt.Errorf("failed to get task results: %w", err)
1123 }
1124
1125 if IsJSONOutput() {
1126 return OutputJSON(resp)
1127 }
1128
1129 if len(resp.Results) == 0 {
1130 fmt.Println("No results found.")
1131 return nil
1132 }
1133 fmt.Printf("Found %d results:\n\n", len(resp.Results))
1134 for _, r := range resp.Results {
1135 fmt.Printf("- %s (%s) created %s\n", r.Name, r.ResultID, r.CreatedAt)
1136 if len(r.Metadata) > 0 {
1137 meta, _ := json.MarshalIndent(r.Metadata, " ", " ")
1138 fmt.Printf(" metadata: %s\n", string(meta))
1139 }
1140 }
1141 if resp.Cursor != "" {
1142 fmt.Printf("\nNext cursor: %s (limit=%d)\n", resp.Cursor, resp.Limit)
1143 }
1144 return nil
1145}
1146

Callers

nothing calls this directly

Calls 9

CloseMethod · 0.95
UpdateTaskSecretsMethod · 0.95
resolveTaskIDFunction · 0.85
parseSecretsListFunction · 0.85
UnmarshalMethod · 0.80
NewClientMethod · 0.80
SuccessMethod · 0.80
ErrorfMethod · 0.45
InfoMethod · 0.45

Tested by

no test coverage detected