Skip to content

Commit f2f227b

Browse files
authored
remove argus service // add observability example (#774)
1 parent 950e08a commit f2f227b

File tree

96 files changed

+52
-11172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+52
-11172
lines changed

examples/argus/argus.go

Lines changed: 0 additions & 48 deletions
This file was deleted.

examples/argus/go.sum

Lines changed: 0 additions & 9 deletions
This file was deleted.

examples/argus/go.mod renamed to examples/observability/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
require (
66
github.com/stackitcloud/stackit-sdk-go/core v0.12.0
7-
github.com/stackitcloud/stackit-sdk-go/services/argus v0.11.0
7+
github.com/stackitcloud/stackit-sdk-go/services/observability v0.1.0
88
)
99

1010
require (
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
22
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
33
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
4-
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
54
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
65
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
76
github.com/stackitcloud/stackit-sdk-go/core v0.12.0 h1:auIzUUNRuydKOScvpICP4MifGgvOajiDQd+ncGmBL0U=
87
github.com/stackitcloud/stackit-sdk-go/core v0.12.0/go.mod h1:mDX1mSTsB3mP+tNBGcFNx6gH1mGBN4T+dVt+lcw7nlw=
8+
github.com/stackitcloud/stackit-sdk-go/services/observability v0.1.0 h1:VdxYMJqGKUvk7/l2b83Z/bB0FUYuFbELK/ipTicJ5QY=
9+
github.com/stackitcloud/stackit-sdk-go/services/observability v0.1.0/go.mod h1:cSnBZGdtx4jnn9HEefkQHDrm8+PuS0NCWvukVfuwP/8=
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package main
2+
3+
import (
4+
"context"
5+
"fmt"
6+
"os"
7+
8+
"github.com/stackitcloud/stackit-sdk-go/core/config"
9+
"github.com/stackitcloud/stackit-sdk-go/core/utils"
10+
"github.com/stackitcloud/stackit-sdk-go/services/observability"
11+
)
12+
13+
func main() {
14+
// Specify the project ID
15+
projectId := "PROJECT_ID"
16+
17+
// Create a new API client, that uses default authentication and configuration
18+
observabilityClient, err := observability.NewAPIClient(
19+
config.WithRegion("eu01"),
20+
)
21+
if err != nil {
22+
fmt.Fprintf(os.Stderr, "[Observability API] Creating API client: %v\n", err)
23+
os.Exit(1)
24+
}
25+
26+
// Get the observability instances for your project
27+
getInstanceResp, err := observabilityClient.ListInstances(context.Background(), projectId).Execute()
28+
29+
if err != nil {
30+
fmt.Fprintf(os.Stderr, "[Observability API] Error when calling `GetInstances`: %v\n", err)
31+
} else {
32+
fmt.Printf("[Observability API] Number of instances: %v\n", len(*getInstanceResp.Instances))
33+
}
34+
35+
// Create an observability instance
36+
createInstancePayload := observability.CreateInstancePayload{
37+
Name: utils.Ptr("myInstance"),
38+
PlanId: utils.Ptr("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"),
39+
}
40+
41+
createInstanceResp, err := observabilityClient.CreateInstance(context.Background(), projectId).CreateInstancePayload(createInstancePayload).Execute()
42+
if err != nil {
43+
fmt.Fprintf(os.Stderr, "[Observability API] Error when calling `CreateInstance`: %v\n", err)
44+
os.Exit(1)
45+
}
46+
47+
fmt.Printf("[Observability API] Created instance with id \"%s\" and dashboard url \"%s\".\n", *createInstanceResp.InstanceId, *createInstanceResp.DashboardUrl)
48+
}

go.work

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ go 1.18
22

33
use (
44
./core
5-
./examples/argus
65
./examples/authentication
76
./examples/authorization
87
./examples/backgroundrefresh
@@ -16,6 +15,7 @@ use (
1615
./examples/middleware
1716
./examples/mongodbflex
1817
./examples/objectstorage
18+
./examples/observability
1919
./examples/opensearch
2020
./examples/postgresflex
2121
./examples/rabbitmq
@@ -30,7 +30,6 @@ use (
3030
./examples/waiter
3131
./scripts
3232
./services/archiving
33-
./services/argus
3433
./services/authorization
3534
./services/dns
3635
./services/iaas

services/argus/.openapi-generator/VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

services/argus/CHANGELOG.md

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)