Skip to content

Region adjustement SKE #3072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 4, 2025
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## Release (2025-XX-XX)

- `ske`: [v1.0.0](services/ske/CHANGELOG.md#v100)
- **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request.
- `opensearch`: [v0.24.0](services/opensearch/CHANGELOG.md#v0240)
- **Breaking change:** `InstanceParametersTlsProtocols` is now a string array instead of a single string
- Add `required:"true"` tags to model structs
Expand Down
24 changes: 12 additions & 12 deletions examples/ske/ske.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"os"

"github.com/stackitcloud/stackit-sdk-go/core/config"
"github.com/stackitcloud/stackit-sdk-go/core/utils"
"github.com/stackitcloud/stackit-sdk-go/services/ske"
"github.com/stackitcloud/stackit-sdk-go/services/ske/wait"
Expand All @@ -15,10 +14,11 @@ func main() {
// Specify the project ID
projectId := "PROJECT_ID"

// Specify the region
region := "REGION"

// Create a new API client, that uses default authentication and configuration
skeClient, err := ske.NewAPIClient(
config.WithRegion("eu01"),
)
skeClient, err := ske.NewAPIClient()
if err != nil {
fmt.Fprintf(os.Stderr, "Creating API client: %v\n", err)
os.Exit(1)
Expand All @@ -33,7 +33,7 @@ func main() {
// }

// Get the ske clusters for your project
getClustersResp, err := skeClient.ListClusters(context.Background(), projectId).Execute()
getClustersResp, err := skeClient.ListClusters(context.Background(), projectId, region).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GetClusters`: %v\n", err)
} else {
Expand All @@ -42,7 +42,7 @@ func main() {

var availableVersion string
// Get the ske provider options
getOptionsResp, err := skeClient.ListProviderOptions(context.Background()).Execute()
getOptionsResp, err := skeClient.ListProviderOptions(context.Background(), region).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GetOptions`: %v\n", err)
} else {
Expand Down Expand Up @@ -77,47 +77,47 @@ func main() {
},
}
clusterName := "cl-name"
createClusterResp, err := skeClient.CreateOrUpdateCluster(context.Background(), projectId, clusterName).CreateOrUpdateClusterPayload(createInstancePayload).Execute()
createClusterResp, err := skeClient.CreateOrUpdateCluster(context.Background(), projectId, region, clusterName).CreateOrUpdateClusterPayload(createInstancePayload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CreateCluster`: %v\n", err)
} else {
fmt.Printf("Triggered creation of cluster with name \"%s\".\n", *createClusterResp.Name)
}

// Wait for cluster creation to complete
_, err = wait.CreateOrUpdateClusterWaitHandler(context.Background(), skeClient, projectId, clusterName).WaitWithContext(context.Background())
_, err = wait.CreateOrUpdateClusterWaitHandler(context.Background(), skeClient, projectId, region, clusterName).WaitWithContext(context.Background())
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CreateOrUpdateCluster`: %v\n", err)
} else {
fmt.Printf("Cluster created.\n")
}

// Start cluster credential rotation
_, err = skeClient.StartCredentialsRotationExecute(context.Background(), projectId, clusterName)
_, err = skeClient.StartCredentialsRotationExecute(context.Background(), projectId, region, clusterName)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `StartCredentialsRotation`: %v\n", err)
} else {
fmt.Printf("Triggered start of cluster credentials rotation.\n")
}

// Wait for cluster credential rotation to be prepared
_, err = wait.StartCredentialsRotationWaitHandler(context.Background(), skeClient, projectId, clusterName).WaitWithContext(context.Background())
_, err = wait.StartCredentialsRotationWaitHandler(context.Background(), skeClient, projectId, region, clusterName).WaitWithContext(context.Background())
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `StartRotateCredentials`: %v\n", err)
} else {
fmt.Printf("Cluster credentials ready to rotate.\n")
}

// Complete cluster credential rotation
_, err = skeClient.CompleteCredentialsRotationExecute(context.Background(), projectId, clusterName)
_, err = skeClient.CompleteCredentialsRotationExecute(context.Background(), projectId, region, clusterName)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CompleteCredentialsRotation`: %v\n", err)
} else {
fmt.Printf("Triggered completion of cluster credentials rotation.\n")
}

// Wait for cluster credential rotation to be completed
_, err = wait.CompleteCredentialsRotationWaitHandler(context.Background(), skeClient, projectId, clusterName).WaitWithContext(context.Background())
_, err = wait.CompleteCredentialsRotationWaitHandler(context.Background(), skeClient, projectId, region, clusterName).WaitWithContext(context.Background())
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CompleteRotateCredentials`: %v\n", err)
} else {
Expand Down
3 changes: 3 additions & 0 deletions services/ske/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v1.0.0
- **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request.

## v0.27.0
- **Feature:** Add new `ClusterErrorCode` types: `CLUSTERERRORCODE_INFRA_SNA_NETWORK_NOT_FOUND`, `CLUSTERERRORCODE_FETCHING_ERRORS_NOT_POSSIBLE`

Expand Down
2 changes: 1 addition & 1 deletion services/ske/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.27.0
v1.0.0
Loading
Loading