MgmtOperationAsync Class

An asynchronous 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
MgmtOperationAsync

Constructor

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

Parameters

session
SessionAsync
Required

The AMQP session to use for the operation. New 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
loop
default value: None

Methods

destroy_async

Close the send/receive links for this node asynchronously.

execute_async

Execute a request and wait on a response asynchronously.

destroy_async

Close the send/receive links for this node asynchronously.

async destroy_async()

execute_async

Execute a request and wait on a response asynchronously.

async execute_async(operation, op_type, message, timeout=0)

Parameters

operation
bytes
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
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

Attributes

loop