Documentation ¶
Overview ¶
Package ixweb provides a connection to the Ixia Web Platform.
Index ¶
- Constants
- type Chassis
- type Config
- type Error
- type Files
- func (f *Files) Delete(ctx context.Context, filename string) error
- func (f *Files) Download(ctx context.Context, filename string) ([]byte, error)
- func (f *Files) List(ctx context.Context, pattern string) ([]string, error)
- func (f *Files) Upload(ctx context.Context, filename string, content []byte) error
- type HTTPClient
- type IxNetwork
- func (n *IxNetwork) DeleteSession(ctx context.Context, id int) error
- func (n *IxNetwork) FetchSession(ctx context.Context, id int) (*Session, error)
- func (n *IxNetwork) FetchSessions(ctx context.Context) (map[int]*Session, error)
- func (n *IxNetwork) NewSession(ctx context.Context, name string) (*Session, error)
- type IxWeb
- type OpArgs
- type Option
- type Session
- func (s *Session) AbsPath(relPath string) string
- func (s *Session) Config() *Config
- func (s *Session) Delete(ctx context.Context, path string) error
- func (s *Session) Errors(ctx context.Context) ([]*Error, error)
- func (s *Session) Files() *Files
- func (s *Session) Get(ctx context.Context, path string, out any) error
- func (s *Session) ID() int
- func (s *Session) Name() string
- func (s *Session) Patch(ctx context.Context, path string, in any) error
- func (s *Session) Post(ctx context.Context, path string, in, out any) error
- func (s *Session) Stats() *Stats
- func (s *Session) String() string
- type StatRow
- type StatTable
- type StatView
- type Stats
Constants ¶
const ( // EgressStatsCaption is the name of the egress statistics view. EgressStatsCaption = "EgressStatView" // TrafficItemStatsCaption is the name of the trafic item statics view. TrafficItemStatsCaption = "Traffic Item Statistics" )
const ( // RetryLimit is the maximum number of times an HTTP request will be retried. RetryLimit = 4 // RetryDelay is the time to wait between retrying HTTP requests. RetryDelay = 15 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chassis ¶
type Chassis struct {
// contains filtered or unexported fields
}
Chassis represents the chassis management application on Ixia Web Platform.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config represents the IxNetwork config API.
func (*Config) Import ¶
Import imports the specified config into the IxNetwork session. If overwrite is 'true', the existing config is completely replaced with the specified config; otherwise the config is updated at or below the node represented by the specified config. For values that are a list of nodes, only the nodes that are specified are updated. (E.g. you cannot remove a config node from a list with overwrite set to 'false'.)
type Error ¶
type Error struct { ID int `json:"id"` Level string `json:"errorLevel"` Code int `json:"errorCode"` Description string `json:"description"` Name string `json:"name"` LastModified string `json:"lastModified"` Provider string `json:"provider"` InstanceColumnNames []string `json:"sourceColumnsDisplayName"` InstanceRowValues []map[string]string }
Error represents an error reported by an IxNetwork session.
type Files ¶
type Files struct {
// contains filtered or unexported fields
}
Files represents the IxNetwork files API.
func (*Files) Download ¶
DownloadFile downloads a file with the specified name and returns the content.
type HTTPClient ¶
HTTPClient makes HTTP requests.
type IxNetwork ¶
type IxNetwork struct {
// contains filtered or unexported fields
}
IxNetwork represents the IxNetwork application on Ixia Web Platform.
func (*IxNetwork) DeleteSession ¶
DeleteSession deletes the IxNetwork session with the specified ID. This is a noop if the session is already deleted.
func (*IxNetwork) FetchSession ¶
FetchSession fetches the IxNetwork session with the specified ID.
func (*IxNetwork) FetchSessions ¶
FetchSessions fetches all current IxNetwork sessions.
type IxWeb ¶
type IxWeb struct {
// contains filtered or unexported fields
}
IxWeb is a connection to the Ixia Web Platform.
func Connect ¶
Connect creates a connection to Ixia Web Platform on the specified hostname. Unless the given options specify otherwise, IxWeb is configured as follows:
- login: Ixia's default admin/admin login
- http client: http.DefaultClient
type OpArgs ¶
type OpArgs []any
OpArgs is a list of arguments for an operation to use as input to a POST request.
func (OpArgs) MarshalJSON ¶
MarshalJSON marshals the operation arguments to JSON.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option for connecting to IxNetwork.
func WithHTTPClient ¶
func WithHTTPClient(client HTTPClient) Option
WithHTTPClient configures IxWeb to use a custom HTTP client.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents an IxNetwork session.
func (*Session) AbsPath ¶
AbsPath returns an absolute path, given a path relative to the IxNetwork session. If relPath is already an absolute path, this method returns the input string.
func (*Session) Delete ¶
Delete submits a JSON DELETE request, at a path relative to the IxNetwork session.
func (*Session) Patch ¶
Patch submits a JSON PATCH request, at a path relative to the IxNetwork session.
func (*Session) Post ¶
Post submits a JSON POST request, at a path relative to the IxNetwork session.
type StatRow ¶
StatRow is an individual row of statistics in an IxNetwork statistics view. The key of the map is the column name and the value is the statistic value. IxNetwork always provides the value of statistics as strings.
type StatTable ¶
type StatTable []StatRow
StatTable is a list of StatRows in an IxNetwork statistics view.
type StatView ¶
type StatView struct {
// contains filtered or unexported fields
}
StatView is an IxNetwork statistics view.
func (*StatView) FetchTable ¶
FetchTable fetches a table of statistic values from the view. If drilldowns are specified, the results of each drilldown on each row of the target table are also returned.
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
Stats represents the statistics API for an IxNetwork session.
func (*Stats) ConfigEgressView ¶
func (s *Stats) ConfigEgressView(ctx context.Context, trafficItems []string, egressPageSize int) (*StatView, error)
ConfigEgressView will create a statistics views for the specified traffic item names, broken down by their egress-tracked values. If an egress stat view already exists, it will be deleted first before the new one is created. The egressPageSize is the number of unique values that will be tracked.