(Slos)
- ListAll - Get All SLOs
- Create - Create SLO
- Update - Update SLO
- Remove - Remove SLO
- GetByID - Get SLO By ID
- MarkAffected - Mark SLO Affected
- MarkFalsePositive - Mark SLO False Positive
Returns all the SLOs of the passed owner_id in the params.
Requires access_token as a Bearer {{token}} in the Authorization header with read scope.
package main
import(
"context"
"os"
squadcastsdk "github.com/SquadcastHub/squadcast-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_BEARER_AUTH")),
)
res, err := s.Slos.ListAll(ctx, "<id>", "<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. |
ownerID |
string | ✔️ | N/A |
offset |
string | ✔️ | N/A |
limit |
string | ✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.SLOGetAllSLOsResponse, 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 | */* |
- This API will create SLO.
Requires
access_tokenas aBearer {{token}}in theAuthorizationheader withuser-writescope.
package main
import(
"context"
"os"
squadcastsdk "github.com/SquadcastHub/squadcast-sdk-go"
"github.com/SquadcastHub/squadcast-sdk-go/models/components"
"github.com/SquadcastHub/squadcast-sdk-go/types"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_BEARER_AUTH")),
)
res, err := s.Slos.Create(ctx, components.V3SLOCreateSLORequest{
Name: "<value>",
TimeIntervalType: components.V3SLOTimeIntervalTypeRolling,
ServiceIds: []string{
"<value 1>",
},
Slis: []string{},
TargetSlo: 6924.37,
StartTime: types.MustTimeFromString("2023-06-03T10:41:05.981Z"),
EndTime: types.MustTimeFromString("2023-11-20T07:09:22.422Z"),
DurationInDays: 574042,
OwnerType: "<value>",
OwnerID: "<id>",
SloOwnerID: "<id>",
SloOwnerType: components.V3SLOSLOOwnerTypeSquad,
})
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.V3SLOCreateSLORequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.SLOCreateSLOResponse, 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 | */* |
- This API will update SLO.
Requires
access_tokenas aBearer {{token}}in theAuthorizationheader withuser-writescope.
package main
import(
"context"
"os"
squadcastsdk "github.com/SquadcastHub/squadcast-sdk-go"
"github.com/SquadcastHub/squadcast-sdk-go/models/components"
"github.com/SquadcastHub/squadcast-sdk-go/types"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_BEARER_AUTH")),
)
res, err := s.Slos.Update(ctx, 16112, "<id>", components.V3SLOCreateSLORequest{
Name: "<value>",
TimeIntervalType: components.V3SLOTimeIntervalTypeRolling,
ServiceIds: []string{
"<value 1>",
"<value 2>",
"<value 3>",
},
Slis: []string{
"<value 1>",
},
TargetSlo: 2464.03,
StartTime: types.MustTimeFromString("2025-10-31T03:29:37.701Z"),
EndTime: types.MustTimeFromString("2024-03-30T19:04:36.297Z"),
DurationInDays: 271064,
OwnerType: "<value>",
OwnerID: "<id>",
SloOwnerID: "<id>",
SloOwnerType: components.V3SLOSLOOwnerTypeUser,
})
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. |
sloID |
int64 | ✔️ | N/A |
ownerID |
string | ✔️ | N/A |
v3SLOCreateSLORequest |
components.V3SLOCreateSLORequest | ✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.SLOUpdateSLOResponse, 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 | */* |
Remove SLO from passed owner_id (team_id) in the params . Upon sccess the slo will be removed.
Requires access_token as a Bearer {{token}} in the Authorization header with user-write scope.
package main
import(
"context"
"os"
squadcastsdk "github.com/SquadcastHub/squadcast-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_BEARER_AUTH")),
)
res, err := s.Slos.Remove(ctx, 938544, "<id>")
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. |
sloID |
int64 | ✔️ | N/A |
ownerID |
string | ✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.SLORemoveSLOResponse, 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 | */* |
Returns a SLO details of the given sloID in the request param.
Requires access_token as a Bearer {{token}} in the Authorization header with read scope.
package main
import(
"context"
"os"
squadcastsdk "github.com/SquadcastHub/squadcast-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_BEARER_AUTH")),
)
res, err := s.Slos.GetByID(ctx, 586718, "<id>")
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. |
sloID |
int64 | ✔️ | N/A |
ownerID |
string | ✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.SLOGetSLOByIDResponse, 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 | */* |
This endpoint is used for mark slo affected.
Requires access_token as a Bearer {{token}} in the Authorization header with user-write scope.
package main
import(
"context"
"os"
squadcastsdk "github.com/SquadcastHub/squadcast-sdk-go"
"github.com/SquadcastHub/squadcast-sdk-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_BEARER_AUTH")),
)
res, err := s.Slos.MarkAffected(ctx, 294670, "<id>", components.V3SLOMarkSLOAffectedRequest{
IncidentID: "<id>",
Slis: []string{
"<value 1>",
"<value 2>",
},
ErrorBudgetSpent: 3480.26,
OwnerType: "<value>",
OwnerID: "<id>",
OrgID: "<id>",
})
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. |
sloID |
int64 | ✔️ | N/A |
ownerID |
string | ✔️ | N/A |
v3SLOMarkSLOAffectedRequest |
components.V3SLOMarkSLOAffectedRequest | ✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.SLOMarkSLOAffectedResponse, 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 | */* |
Value is a boolean (true or false)
package main
import(
"context"
"os"
squadcastsdk "github.com/SquadcastHub/squadcast-sdk-go"
"github.com/SquadcastHub/squadcast-sdk-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_BEARER_AUTH")),
)
res, err := s.Slos.MarkFalsePositive(ctx, operations.SLOMarkSLOFalsePositiveRequest{
SloID: 825843,
IncidentID: 505067,
Value: true,
OwnerID: "<id>",
RequestBody: operations.SLOMarkSLOFalsePositiveRequestBody{},
})
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.SLOMarkSLOFalsePositiveRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.SLOMarkSLOFalsePositiveResponse, 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 | */* |