connection

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KillSessions

func KillSessions(client *golangsdk.ServiceClient, opts KillSessionsOpts) error

Types

type Connections

type Connections struct {
	// Indicates the IP address of the client connected to the instance or node.
	ClientIp string `json:"client_ip"`
	// Indicates the number of connections corresponding to the IP address.
	Count int `json:"count"`
}

type KillSessionsOpts

type KillSessionsOpts struct {
	// Specifies the node ID. The following nodes can be queried: mongos nodes in the cluster, and all nodes in the replica set and single node instances.
	NodeId string `json:"-"`
	// Specifies the IDs of sessions to be terminated.
	Sessions []string `json:"sessions" required:"true"`
}

type ListConnectionsOpts

type ListConnectionsOpts struct {
	// Specifies the DB instance ID.
	InstanceId string `json:"-"`
	// Specifies the node ID.
	// If this parameter is left blank, the number of connections of all nodes that can be connected in the instance is queried.
	NodeId string `q:"node_id"`
}

type ListConnectionsResponse

type ListConnectionsResponse struct {
	// Indicates the total number of connections, including internal and external connections.
	TotalConnections int `json:"total_connections"`
	// Indicates the total number of internal connections.
	TotalInnerConnections int `json:"total_inner_connections"`
	// Indicates the total number of external connections.
	TotalOuterConnections int `json:"total_outer_connections"`
	// Indicates the internal connection statistics array. Up to 200 records are supported.
	InnerConnections []Connections `json:"inner_connections"`
	// Indicates the external connection statistics array. Up to 200 records are supported.
	OuterConnections []Connections `json:"outer_connections"`
}

type ListSessionOpts

type ListSessionOpts struct {
	// Specifies the node ID. The following nodes can be queried: mongos nodes in the cluster, and all nodes in the replica set and single node instances.
	NodeId string `json:"-"`
	// Specifies the index position. If offset is set to N, the resource query starts from the N+1 piece of data. The value is 0 by default, indicating that the query starts from the first piece of data. The value cannot be a negative number.
	Offset int `q:"offset"`
	// Specifies the number of records to be queried. The value range is [1, 20]. The default value is 10, indicating that 10 records are returned.
	Limit int `q:"limit"`
	// Specifies the execution plan description. If this parameter is left empty, sessions in which plan_summary is empty are queried. You can also specify an execution plan, for example, COLLSCAN IXSCAN FETCH SORT LIMIT SKIP COUNT COUNT_SCAN TEXT PROJECTION
	PlanSummary string `q:"plan_summary"`
	// Specifies the operation type. If this parameter is left empty, sessions in which type is empty are queried. You can also specify an operation type, for example, none update insert query command getmore remove killcursors.
	Type string `q:"type"`
	// Specifies the namespace. If this parameter is left blank, the sessions in which namespace is empty are queried. You can also specify the value based on the service requirements.
	NameSpace string `q:"namespace"`
	// Specifies the duration. The unit is us. If this parameter is left empty, the sessions in which cost_time is empty are queried. You can also set this parameter based on the service requirements, indicating that the sessions in which the value of cost_time exceeds the specified value are queried.
	CostTime int `q:"cost_time"`
}

type ListSessionsResponse

type ListSessionsResponse struct {
	Sessions   []SessionResponse `json:"sessions"`
	TotalCount int               `json:"total_count"`
}

type SessionResponse

type SessionResponse struct {
	// Indicates the session ID.
	Id string `json:"id"`
	// Indicates that whether the current session is active. If the value is "true", the session is active. If the value is "false", the session is inactive.
	Active bool `json:"active"`
	// Indicates the operation.
	Operation string `json:"operation"`
	// Indicates the operation type.
	Type string `json:"type"`
	// Specifies the duration. The unit is us.
	CostTime string `json:"cost_time"`
	// Indicates the execution plan description.
	PlanSummary string `json:"plan_summary"`
	// Indicates the host.
	Host string `json:"engine_versions"`
	// Indicates the client address.
	Client string `json:"client"`
	// Indicates the connection description.
	Description string `json:"description"`
	// Indicates the namespace.
	Namespace string `json:"namespace"`
}

Jump to

Keyboard shortcuts

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