Documentation ¶
Index ¶
- Constants
- Variables
- func Fetch(client *Client, href string) ([]gjson.Result, 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 FetchRestPerfData(client *Client, href string, perfRecords *[]PerfRecord) error
- func GetPollerAndAddr(pName string) (*conf.Poller, string, error)
- func ReadOrDownloadSwagger(pName string) (string, error)
- type Args
- type Client
- type Cluster
- 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) IsIgnoreUnknownFieldsEnabled(isIgnoreUnknownFieldsEnabled bool) *HrefBuilder
- func (b *HrefBuilder) MaxRecords(maxRecords *int) *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" // DefaultDialerTimeout limits the time spent establishing a TCP connection DefaultDialerTimeout = 10 * time.Second Message = "message" Code = "code" Target = "target" )
Variables ¶
View Source
var Cmd = &cobra.Command{
Use: "rest",
Short: "ONTAP Rest Utility",
Long: "ONTAP Rest Utility - Explore available ONTAP REST APIs",
}
Functions ¶
func FetchAnalytics ¶
func FetchForCli ¶
func FetchForCli(client *Client, href string, records *[]any, downloadAll bool, curls *[]string) error
FetchForCli used for CLI only
func FetchRestPerfData ¶
func FetchRestPerfData(client *Client, href string, perfRecords *[]PerfRecord) error
FetchRestPerfData This method is used in PerfRest collector. This method returns timestamp per batch
func ReadOrDownloadSwagger ¶
Types ¶
type Client ¶
type Client struct { Logger *logging.Logger Timeout time.Duration Metadata *util.Metadata // contains filtered or unexported fields }
func (*Client) GetRest ¶
GetRest makes a REST request to the cluster and returns a json response as a []byte
func (*Client) UpdateClusterInfo ¶
type Cluster ¶
func (Cluster) GetVersion ¶
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) IsIgnoreUnknownFieldsEnabled ¶
func (b *HrefBuilder) IsIgnoreUnknownFieldsEnabled(isIgnoreUnknownFieldsEnabled bool) *HrefBuilder
func (*HrefBuilder) MaxRecords ¶
func (b *HrefBuilder) MaxRecords(maxRecords *int) *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.