wls

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MonitorPath is the REST resource path from the root / that points to where the RESTful Management API endpoint is located.  As of WLS 12.1.2,
	// this is assumed to be /management/tenant-monitoring
	MonitorPath string = "/management/tenant-monitoring"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminServer

type AdminServer struct {
	AdminURL string
	Username string
	Password string
}

AdminServer contains the configurable details necessary to request resources from a particular AdminServer. ServerUrl format should be similar to the following: "http(s)://[serverhost]:[adminport]"

func (*AdminServer) Application

func (a *AdminServer) Application(app string) (*Application, error)

Application returns the run-time information of a specified application, including statistics for entity beans, application-scoped work managers, and data sources. on how to get all of the []Application's on the server. This will always return a full format, including all of the details in the underlying struct types. It may also return an error if there were any issues calling out to the AdminServer

func (*AdminServer) Applications

func (a *AdminServer) Applications(isFullFormat bool) ([]Application, error)

Applications returns all applications deployed in the domain and their run-time information, including the application type and their state and health.

  • isfullFormat specifies whether to request the FULL format for an Application. Much more data is brought back for each of the subytpes within an Application. By default, this is false.

This function returns a listing of []Application's on the specified AdminServer, or an error denoting any issues making the callout.

func (*AdminServer) Cluster

func (a *AdminServer) Cluster(clusterName string) (*Cluster, error)

Cluster returns run-time information for the specified cluster and its member servers, including the member servers' state and health.

func (*AdminServer) Clusters

func (a *AdminServer) Clusters(fullFormat bool) ([]Cluster, error)

Clusters returns all clusters configured in a domain and provides run-time information for each cluster and for each cluster's member servers, including all the member servers' state and health.

func (*AdminServer) DataSource

func (a *AdminServer) DataSource(dataSourceName string) (*DataSource, error)

DataSource returns run-time information for the specified data source, including Oracle RAC statistics for GridLink data sources.

func (*AdminServer) DataSources

func (a *AdminServer) DataSources(isFullFormat bool) ([]DataSource, error)

DataSources returns all generic and GridLink JDBC data sources configured in the domain, and provides run-time information for each data source.

func (AdminServer) EncodeConfigFile

func (a AdminServer) EncodeConfigFile() *bytes.Buffer

EncodeConfigFile will take an AdminServer instance and convert it to a TOML-formatted byte buffer. This TOML byte buffer can then be serialized to disk as a configuration file.

func (*AdminServer) Server

func (a *AdminServer) Server(serverName string) (*Server, error)

Server returns information for a specified server in a domain, including the server state, health, and JVM heap availability.

func (*AdminServer) Servers

func (a *AdminServer) Servers(isFullFormat bool) ([]Server, error)

Servers returns all servers configured in a domain and provides run-time information for each server, including the server state and health. isFullFormat determines whether to return a fully-filled out list of Servers, or only a shortened version of the Servers list.

type AppDataSource

type AppDataSource struct {
	Name   string
	Server string
	State  string
}

AppDataSource displays information about an Application's referenced DataSources. See the DataSources resource for more information on what you can gather from a WebLogic DataSource

type Application

type Application struct {
	Name                  string
	AppType               string `json:"type"`
	State                 string
	Health                string
	TargetStates          []TargetState          `json:"targetStates,omitempty"`
	DataSources           []AppDataSource        `json:"dataSources,omitempty"`
	WorkManagers          []WorkManager          `json:"workManagers,omitempty"`
	MinThreadsConstraints []MinThreadsConstraint `json:"minThreadsConstraints,omitempty"`
	MaxThreadsConstraints []MaxThreadsConstraint `json:"maxThreadsConstraints,omitempty"`
	RequestClasses        []RequestClass         `json:"requestClasses,omitempty"`
}

Application is the root structure for a response from an AdminServer. An Application instance on an AdminServer will provide details about an application, including it's Health, running State, the Type of Application (war, ear, jar, etc.), as well as some more detailed pieces of information, including the Targets it was deployed to, any associated WorkManagers, and other pertinent deployed details.

