Skip to content

Latest commit

 

History

History
111 lines (82 loc) · 5.1 KB

README.md

File metadata and controls

111 lines (82 loc) · 5.1 KB

Metadata

(Metadata)

Overview

Available Operations

ListEntityTypes

List all available entity types.

Example Usage

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
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
opts []operations.Option The options for this request.

Response

*operations.ListEntityTypesResponse, error

Errors

Error Type Status Code Content Type
apierrors.APIError 4XX, 5XX */*

ListMetricsForEntityType

List metrics metadata for an entity type between a start and end time. If start time and end time unspecified, default will be applied.

Example Usage

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
    }
}

Parameters

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.

Response

*operations.ListMetricsForEntityTypeResponse, error

Errors

Error Type Status Code Content Type
apierrors.APIError 4XX, 5XX */*