Skip to content

Commit

Permalink
Update api base urls (#177)
Browse files Browse the repository at this point in the history
* update argus URLs

* update mongodb flex

* update object storage

* update rm urls

* update flex service

* update examples

* revert argus

---------

Co-authored-by: Dean Oren <deangili.oren@mail.schwarz>
  • Loading branch information
do87 and Dean Oren committed Jul 14, 2023
1 parent 9a4824b commit c6c7265
Show file tree
Hide file tree
Showing 44 changed files with 143 additions and 82 deletions.
25 changes: 25 additions & 0 deletions examples/object-storage/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package main

import (
"context"
"fmt"
"os"

stackit "github.com/SchwarzIT/community-stackit-go-client"
"github.com/SchwarzIT/community-stackit-go-client/pkg/validate"
)

func main() {
ctx := context.Background()
c := stackit.MustNewClientWithKeyAuth(ctx)

fmt.Println("looking for the object storage buckets..")
res, err := c.ObjectStorage.Bucket.List(ctx, os.Getenv("STACKIT_PROJECT_ID"))
if err = validate.Response(res, err, "JSON200.Buckets"); err != nil {
panic(err)
}

for _, bucket := range res.JSON200.Buckets {
fmt.Println(bucket.Name)
}
}
25 changes: 25 additions & 0 deletions examples/resource-management/name.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package main

import (
"context"
"fmt"
"os"

stackit "github.com/SchwarzIT/community-stackit-go-client"
resourcemanagement "github.com/SchwarzIT/community-stackit-go-client/pkg/services/resource-management/v2.0"
"github.com/SchwarzIT/community-stackit-go-client/pkg/validate"
)

func main() {
ctx := context.Background()
c := stackit.MustNewClientWithKeyAuth(ctx)

fmt.Println("looking for project name..")

res, err := c.ResourceManagement.Get(ctx, os.Getenv("STACKIT_PROJECT_ID"), &resourcemanagement.GetParams{})
if err = validate.Response(res, err, "JSON200"); err != nil {
panic(err)
}

fmt.Println(res.JSON200.Name)
}
2 changes: 1 addition & 1 deletion internal/config/argus/v1.0/generate.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package gen

//go:generate go run dev.azure.com/schwarzit/schwarzit.odj.core/_git/stackit-client-generator.git/cmd/oapi-codegen@latest -config config.yaml argus.json
//go:generate go run github.com/do87/stackit-client-generator/cmd/oapi-codegen@v0.0.3 -config config.yaml argus.json
8 changes: 7 additions & 1 deletion internal/config/mongodb-flex/v1.0/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ output-options:
type: error
description: "Aggregated error"
apply-to: ["*"]
imports: ["github.com/SchwarzIT/community-stackit-go-client/pkg/validate"]
imports:
- "github.com/SchwarzIT/community-stackit-go-client/pkg/validate"
- "github.com/SchwarzIT/community-stackit-go-client/pkg/services/mongodb-flex/v1.0/backup"
- "github.com/SchwarzIT/community-stackit-go-client/pkg/services/mongodb-flex/v1.0/flavors"
- "github.com/SchwarzIT/community-stackit-go-client/pkg/services/mongodb-flex/v1.0/instance"
- "github.com/SchwarzIT/community-stackit-go-client/pkg/services/mongodb-flex/v1.0/user"
- "github.com/SchwarzIT/community-stackit-go-client/pkg/services/mongodb-flex/v1.0/versions"
set: "validate.DefaultResponseErrorHandler(rsp)"
copy:
- from: include/service.go
Expand Down
2 changes: 1 addition & 1 deletion internal/config/mongodb-flex/v1.0/generate.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package gen

//go:generate go run dev.azure.com/schwarzit/schwarzit.odj.core/_git/stackit-client-generator.git/cmd/oapi-codegen@latest -config config.yaml mongodb.json
//go:generate go run github.com/do87/stackit-client-generator/cmd/oapi-codegen@v0.0.3 -config config.yaml mongodb.json
6 changes: 3 additions & 3 deletions internal/config/mongodb-flex/v1.0/include/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

var BaseURLs = env.URLs(
"mongodb_flex",
"https://api.stackit.cloud/mongodb/v1/",
"https://api-qa.stackit.cloud/mongodb/v1/",
"https://api-dev.stackit.cloud/mongodb/v1/",
"https://mongodb-flex-service.api.eu01.stackit.cloud/v1/",
"https://mongodb-flex-service.api.eu01.qa.stackit.cloud/v1/",
"https://mongodb-flex-service.api.eu01.dev.stackit.cloud/v1/",
)

func NewService(c contracts.BaseClientInterface) *mongodb.ClientWithResponses {
Expand Down
7 changes: 6 additions & 1 deletion internal/config/object-storage/v1.0.1/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ output-options:
type: error
description: "Aggregated error"
apply-to: ["*"]
imports: ["github.com/SchwarzIT/community-stackit-go-client/pkg/validate"]
imports:
- "github.com/SchwarzIT/community-stackit-go-client/pkg/validate"
- "github.com/SchwarzIT/community-stackit-go-client/pkg/services/object-storage/v1.0.1/project"
- "github.com/SchwarzIT/community-stackit-go-client/pkg/services/object-storage/v1.0.1/access-key"
- "github.com/SchwarzIT/community-stackit-go-client/pkg/services/object-storage/v1.0.1/bucket"
- "github.com/SchwarzIT/community-stackit-go-client/pkg/services/object-storage/v1.0.1/credentials-group"
set: "validate.DefaultResponseErrorHandler(rsp)"
copy:
- from: include/service.go
Expand Down
2 changes: 1 addition & 1 deletion internal/config/object-storage/v1.0.1/generate.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package gen

//go:generate go run dev.azure.com/schwarzit/schwarzit.odj.core/_git/stackit-client-generator.git/cmd/oapi-codegen@latest -config config.yaml objectstorage.json
//go:generate go run github.com/do87/stackit-client-generator/cmd/oapi-codegen@v0.0.2 -config config.yaml objectstorage.json
6 changes: 3 additions & 3 deletions internal/config/object-storage/v1.0.1/include/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

var BaseURLs = env.URLs(
"object_storage",
"https://api.stackit.cloud/object-storage-api/",
"https://api-qa.stackit.cloud/object-storage-api/",
"https://api-dev.stackit.cloud/object-storage-api/",
"https://object-storage-api.api.eu01.stackit.cloud",
"https://object-storage-api.api.eu01.qa.stackit.cloud",
"https://object-storage-api.api.eu01.dev.stackit.cloud",
)

func NewService(c contracts.BaseClientInterface) *objectstorage.ClientWithResponses {
Expand Down
2 changes: 1 addition & 1 deletion internal/config/resource-management/v2.0/generate.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package gen

//go:generate go run dev.azure.com/schwarzit/schwarzit.odj.core/_git/stackit-client-generator.git/cmd/oapi-codegen@latest -config config.yaml rm.json
//go:generate go run github.com/do87/stackit-client-generator/cmd/oapi-codegen@v0.0.3 -config config.yaml rm.json
6 changes: 3 additions & 3 deletions internal/config/resource-management/v2.0/include/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

var BaseURLs = env.URLs(
"resource_management",
"https://api.stackit.cloud/resource-management/v2/",
"https://api-qa.stackit.cloud/resource-management/v2/",
"https://api-dev.stackit.cloud/resource-management/v2/",
"https://resource-manager.api.stackit.cloud/v2/",
"https://resource-manager.api.qa.stackit.cloud/v2/",
"https://resource-manager.api.dev.stackit.cloud/v2/",
)

func NewService(c contracts.BaseClientInterface) *resourcemanagement.ClientWithResponses {
Expand Down
4 changes: 2 additions & 2 deletions pkg/services/argus/v1.0/acl/acl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/services/argus/v1.0/alert-config/alert-config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/services/argus/v1.0/alert-groups/alert-groups.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/services/argus/v1.0/alert-records/alert-records.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/services/argus/v1.0/alert-rules/alert-rules.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/services/argus/v1.0/argus.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/services/argus/v1.0/backup/backup.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/services/argus/v1.0/cert-check/cert-check.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/services/argus/v1.0/grafana-configs/grafana-configs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/services/argus/v1.0/http-check/http-check.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/services/argus/v1.0/instances/instances.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/services/argus/v1.0/logs/logs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/services/argus/v1.0/network-check/network-check.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c6c7265

Please sign in to comment.