Skip to content
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
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