Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions cmd/kosli/createFlow.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ type createFlowOptions struct {
}

type FlowPayload struct {
Name string `json:"name"`
Description string `json:"description"`
Template []string `json:"template,omitempty"`
Name string `json:"name"`
Description string `json:"description"`
// TODO: Visibility is deprecated and ignored by recent Kosli servers, but older
// instances still reject the payload without it. Keep sending
// "private" until the minimum supported server version no longer requires
// this field, then remove the field and the assignment in run().
Visibility string `json:"visibility"`
Comment thread
mbevc1 marked this conversation as resolved.
Comment thread
mbevc1 marked this conversation as resolved.
Template []string `json:"template,omitempty"`
}

func newCreateFlowCmd(out io.Writer) *cobra.Command {
Expand Down Expand Up @@ -95,6 +100,7 @@ func (o *createFlowOptions) run(args []string) error {
var url string
var err error
o.payload.Name = args[0]
o.payload.Visibility = "private"

if o.TemplateFile != "" || o.UseEmptyTemplate {
url, err = neturl.JoinPath(global.Host, "api/v2/flows", global.Org, "template_file")
Expand Down
Loading