func (*Application) GoString

func (a *Application) GoString() string

GoString generates a formatted string representation of an Application instance. This can be used in the following way:

a := &Application{...}
fmt.Sprintf("%#v", a)

In printing a string-formatted representation of the Application, only fields and sections where there are actual values will be displayed. As such, you may find sections missing, such as a MinThreadsConstraint or RequestClass should there not be one defined for that particular Application.

type Cluster

type Cluster struct {
	Name    string
	Servers []struct {
		Name                   string
		State                  string
		Health                 string
		IsClusterMaster        bool   `json:"clusterMaster,omitempty"`
		DropOutFrequency       string `json:",omitempty"`
		ResendRequestsCount    int    `json:",omitempty"`
		FragmentsSentCount     int    `json:",omitempty"`
		FragmentsReceivedCount int    `json:",omitempty"`
	} `json:"servers,omitempty"`
}

Cluster is the underlying struct for a single Cluster in a domain. Each domain may have multiple Cluster instances, each having their own ClusterMaster, deployed state, etc.

func (*Cluster) GoString

func (c *Cluster) GoString() string

GoString creates a GoString of the Cluster type for use in command-line applications.

type DataSource

type DataSource struct {
	Name      string
	Type      string
	Instances []DataSourceInstance `json:"instances,omitempty"`
}

DataSource is a specific Data Source in a domain, including all deployed DataSourceInstance's.

func (*DataSource) GoString added in v0.2.2

func (d *DataSource) GoString() string

GoString produces a GoString of a DataSource that will be more pleasant to the eyes for a command-line interface.

type DataSourceInstance

type DataSourceInstance struct {
	Server                             string
	State                              string
	Enabled                            bool
	VersionJDBCDriver                  string        `json:",omitempty"`
	ActiveConnectionsAverageCount      int           `json:",omitempty"`
	ActiveConnectionsCurrentCount      int           `json:",omitempty"`
	ActiveConnectionsHighCount         int           `json:",omitempty"`
	ConnectionDelayTime                int           `json:",omitempty"`
	ConnectionsTotalCount              int           `json:",omitempty"`
	CurrCapacity                       int           `json:",omitempty"`
	CurrCapacityHighCount              int           `json:",omitempty"`
	FailedReserveRequestCount          int           `json:",omitempty"`
	FailuresToReconnectCount           int           `json:",omitempty"`
	HighestNumAvailable                int           `json:",omitempty"`
	LeakedConnectionCount              int           `json:",omitempty"`
	NumAvailable                       int           `json:",omitempty"`
	NumUnavailable                     int           `json:",omitempty"`
	PrepStmtCacheAccessCount           int           `json:",omitempty"`
	PrepStmtCacheAddCount              int           `json:",omitempty"`
	PrepStmtCacheCurrentSize           int           `json:",omitempty"`
	PrepStmtCacheDeleteCount           int           `json:",omitempty"`
	PrepStmtCacheHitCount              int           `json:",omitempty"`
	PrepStmtCacheMissCount             int           `json:",omitempty"`
	ReserveRequestCount                int           `json:",omitempty"`
	WaitSecondsHighCount               int           `json:",omitempty"`
	WaitingForConnectionCurrentCount   int           `json:",omitempty"`
	WaitingForConnectionFailureTotal   int           `json:",omitempty"`
	WaitingForConnectionHighCount      int           `json:",omitempty"`
	WaitingForConnectionSuccessTotal   int           `json:",omitempty"`
	WaitingForConnectionTotal          int           `json:",omitempty"`
	SuccessfulRCLBBasedBorrowCount     int           `json:",omitempty"`
	FailedRCLBBasedBorrowCount         int           `json:",omitempty"`
	SuccessfulAffinityBasedBorrowCount int           `json:",omitempty"`
	FailedAffinityBasedBorrowCount     int           `json:",omitempty"`
	RacInstances                       []RacInstance `json:",omitempty"`
}

