Skip to content

[GO] UpdateConcurrencyLimit the concurrency limit is not reflecting in Kestra #170

@Pradumnasaraf

Description

@Pradumnasaraf

Describe the issue

UpdateConcurrencyLimit the concurrency limit is not reflecting in Kestra

package main

import (
	"context"
	"encoding/json"
	"fmt"
	kestraClient "github.com/kestra-io/client-sdk/go-sdk/kestra_api_client"
	"os"
)

func main() {
	host := "http://localhost:8021"
	configuration := kestraClient.NewConfiguration()
	configuration.Servers = []kestraClient.ServerConfiguration{
		{URL: host},
	}
	apiClient := kestraClient.NewAPIClient(configuration)

	ctx := context.Background()
	ctx = context.WithValue(ctx, kestraClient.ContextBasicAuth, kestraClient.BasicAuth{
		UserName: "psaraf@kestra.io",
		Password: "Kestra@123",
	})
	flowId := "test1" // string | 
	namespace := "qa" // string | 
	tenant := "pradumnasaraf" // string | 
	running := int32(1)
	concurrencyLimit := *kestraClient.NewConcurrencyLimit(tenant, namespace, flowId) // ConcurrencyLimit |
	concurrencyLimit.Running = &running

	resp, r, err := apiClient.FlowsAPI.UpdateConcurrencyLimit(ctx, flowId, namespace, tenant).ConcurrencyLimit(concurrencyLimit).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "❌ Error calling UpdateConcurrencyLimit: %v\n", err)
		if r != nil {
			fmt.Fprintf(os.Stderr, "❌ HTTP status: %s\n", r.Status)
		}
		if gErr, ok := err.(*kestraClient.GenericOpenAPIError); ok {
			if body := gErr.Body(); len(body) > 0 {
				fmt.Fprintf(os.Stderr, "❌ Response body: %s\n", string(body))
			}
		}
		return
	}

	// Print response.
	if b, mErr := json.MarshalIndent(resp, "", "  "); mErr == nil {
		fmt.Fprintf(os.Stdout, "✅ Response:\n%s\n", string(b))
	} else {
		fmt.Fprintf(os.Stdout, "✅ Response: %+v\n", resp)
	}

}

Environment

  • Kestra Version: develop

Metadata

Metadata

Assignees

Labels

area/backendNeeds backend code changes

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions