Skip to content

feat: Region adjustment for load balancer #1566

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
Mar 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Region Adjustment
- Update CHANGELOG
- adapted examples and waiters
  • Loading branch information
marceljk committed Mar 14, 2025
commit 4a123ffc7b3816f34a671a098789cddbe646fc40
12 changes: 6 additions & 6 deletions examples/loadbalancer/loadbalancer.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/loadbalancer"
)
Expand All @@ -14,17 +13,18 @@ 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
loadbalancerClient, err := loadbalancer.NewAPIClient(
config.WithRegion("eu01"),
)
loadbalancerClient, err := loadbalancer.NewAPIClient()
if err != nil {
fmt.Fprintf(os.Stderr, "Creating API client: %v\n", err)
os.Exit(1)
}

// List the load balancer instances for your project
listInstancesResp, err := loadbalancerClient.ListLoadBalancers(context.Background(), projectId).Execute()
listInstancesResp, err := loadbalancerClient.ListLoadBalancers(context.Background(), projectId, region).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ListLoadBalancers`: %v\n", err)
os.Exit(1)
Expand Down Expand Up @@ -69,7 +69,7 @@ func main() {
},
},
}
createLoadBalancerRes, err := loadbalancerClient.CreateLoadBalancer(context.Background(), projectId).CreateLoadBalancerPayload(createLoadBalancerPayload).XRequestID("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").Execute()
createLoadBalancerRes, err := loadbalancerClient.CreateLoadBalancer(context.Background(), projectId, region).CreateLoadBalancerPayload(createLoadBalancerPayload).XRequestID("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CreateLoadBalancer`: %v\n", err)
os.Exit(1)
Expand Down
5 changes: 5 additions & 0 deletions services/loadbalancer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v1.0.0 (2025-03-14)
- **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.
- **Breaking Change:** Remove deprecated API methods `DisableService` and `EnableService`. They are no longer required because the service automatically enables and disable.
- **Breaking Change:** Remove WaitHandler `EnableServiceWaitHandler` for `EnableService`.

## v0.18.0 (2025-02-21)
- **New:** Minimal go version is now Go 1.21

Expand Down
Loading
Loading