Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultiOperationError ¶
type MultiOperationError struct {
Operations []*OperationError
}
MultiOperationError is an error object for scrapli *multi* operations.
func (*MultiOperationError) Error ¶
func (e *MultiOperationError) Error() string
Error returns an error string for the MultiOperationError object.
type MultiResponse ¶
type MultiResponse struct { Host string StartTime time.Time EndTime time.Time ElapsedTime float64 Responses []*Response Failed error }
MultiResponse defines a response object for plural operations -- contains a slice of `Responses` for each operation.
func NewMultiResponse ¶
func NewMultiResponse(host string) *MultiResponse
NewMultiResponse creates a new MultiResponse object.
func (*MultiResponse) AppendResponse ¶
func (mr *MultiResponse) AppendResponse(r *Response)
AppendResponse appends a response to the `Responses` attribute of the MultiResponse object.
func (*MultiResponse) JoinedResult ¶
func (mr *MultiResponse) JoinedResult() string
JoinedResult is a convenience method to print out a single unified/joined result -- this is basically all the channel output for each individual response in the MultiResponse joined by newline characters.
type NetconfResponse ¶
type NetconfResponse struct { Host string Port int Input []byte FramedInput []byte RawResult []byte Result string StartTime time.Time EndTime time.Time ElapsedTime float64 FailedWhenContains [][]byte Failed error StripNamespaces bool NetconfVersion string ErrorMessages []string WarningErrorMessages []string SubscriptionID int }
NetconfResponse is a struct returned from all netconf driver operations.
func NewNetconfResponse ¶
func NewNetconfResponse( input, framedInput []byte, host string, port int, version string, ) *NetconfResponse
NewNetconfResponse prepares a new NetconfResponse object.
func (*NetconfResponse) Record ¶
func (r *NetconfResponse) Record(b []byte)
Record records the output of a NETCONF operation.
type OperationError ¶
OperationError is an error object returned when a scrapli operation completes "successfully" -- as in does not have an EOF/timeout or otherwise unrecoverable error -- but contains output in the device's response indicating that an input was bad/invalid or device failed to process it at that time.
func (*OperationError) Error ¶
func (e *OperationError) Error() string
Error returns an error string for the OperationError object.
type Response ¶
type Response struct { Host string Port int Input string RawResult []byte Result string StartTime time.Time EndTime time.Time ElapsedTime float64 FailedWhenContains []string // Failed returns an error if any of the `FailedWhenContains` substrings are seen in the output // returned from the device. This error indicates that the operation has completed successfully, // but that an input was bad/invalid or device failed to process it at that time Failed error }
Response is a struct returned from most (all?) generic and network driver "single" operations.
func NewResponse ¶
NewResponse prepares a new Response object.
func (*Response) TextFsmParse ¶
TextFsmParse parses recorded output w/ a provided textfsm template. the argument is interpreted as URL or filesystem path, for example: response.TextFsmParse("http://example.com/textfsm.template") or response.TextFsmParse("./local/textfsm.template").