Config
Accessor: client.Config()
Retrieve and update configuration for sandboxes and the gateway.
GetSandbox
Section titled “GetSandbox”Retrieve the current configuration for a specific sandbox.
config, err := client.Config().GetSandbox(ctx, "default", "sandbox-123")if err != nil { log.Fatal(err)}fmt.Printf("Sandbox config: policy_version=%d, revision=%d\n", config.PolicyVersion, config.ConfigRevision)GetGateway
Section titled “GetGateway”Retrieve the gateway-level configuration.
config, err := client.Config().GetGateway(ctx)if err != nil { log.Fatal(err)}fmt.Printf("Gateway settings revision: %d\n", config.SettingsRevision)Update
Section titled “Update”Apply a configuration update. The update is validated before being applied.
result, err := client.Config().Update(ctx, "default", &v1.ConfigUpdate{ Name: "sandbox-123", SettingKey: "idle_timeout", SettingValue: &v1.SettingValue{ Type: v1.SettingValueString, StringVal: "30m", },})if err != nil { // See [Error Handling](../error-handling.md) for validation errors log.Fatal(err)}fmt.Printf("Config updated: revision=%d\n", result.SettingsRevision)See also: Error Handling
We are a Cloud Native Computing Foundation sandbox project.
Copyright OpenShell a Series of LF Projects, LLC
For website terms of use, trademark policy and other project policies please see lfprojects.org/policies/.