Documentation ¶
Overview ¶
Package zapi provides type Client for connecting to a C-dot or 7-mode ONTAP cluster and sending API requests using the ZAPI protocol.
Package zapi Copyright NetApp Inc, 2021 All rights reserved
Index ¶
- Constants
- type Client
- func (c *Client) BuildRequest(request *node.Node) error
- func (c *Client) BuildRequestString(request string) error
- func (c *Client) ClusterUUID() string
- func (c *Client) Info() string
- func (c *Client) Init(retries int, remote conf.Remote) error
- func (c *Client) Invoke(testFilePath string) (*node.Node, error)
- func (c *Client) InvokeBatchRequest(request *node.Node, tag string, testFilePath string, ...) (Response, error)
- func (c *Client) InvokeBatchWithTimers(request *node.Node, tag string, headers ...map[string]string) (*node.Node, string, time.Duration, time.Duration, error)
- func (c *Client) InvokeRequest(request *node.Node) (*node.Node, error)
- func (c *Client) InvokeRequestString(request string) (*node.Node, error)
- func (c *Client) InvokeWithTimers(testFilePath string, headers ...map[string]string) (*node.Node, time.Duration, time.Duration, error)
- func (c *Client) InvokeZapiCall(request *node.Node) ([]*node.Node, error)
- func (c *Client) IsClustered() bool
- func (c *Client) Name() string
- func (c *Client) Release() string
- func (c *Client) Remote() conf.Remote
- func (c *Client) Serial() string
- func (c *Client) SetTimeout(timeout string)
- func (c *Client) TraceLogSet(collectorName string, config *node.Node)
- func (c *Client) Version() string
- type Response
Constants ¶
const ( DefaultAPIVersion = "1.3" DefaultTimeout = "30s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Logger *slog.Logger Metadata *util.Metadata // contains filtered or unexported fields }
func (*Client) BuildRequest ¶
BuildRequest builds an API request from the node query root element of the request is usually the API name (e.g. "volume-get-iter") and its children are the attributes requested
func (*Client) BuildRequestString ¶
BuildRequestString builds an API request from the request. request is usually the API name (e.g. "system-get-info") without any attributes
func (*Client) ClusterUUID ¶
ClusterUUID returns the cluster UUID of a c-mode system and system-id for 7-mode
func (*Client) Init ¶
Init connects to the cluster and retrieves system info it will give up after retries
func (*Client) Invoke ¶
Invoke is used for two purposes If testFilePath is non-empty -> Used only from unit test Else -> will issue the API request and return server response this method should only be called after building the request
func (*Client) InvokeBatchRequest ¶
func (c *Client) InvokeBatchRequest(request *node.Node, tag string, testFilePath string, headers ...map[string]string) (Response, error)
InvokeBatchRequest is used for two purposes If testFilePath is non-empty -> Used only from unit test Else -> will issue API requests in series, once there are no more instances returned by the server, returned results will be nil Use the returned tag for subsequent calls to this method
func (*Client) InvokeBatchWithTimers ¶
func (c *Client) InvokeBatchWithTimers(request *node.Node, tag string, headers ...map[string]string) (*node.Node, string, time.Duration, time.Duration, error)
InvokeBatchWithTimers does the same as InvokeBatchRequest, but it also returns API time and XML parse time
func (*Client) InvokeRequest ¶
InvokeRequest builds a request from request and invokes it
func (*Client) InvokeRequestString ¶
InvokeRequestString builds a request from request and invokes it
func (*Client) InvokeWithTimers ¶
func (c *Client) InvokeWithTimers(testFilePath string, headers ...map[string]string) (*node.Node, time.Duration, time.Duration, error)
InvokeWithTimers is used for two purposes If testFilePath is non-empty -> Used only from unit test Else -> invokes the request and returns parsed XML response and timers: API wait time and XML parse time. This method should only be called after building the request
func (*Client) InvokeZapiCall ¶
InvokeZapiCall will issue API requests with batching
func (*Client) IsClustered ¶
IsClustered returns true if ONTAP is clustered or false if it's a 7-mode system