Documentation ¶
Index ¶
- Constants
- Variables
- func FetchAll(client *Client, href string, headers ...map[string]string) ([]gjson.Result, error)
- func FetchAllStream(client *Client, href string, processBatch func([]gjson.Result) error, ...) error
- func FetchAnalytics(client *Client, href string) ([]gjson.Result, gjson.Result, error)
- func FetchForCli(client *Client, href string, records *[]any, downloadAll bool, curls *[]string) error
- func FetchRestPerfDataStream(client *Client, href string, processBatch func([]PerfRecord) error, ...) error
- func FetchSome(client *Client, href string, recordsWanted int, batchSize string) ([]gjson.Result, error)
- func GetPollerAndAddr(pName string) (*conf.Poller, string, error)
- func ReadOrDownloadSwagger(pName string) (string, error)
- type Args
- type Client
- func (c *Client) GetPlainRest(request string, encodeURL bool, headers ...map[string]string) ([]byte, error)
- func (c *Client) GetRest(request string, headers ...map[string]string) ([]byte, error)
- func (c *Client) Init(retries int, remote conf.Remote) error
- func (c *Client) Remote() conf.Remote
- func (c *Client) TraceLogSet(collectorName string, config *node.Node)
- func (c *Client) UpdateClusterInfo(retries int) error
- type HrefBuilder
- func (b *HrefBuilder) APIPath(apiPath string) *HrefBuilder
- func (b *HrefBuilder) Build() string
- func (b *HrefBuilder) CounterSchema(counterSchema []string) *HrefBuilder
- func (b *HrefBuilder) Fields(fields []string) *HrefBuilder
- func (b *HrefBuilder) Filter(filter []string) *HrefBuilder
- func (b *HrefBuilder) HiddenFields(hiddenFields []string) *HrefBuilder
- func (b *HrefBuilder) IsIgnoreUnknownFieldsEnabled(isIgnoreUnknownFieldsEnabled bool) *HrefBuilder
- func (b *HrefBuilder) MaxRecords(maxRecords string) *HrefBuilder
- func (b *HrefBuilder) QueryFields(queryFields string) *HrefBuilder
- func (b *HrefBuilder) QueryValue(queryValue string) *HrefBuilder
- func (b *HrefBuilder) ReturnTimeout(returnTimeout *int) *HrefBuilder
- type Pagination
- type PerfRecord
- type Results
Constants ¶
View Source
const ( // DefaultTimeout should be > than ONTAP's default REST timeout, which is 15 seconds for GET requests DefaultTimeout = "30s" Message = "message" Code = "code" Target = "target" )
View Source
const URLMaxLimit = 8 * 1024
Variables ¶
View Source
var Cmd = &cobra.Command{
Use: "rest",
Short: "ONTAP Rest Utility",
Long: "ONTAP Rest Utility - Explore available ONTAP REST APIs",
}
Functions ¶
func FetchAll ¶
FetchAll collects all records. If you want to limit the number of records returned, use FetchSome.
func FetchAllStream ¶
func FetchAnalytics ¶
func FetchForCli ¶
func FetchForCli(client *Client, href string, records *[]any, downloadAll bool, curls *[]string) error
FetchForCli used for CLI only
func FetchRestPerfDataStream ¶
func FetchSome ¶
func FetchSome(client *Client, href string, recordsWanted int, batchSize string) ([]gjson.Result, error)
FetchSome collects at most recordsWanted records, following pagination links as needed. Use batchSize to limit the number of records returned in a single response. If recordsWanted is -1, all records are collected.
func ReadOrDownloadSwagger ¶
Types ¶
type Client ¶
type Client struct { Logger *slog.Logger Timeout time.Duration Metadata *util.Metadata // contains filtered or unexported fields }
func (*Client) GetPlainRest ¶
func (c *Client) GetPlainRest(request string, encodeURL bool, headers ...map[string]string) ([]byte, error)
GetPlainRest makes a REST request to the cluster and returns a json response as a []byte
func (*Client) GetRest ¶
GetRest makes a REST request to the cluster and returns a json response as a []byte
func (*Client) UpdateClusterInfo ¶
type HrefBuilder ¶
type HrefBuilder struct {
// contains filtered or unexported fields
}
func NewHrefBuilder ¶
func NewHrefBuilder() *HrefBuilder
func (*HrefBuilder) APIPath ¶
func (b *HrefBuilder) APIPath(apiPath string) *HrefBuilder
func (*HrefBuilder) Build ¶
func (b *HrefBuilder) Build() string
func (*HrefBuilder) CounterSchema ¶
func (b *HrefBuilder) CounterSchema(counterSchema []string) *HrefBuilder
func (*HrefBuilder) Fields ¶
func (b *HrefBuilder) Fields(fields []string) *HrefBuilder
func (*HrefBuilder) Filter ¶
func (b *HrefBuilder) Filter(filter []string) *HrefBuilder
func (*HrefBuilder) HiddenFields ¶
func (b *HrefBuilder) HiddenFields(hiddenFields []string) *HrefBuilder
func (*HrefBuilder) IsIgnoreUnknownFieldsEnabled ¶
func (b *HrefBuilder) IsIgnoreUnknownFieldsEnabled(isIgnoreUnknownFieldsEnabled bool) *HrefBuilder
func (*HrefBuilder) MaxRecords ¶
func (b *HrefBuilder) MaxRecords(maxRecords string) *HrefBuilder
func (*HrefBuilder) QueryFields ¶
func (b *HrefBuilder) QueryFields(queryFields string) *HrefBuilder
func (*HrefBuilder) QueryValue ¶
func (b *HrefBuilder) QueryValue(queryValue string) *HrefBuilder
func (*HrefBuilder) ReturnTimeout ¶
func (b *HrefBuilder) ReturnTimeout(returnTimeout *int) *HrefBuilder
type Pagination ¶
type PerfRecord ¶
type Results ¶
type Results struct { Poller string `json:"poller,omitempty"` Addr string `json:"addr,omitempty"` API string `json:"api,omitempty"` Version string `json:"version,omitempty"` ClusterName string `json:"cluster_name,omitempty"` Records []any `json:"records"` NumRecords int `json:"num_records"` PollDurationMs int64 `json:"poll_ms"` }
Click to show internal directories.
Click to hide internal directories.