Skip to content

Subscribe Notifications

API reference for diameter.message.commands.subscribe_notifications.

This module contains Subscribe Notifications Request and Answer messages for the Sh interface, implementing AVPs documented in 3GPP TS 29.329.

SubscribeNotifications

SubscribeNotifications(
    header: MessageHeader = None, avps: list[Avp] = None
)

Bases: DefinedMessage

A Subscribe-Notifications base message.

This message class lists message attributes based on the current 3GPP TS 29.329 version 17.0.0 Release 17 as python properties, accessible as instance attributes. AVPs not listed in the spec protocol can be retrieved using the SubscribeNotifications.find_avps search method.

Examples:

AVPs accessible either as instance attributes or by searching:

>>> msg = Message.from_bytes(b"...")
>>> msg.session_id
dra1.python-diameter.org;2323;546
>>> msg.find_avps((AVP_SESSION_ID, 0))
['dra1.python-diameter.org;2323;546']

When diameter message is decoded using Message.from_bytes, it returns either an instance of SubscribeNotificationsRequest or SubscribeNotificationsAnswer automatically:

>>> msg = Message.from_bytes(b"...")
>>> assert msg.header.is_request is True
>>> assert isinstance(msg, SubscribeNotificationsRequest)

When creating a new message, the SubscribeNotificationsRequest or SubscribeNotificationsAnswer class should be instantiated directly, and values for AVPs set as class attributes:

>>> msg = SubscribeNotificationsRequest()
>>> msg.session_id = "dra1.python-diameter.org;2323;546"

Other, custom AVPs can be appended to the message using the SubscribeNotifications.append_avp method, or by overwriting the avp attribute entirely. Regardless of the custom AVPs set, the mandatory values listed in TS 29.272 must be set, however they can be set as None, if they are not to be used.

Warning

Every AVP documented for the subclasses of this command can be accessed as an instance attribute, even if the original network-received message did not contain that specific AVP. Such AVPs will be returned with the value None when accessed.

Every other AVP not mentioned here, and not present in a network-received message will raise an AttributeError when being accessed; their presence should be validated with hasattr before accessing.

SubscribeNotificationsAnswer

SubscribeNotificationsAnswer(
    header: MessageHeader = None, avps: list[Avp] = None
)

Bases: SubscribeNotifications

A Subscribe-Notifications-Answer message.

3GPP TS 29.329 version 17.0.0

auth_session_state instance-attribute

auth_session_state: int

drmp instance-attribute

drmp: int

experimental_result instance-attribute

experimental_result: ExperimentalResult

expiry_time instance-attribute

expiry_time: datetime

failed_avp instance-attribute

failed_avp: FailedAvp

load instance-attribute

load: list[Load]

oc_olr instance-attribute

oc_olr: OcOlr

oc_supported_features instance-attribute

oc_supported_features: OcSupportedFeatures

origin_host instance-attribute

origin_host: bytes

origin_realm instance-attribute

origin_realm: bytes

proxy_info instance-attribute

proxy_info: list[ProxyInfo]

result_code instance-attribute

result_code: int

route_record instance-attribute

route_record: list[bytes]

session_id instance-attribute

session_id: str

supported_features instance-attribute

supported_features: list[SupportedFeatures]

user_data instance-attribute

user_data: bytes

vendor_specific_application_id instance-attribute

vendor_specific_application_id: VendorSpecificApplicationId

wildcarded_impu instance-attribute

wildcarded_impu: str

wildcarded_public_identity instance-attribute

wildcarded_public_identity: str

SubscribeNotificationsRequest

SubscribeNotificationsRequest(
    header: MessageHeader = None, avps: list[Avp] = None
)

Bases: SubscribeNotifications

A Subscribe-Notifications-Request message.

3GPP TS 29.329 version 17.0.0

auth_session_state instance-attribute

auth_session_state: int

data_reference instance-attribute

data_reference: list[int]

destination_host instance-attribute

destination_host: bytes

destination_realm instance-attribute

destination_realm: bytes

drmp instance-attribute

drmp: int

dsai_tag instance-attribute

dsai_tag: list[bytes]

expiry_time instance-attribute

expiry_time: datetime

identity_set instance-attribute

identity_set: list[int]

oc_supported_features instance-attribute

oc_supported_features: OcSupportedFeatures

one_time_notification instance-attribute

one_time_notification: int

origin_host instance-attribute

origin_host: bytes

origin_realm instance-attribute

origin_realm: bytes

proxy_info instance-attribute

proxy_info: list[ProxyInfo]

route_record instance-attribute

route_record: list[bytes]

send_data_indication instance-attribute

send_data_indication: int

server_name instance-attribute

server_name: str

service_indication instance-attribute

service_indication: list[bytes]

session_id instance-attribute

session_id: str

subs_req_type instance-attribute

subs_req_type: int

supported_features instance-attribute

supported_features: list[SupportedFeatures]

user_identity instance-attribute

user_identity: UserIdentity

user_name instance-attribute

user_name: str

vendor_specific_application_id instance-attribute

vendor_specific_application_id: VendorSpecificApplicationId

wildcarded_impu instance-attribute

wildcarded_impu: str

wildcarded_public_identity instance-attribute

wildcarded_public_identity: str