MgmtOperation Class

An AMQP request/response operation. These are frequently used for management tasks against a $management node, however any node name can be specified and the available options will depend on the target service.

Inheritance
builtins.object
MgmtOperation

Constructor

MgmtOperation(session, target=None, debug=False, status_code_field=b'statusCode', description_fields=b'statusDescription', encoding='UTF-8')

Parameters

session
Session
Required

The AMQP session to use for the operation. Both send and receive links will be created in this Session.

target
bytes or str
default value: None

The AMQP node to send the request to. The default is b"$management"

status_code_field
bytes or str
default value: False

Provide an alternate name for the status code in the response body which can vary between services due to the spec still being in draft. The default is b"statusCode".

description_fields
bytes or str
default value: b'statusCode'

Provide an alternate name for the description in the response body which can vary between services due to the spec still being in draft. The default is b"statusDescription".

encoding
str
default value: b'statusDescription'

The encoding to use for parameters supplied as strings. Default is 'UTF-8'

encoding
default value: UTF-8

Methods

destroy

Close the send/receive links for this node.

execute

Execute a request and wait on a response.

destroy

Close the send/receive links for this node.

destroy()

execute

Execute a request and wait on a response.

execute(operation, op_type, message, timeout=0)

Parameters

operation
bytes or str
Required

The type of operation to be performed. This value will be service-specific, but common values include READ, CREATE and UPDATE. This value will be added as an application property on the message.

op_type
bytes or str
Required

The type on which to carry out the operation. This will be specific to the entities of the service. This value will be added as an application property on the message.

message
Message
Required

The message to send in the management request.

timeout
float
default value: 0

Provide an optional timeout in milliseconds within which a response to the management request must be received.

Return type