StopAgentExecution
client.Agents.StopExecution(ctx, body) (*AgentStopExecutionResponse, error)
POST/gitpod.v1.AgentService/StopAgentExecution
Stops an active agent execution.
Use this method to:
- Stop an agent that is currently running
- Prevent further processing or resource usage
Examples
-
Stop an agent execution by ID:
agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35"
StopAgentExecution
package main
import (
"context"
"fmt"
"github.com/gitpod-io/gitpod-sdk-go"
"github.com/gitpod-io/gitpod-sdk-go/option"
)
func main() {
client := gitpod.NewClient(
option.WithBearerToken("My Bearer Token"),
)
response, err := client.Agents.StopExecution(context.TODO(), gitpod.AgentStopExecutionParams{
AgentExecutionID: gitpod.F("6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
{}Returns Examples
{}