- List - List Global Event Rules
- Create - Create Global Event Rule
- DeleteRule - Delete Global Event Rule by ID
- GetByID - Get Global Event Rule by ID
- UpdateByID - Update Global Event Rule by ID
- GetRuleset - Get Ruleset
- UpdateRuleset - Update Ruleset
- UpdateRule - Update Rule by ID
Get a list of all GERs
package main
import(
"context"
"os"
squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
"github.com/solarwinds/squadcast-sdk-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
)
res, err := s.GlobalEventRules.List(ctx, operations.GlobalEventRulesListGlobalEventRulesRequest{
OwnerID: "<id>",
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GlobalEventRulesListGlobalEventRulesRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GlobalEventRulesListGlobalEventRulesResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.BadRequestError | 400 | application/json |
| apierrors.UnauthorizedError | 401 | application/json |
| apierrors.PaymentRequiredError | 402 | application/json |
| apierrors.ForbiddenError | 403 | application/json |
| apierrors.NotFoundError | 404 | application/json |
| apierrors.ConflictError | 409 | application/json |
| apierrors.UnprocessableEntityError | 422 | application/json |
| apierrors.InternalServerError | 500 | application/json |
| apierrors.BadGatewayError | 502 | application/json |
| apierrors.ServiceUnavailableError | 503 | application/json |
| apierrors.GatewayTimeoutError | 504 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |
Create a GER
package main
import(
"context"
"os"
squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
"github.com/solarwinds/squadcast-sdk-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
)
res, err := s.GlobalEventRules.Create(ctx, components.V3GlobalEventRulesCreateGlobalEventRuleRequest{
Name: "<value>",
Description: "majestically effector headline dampen eek middle like shrill",
OwnerID: "<id>",
EntityOwner: components.V3GlobalEventRulesEntityOwner{
ID: "<id>",
Type: components.V3GlobalEventRulesEntityOwnerTypeUser,
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.V3GlobalEventRulesCreateGlobalEventRuleRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GlobalEventRulesCreateGlobalEventRuleResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.BadRequestError | 400 | application/json |
| apierrors.UnauthorizedError | 401 | application/json |
| apierrors.PaymentRequiredError | 402 | application/json |
| apierrors.ForbiddenError | 403 | application/json |
| apierrors.NotFoundError | 404 | application/json |
| apierrors.ConflictError | 409 | application/json |
| apierrors.UnprocessableEntityError | 422 | application/json |
| apierrors.InternalServerError | 500 | application/json |
| apierrors.BadGatewayError | 502 | application/json |
| apierrors.ServiceUnavailableError | 503 | application/json |
| apierrors.GatewayTimeoutError | 504 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |
Delete a GER by its ID
package main
import(
"context"
"os"
squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
)
res, err := s.GlobalEventRules.DeleteRule(ctx, 491102)
if err != nil {
log.Fatal(err)
}
if res.Body != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
gerID |
int64 |
✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GlobalEventRulesDeleteGlobalEventRuleByIDResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.BadRequestError | 400 | application/json |
| apierrors.UnauthorizedError | 401 | application/json |
| apierrors.PaymentRequiredError | 402 | application/json |
| apierrors.ForbiddenError | 403 | application/json |
| apierrors.NotFoundError | 404 | application/json |
| apierrors.ConflictError | 409 | application/json |
| apierrors.UnprocessableEntityError | 422 | application/json |
| apierrors.InternalServerError | 500 | application/json |
| apierrors.BadGatewayError | 502 | application/json |
| apierrors.ServiceUnavailableError | 503 | application/json |
| apierrors.GatewayTimeoutError | 504 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |
Get a GER by its ID
package main
import(
"context"
"os"
squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
)
res, err := s.GlobalEventRules.GetByID(ctx, 292040)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
gerID |
int64 |
✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GlobalEventRulesGetGlobalEventRuleByIDResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.BadRequestError | 400 | application/json |
| apierrors.UnauthorizedError | 401 | application/json |
| apierrors.PaymentRequiredError | 402 | application/json |
| apierrors.ForbiddenError | 403 | application/json |
| apierrors.NotFoundError | 404 | application/json |
| apierrors.ConflictError | 409 | application/json |
| apierrors.UnprocessableEntityError | 422 | application/json |
| apierrors.InternalServerError | 500 | application/json |
| apierrors.BadGatewayError | 502 | application/json |
| apierrors.ServiceUnavailableError | 503 | application/json |
| apierrors.GatewayTimeoutError | 504 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |
Update a GER by its ID
package main
import(
"context"
"os"
squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
"github.com/solarwinds/squadcast-sdk-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
)
res, err := s.GlobalEventRules.UpdateByID(ctx, 885894, components.V3GlobalEventRulesUpdateGlobalEventRuleRequest{})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
gerID |
int64 |
✔️ | N/A |
v3GlobalEventRulesUpdateGlobalEventRuleRequest |
components.V3GlobalEventRulesUpdateGlobalEventRuleRequest | ✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GlobalEventRulesUpdateGlobalEventRuleByIDResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.BadRequestError | 400 | application/json |
| apierrors.UnauthorizedError | 401 | application/json |
| apierrors.PaymentRequiredError | 402 | application/json |
| apierrors.ForbiddenError | 403 | application/json |
| apierrors.NotFoundError | 404 | application/json |
| apierrors.ConflictError | 409 | application/json |
| apierrors.UnprocessableEntityError | 422 | application/json |
| apierrors.InternalServerError | 500 | application/json |
| apierrors.BadGatewayError | 502 | application/json |
| apierrors.ServiceUnavailableError | 503 | application/json |
| apierrors.GatewayTimeoutError | 504 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |
Get a GER Ruleset
package main
import(
"context"
"os"
squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
)
res, err := s.GlobalEventRules.GetRuleset(ctx, 294223, "<value>", "<value>")
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
gerID |
int64 |
✔️ | N/A |
alertSourceVersion |
string |
✔️ | N/A |
alertSourceShortname |
string |
✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GlobalEventRulesGetRulesetResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.BadRequestError | 400 | application/json |
| apierrors.UnauthorizedError | 401 | application/json |
| apierrors.PaymentRequiredError | 402 | application/json |
| apierrors.ForbiddenError | 403 | application/json |
| apierrors.NotFoundError | 404 | application/json |
| apierrors.ConflictError | 409 | application/json |
| apierrors.UnprocessableEntityError | 422 | application/json |
| apierrors.InternalServerError | 500 | application/json |
| apierrors.BadGatewayError | 502 | application/json |
| apierrors.ServiceUnavailableError | 503 | application/json |
| apierrors.GatewayTimeoutError | 504 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |
Update a GER Ruleset
package main
import(
"context"
"os"
squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
"github.com/solarwinds/squadcast-sdk-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
)
res, err := s.GlobalEventRules.UpdateRuleset(ctx, 489958, "<value>", "<value>", components.V3GlobalEventRulesUpdateRulesetRequest{})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
gerID |
int64 |
✔️ | N/A |
alertSourceVersion |
string |
✔️ | N/A |
alertSourceShortname |
string |
✔️ | N/A |
v3GlobalEventRulesUpdateRulesetRequest |
components.V3GlobalEventRulesUpdateRulesetRequest | ✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GlobalEventRulesUpdateRulesetResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.BadRequestError | 400 | application/json |
| apierrors.UnauthorizedError | 401 | application/json |
| apierrors.PaymentRequiredError | 402 | application/json |
| apierrors.ForbiddenError | 403 | application/json |
| apierrors.NotFoundError | 404 | application/json |
| apierrors.ConflictError | 409 | application/json |
| apierrors.UnprocessableEntityError | 422 | application/json |
| apierrors.InternalServerError | 500 | application/json |
| apierrors.BadGatewayError | 502 | application/json |
| apierrors.ServiceUnavailableError | 503 | application/json |
| apierrors.GatewayTimeoutError | 504 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |
Update a GER Ruleset Rule by its ID.
package main
import(
"context"
"os"
squadcastsdk "github.com/solarwinds/squadcast-sdk-go"
"github.com/solarwinds/squadcast-sdk-go/models/components"
"github.com/solarwinds/squadcast-sdk-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_REFRESH_TOKEN_AUTH")),
)
res, err := s.GlobalEventRules.UpdateRule(ctx, operations.GlobalEventRulesUpdateRuleByIDRequest{
GerID: 140241,
AlertSourceVersion: "<value>",
AlertSourceShortname: "<value>",
RuleID: "<id>",
V3GlobalEventRulesUpdateRuleRequest: components.V3GlobalEventRulesUpdateRuleRequest{},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GlobalEventRulesUpdateRuleByIDRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GlobalEventRulesUpdateRuleByIDResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.BadRequestError | 400 | application/json |
| apierrors.UnauthorizedError | 401 | application/json |
| apierrors.PaymentRequiredError | 402 | application/json |
| apierrors.ForbiddenError | 403 | application/json |
| apierrors.NotFoundError | 404 | application/json |
| apierrors.ConflictError | 409 | application/json |
| apierrors.UnprocessableEntityError | 422 | application/json |
| apierrors.InternalServerError | 500 | application/json |
| apierrors.BadGatewayError | 502 | application/json |
| apierrors.ServiceUnavailableError | 503 | application/json |
| apierrors.GatewayTimeoutError | 504 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |