(Metadata)
- ListEntityTypes - List all entity types
- ListMetricsForEntityType - List metrics metadata for an entity type
List all available entity types.
package main
import(
"os"
swosdkgo "github.com/solarwinds/swo-sdk-go"
"context"
"log"
)
func main() {
s := swosdkgo.New(
swosdkgo.WithSecurity(os.Getenv("SWO_API_TOKEN")),
)
ctx := context.Background()
res, err := s.Metadata.ListEntityTypes(ctx)
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. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ListEntityTypesResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.APIError | 4XX, 5XX | */* |
List metrics metadata for an entity type between a start and end time. If start time and end time unspecified, default will be applied.
package main
import(
"os"
swosdkgo "github.com/solarwinds/swo-sdk-go"
"github.com/solarwinds/swo-sdk-go/models/operations"
"context"
"log"
)
func main() {
s := swosdkgo.New(
swosdkgo.WithSecurity(os.Getenv("SWO_API_TOKEN")),
)
ctx := context.Background()
res, err := s.Metadata.ListMetricsForEntityType(ctx, operations.ListMetricsForEntityTypeRequest{
Type: "<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. |
request |
operations.ListMetricsForEntityTypeRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ListMetricsForEntityTypeResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.APIError | 4XX, 5XX | */* |