DataSourceInstance provides run-time information for a data source instance

type MaxThreadsConstraint

type MaxThreadsConstraint struct {
	Name              string
	Server            string
	ExecutingRequests int
	DeferredRequests  int
}

MaxThreadsConstraint provides statistics for maximum thread constraints that are configured for an application.

type MinThreadsConstraint

type MinThreadsConstraint struct {
	Name                     string
	Server                   string
	PendingRequests          int
	CompletedRequests        int
	ExecutingRequests        int
	OutOfOrderExecutionCount int
	MustRunCount             int
	MaxWaitTime              int
	CurrentWaitTime          int
}

MinThreadsConstraint provides statistics for the minimum thread constraints that are configured for an application.

type RacInstance

type RacInstance struct {
	InstanceName                  string `json:",omitempty"`
	State                         string `json:",omitempty"`
	Enabled                       bool   `json:",omitempty"`
	Signature                     string `json:",omitempty"`
	CurrentWeight                 int    `json:",omitempty"`
	ActiveConnectionsCurrentCount int    `json:",omitempty"`
	ReserveRequestCount           int    `json:",omitempty"`
	ConnectionsTotalCount         int    `json:",omitempty"`
	CurrCapacity                  int    `json:",omitempty"`
	NumAvailable                  int    `json:",omitempty"`
	NumUnavailable                int    `json:",omitempty"`
}

RacInstance provide Oracle RAC instance statistics

type RequestClass

type RequestClass struct {
	Name                 string
	Server               string
	RequestClassType     string
	CompletedCount       int
	TotalThreadUse       int
	PendingRequestCount  int
	VirtualTimeIncrement int
}

RequestClass provides statistics for the request classes that are configured for an application.

type Server

type Server struct {
	Name                    string  `json:"name"`
	State                   string  `json:"state"`
	Health                  string  `json:"health"`
	ClusterName             string  `json:"clusterName,omitempty"`
	CurrentMachine          string  `json:",omitempty"`
	WebLogicVersion         string  `json:",omitempty"`
	OpenSocketsCurrentCount float64 `json:",omitempty"`
	HeapSizeCurrent         int     `json:",omitempty"`
	HeapFreeCurrent         int     `json:",omitempty"`
	JavaVersion             string  `json:",omitempty"`
	OsName                  string  `json:",omitempty"`
	OsVersion               string  `json:",omitempty"`
	JvmProcessorLoad        float64 `json:",omitempty"`
}

Server is a specific Server instance deployed to the domain under the given AdminServer

func (*Server) GoString

func (s *Server) GoString() string

GoString produces a GoString formatted for the console and a CLI interface.

func (*Server) NewWidget added in v0.2.2

func (s *Server) NewWidget() ui.Bufferer

NewWidget will create a termui widget

type TargetState

type TargetState struct {
	Target string
	State  string
}

TargetState is the state of a Target. In WebLogic, this could be Running, Prepared

type WorkManager

type WorkManager struct {
	Name              string
	Server            string
	PendingRequests   int
	CompletedRequests int
}

WorkManager is the struct type explaining an Application's statistics for the Work Managers that are configured for an application.

type Wrapper

type Wrapper struct {
	Body struct {
		Items json.RawMessage `json:"items,omitempty"`
		Item  json.RawMessage `json:"item,omitempty"`
	} `json:"body"`
	Messages []string `json:"messages,omitempty"`
}

Wrapper handles all responses sent back from a WLS Rest endpoint. These responses are wrapped by a similar body and item or items tag. We simply wrap that so we can get to the meat of it in the underlying Server type

Wrapper is composed of 3 pieces: - Body contains

  • the result of the resource request, included as either a specific Item (Datasource, Server, Cluster, or Application, or
  • an array of []Item's of the same.

- Messages contains any error-related messages related to the query.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL