UpdateSecretValue
client.Secrets.UpdateValue(ctx, body) (*SecretUpdateValueResponse, error)
POST/gitpod.v1.SecretService/UpdateSecretValue
Updates the value of an existing secret.
Use this method to:
- Rotate secret values
- Update credentials
Examples
-
Update secret value:
Changes the value of an existing secret.
secretId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" value: "new-secret-value"
UpdateSecretValue
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.Secrets.UpdateValue(context.TODO(), gitpod.SecretUpdateValueParams{
SecretID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
Value: gitpod.F("new-secret-value"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
{}Returns Examples
{}