azure.eventgrid package

class azure.eventgrid.EventGridConsumerClient(endpoint: str, credential: AzureKeyCredential | TokenCredential, *, namespace_topic: str, subscription: str, api_version: str | None = None, **kwargs: Any)[source]

EventGridConsumerClient.

Consumes and manages events from a namespace topic and event subscription specified during the client initialization.

Parameters:
  • endpoint (str) – The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. Required.

  • credential (AzureKeyCredential or TokenCredential) – Credential used to authenticate requests to the service. Is either a AzureKeyCredential type or a TokenCredential type. Required.

Keyword Arguments:
  • namespace_topic (str) – The name of the topic to consume events from. Required.

  • subscription (str) – The name of the subscription to consume events from. Required.

  • api_version (str) – The API version to use for this operation. Default value is “2024-06-01”. Note that overriding this default value may result in unsupported behavior.

acknowledge(*, lock_tokens: List[str], **kwargs: Any) AcknowledgeResult

Acknowledge a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer.

Keyword Arguments:

lock_tokens (List[str]) – Array of lock tokens of Cloud Events. Required.

Returns:

AcknowledgeResult. The AcknowledgeResult is compatible with MutableMapping

Return type:

AcknowledgeResult

Raises:

HttpResponseError

close() None[source]
receive(*, max_events: int | None = None, max_wait_time: int | None = None, **kwargs: Any) List[ReceiveDetails]

Receive Batch of Cloud Events from the Event Subscription.

Keyword Arguments:
  • max_events (int) – Max Events count to be received. Minimum value is 1, while maximum value is 100 events. The default is None, meaning it will receive one event if available.

  • max_wait_time (int) – Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. The default value is None, meaning it will wait for 60 seconds.

Returns:

ReceiveDetails list of received events and their broker properties.

Return type:

list[ReceiveDetails]

Raises:

HttpResponseError

reject(*, lock_tokens: List[str], **kwargs: Any) RejectResult

Reject a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer.

Keyword Arguments:

lock_tokens (List[str]) – Array of lock tokens of Cloud Events. Required.

Returns:

RejectResult. The RejectResult is compatible with MutableMapping

Return type:

RejectResult

Raises:

HttpResponseError

release(*, lock_tokens: List[str], release_delay: int | ReleaseDelay | None = None, **kwargs: Any) ReleaseResult

Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers.

Keyword Arguments:
  • lock_tokens (List[str]) – Array of lock tokens of Cloud Events. Required.

  • release_delay (int or ReleaseDelay) – Release cloud events with the specified delay in seconds. Known values are: 0, 10, 60, 600, and 3600. Default value is None, indicating no delay.

Returns:

ReleaseResult. The ReleaseResult is compatible with MutableMapping

Return type:

ReleaseResult

Raises:

HttpResponseError

renew_locks(*, lock_tokens: List[str], **kwargs: Any) RenewLocksResult

Renew locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock.

Keyword Arguments:

lock_tokens (List[str]) – Array of lock tokens of Cloud Events. Required.

Returns:

RenewLocksResult. The RenewLocksResult is compatible with MutableMapping

Return type:

RenewLocksResult

Raises:

HttpResponseError

send_request(request: HttpRequest, *, stream: bool = False, **kwargs: Any) HttpResponse[source]

Runs the network request through the client’s chained policies.

>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client.send_request(request)
<HttpResponse: 200 OK>

For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request

Parameters:

request (HttpRequest) – The network request you want to make. Required.

Keyword Arguments:

stream (bool) – Whether the response payload will be streamed. Defaults to False.

Returns:

The response of your network call. Does not do error handling on your response.

Return type:

HttpResponse

class azure.eventgrid.EventGridEvent(subject: str, event_type: str, data: object, data_version: str, **kwargs: Any)[source]

Properties of an event published to an Event Grid topic using the EventGrid Schema.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters:
  • subject (str) – Required. A resource path relative to the topic path.

  • event_type (str) – Required. The type of the event that occurred.

  • data (object) – Required. Event data specific to the event type.

  • data_version (str) – Required. The schema version of the data object. If not provided, will be stamped with an empty value.

Keyword Arguments:
  • topic (str) – The resource path of the event source. If not provided, Event Grid will stamp onto the event. This is required when sending event(s) to a domain.

  • metadata_version (Optional[str]) – The schema version of the event metadata. If provided, must match Event Grid Schema exactly. If not provided, EventGrid will stamp onto event.

  • id (str) – An identifier for the event. In not provided, a random UUID will be generated and used.

  • event_time (datetime) – The time (in UTC) of the event. If not provided, it will be the time (in UTC) the event was generated.

  • id – An unique identifier for the event. Required.

  • topic – The resource path of the event source.

  • subject (str) – A resource path relative to the topic path. Required.

  • data (JSON) – Event data specific to the event type. Required.

  • event_type (str) – The type of the event that occurred. Required.

  • event_time – The time (in UTC) the event was generated. Required.

  • data_version (str) – The schema version of the data object. Required.

Variables:
  • subject (str) – A resource path relative to the topic path.

  • event_type (str) – The type of the event that occurred.

  • data (object) – Event data specific to the event type.

  • data_version (str) – The schema version of the data object. If not provided, will be stamped with an empty value.

  • topic (str) – The resource path of the event source. If not provided, Event Grid will stamp onto the event.

  • metadata_version (str) – The schema version of the event metadata. If provided, must match Event Grid Schema exactly. If not provided, EventGrid will stamp onto event.

  • id (str) – An identifier for the event. In not provided, a random UUID will be generated and used.

  • event_time (datetime) – The time (in UTC) of the event. If not provided, it will be the time (in UTC) the event was generated.

as_dict(keep_readonly: bool = True, key_transformer: ~typing.Callable[[str, ~typing.Dict[str, ~typing.Any], ~typing.Any], ~typing.Any] = <function attribute_transformer>, **kwargs: ~typing.Any) MutableMapping[str, Any]

Return a dict that can be serialized using json.dump.

Advanced usage might optionally use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters:

key_transformer (function) – A key transformer function.

Returns:

A dict JSON compatible object

Return type:

dict

classmethod deserialize(data: Any, content_type: str | None = None) ModelType

Parse a str using the RestAPI syntax and return a model.

Parameters:
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns:

An instance of this model

Raises:

DeserializationError if something went wrong

classmethod enable_additional_properties_sending() None
classmethod from_dict(data: Any, key_extractors: Callable[[str, Dict[str, Any], Any], Any] | None = None, content_type: str | None = None) ModelType

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters:
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns:

An instance of this model

Raises:

DeserializationError if something went wrong

classmethod from_json(event: Any) EventGridEvent[source]

Returns the deserialized EventGridEvent object when a json payload is provided. :param event: The json string that should be converted into a EventGridEvent. This can also be a storage QueueMessage, eventhub’s EventData or ServiceBusMessage :type event: object :rtype: EventGridEvent :return: An EventGridEvent object. :raises ValueError: If the provided JSON is invalid.

classmethod is_xml_model() bool
serialize(keep_readonly: bool = False, **kwargs: Any) MutableMapping[str, Any]

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters:

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns:

A dict JSON compatible object

Return type:

dict

class azure.eventgrid.EventGridPublisherClient(endpoint: str, credential: AzureKeyCredential | AzureSasCredential | TokenCredential, *, namespace_topic: str | None = None, api_version: str | None = None, **kwargs: Any)[source]

EventGridPublisherClient.

Sends events to a basic topic, basic domain, or a namespace topic specified during the client initialization.

A single instance or a list of dictionaries, CloudEvents or EventGridEvents are accepted. If a list is provided, the list must contain only one type of event. If dictionaries are provided and sending to a namespace topic, the dictionary must follow the CloudEvent schema.

Parameters:
  • endpoint (str) – The endpoint of the Event Grid tier (basic or namespace), e.g. namespaceName1.westus-1.eventgrid.azure.net. Required.

  • credential (AzureKeyCredential or TokenCredential) – Credential used to authenticate requests to the service. Is either a AzureKeyCredential type or a TokenCredential type. Required.

Keyword Arguments:
  • namespace_topic (str or None) – The name of the topic to publish events to. Required for Event Grid Namespaces. Default value is None, which is used for Event Grid Basic.

  • api_version (str) – The API version to use for this operation. Default value for Event Grid Namespace is “2024-06-01”, default value for Event Grid Basic is “2018-01-01”. Note that overriding this default value may result in unsupported behavior.

close() None[source]
send(events: CloudEvent | List[CloudEvent] | Dict[str, Any] | List[Dict[str, Any]] | CNCFCloudEvent | List[CNCFCloudEvent] | EventGridEvent | List[EventGridEvent], *, channel_name: str | None = None, content_type: str | None = None, **kwargs: Any) None

Send events to the Event Grid Service.

Parameters:

events (CloudEvent or List[CloudEvent] or Dict[str, Any] or List[Dict[str, Any]] or CNCFCloudEvent or List[CNCFCloudEvent] or EventGridEvent or List[EventGridEvent]) – The event(s) to send. If sending to an Event Grid Namespace, the dict, list of dicts, or event(s) should be in the format of a CloudEvent.

Keyword Arguments:
  • channel_name (str or None) – The name of the channel to send the event to. Event Grid Basic Resource only.

  • content_type (str) – The content type of the event. If not specified, the default value is “application/cloudevents+json; charset=utf-8”.

Returns:

None

Return type:

None

send_request(request: HttpRequest, *, stream: bool = False, **kwargs: Any) HttpResponse[source]

Runs the network request through the client’s chained policies.

>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client.send_request(request)
<HttpResponse: 200 OK>

For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request

Parameters:

request (HttpRequest) – The network request you want to make. Required.

Keyword Arguments:

stream (bool) – Whether the response payload will be streamed. Defaults to False.

Returns:

The response of your network call. Does not do error handling on your response.

Return type:

HttpResponse

class azure.eventgrid.SystemEventNames(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

This enum represents the names of the various event types for the system events published to Azure Event Grid. To check the list of recognizable system topics, visit https://docs.microsoft.com/azure/event-grid/system-topics.

capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold()

Return a version of the string suitable for caseless comparisons.

center(width, fillchar=' ', /)

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count(sub[, start[, end]]) int

Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

encode(encoding='utf-8', errors='strict')

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

endswith(suffix[, start[, end]]) bool

Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

expandtabs(tabsize=8)

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find(sub[, start[, end]]) int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

format(*args, **kwargs) str

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map(mapping) str

Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

index(sub[, start[, end]]) int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isprintable()

Return True if the string is printable, False otherwise.

A string is printable if all of its characters are considered printable in repr() or if it is empty.

isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

join(iterable, /)

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

ljust(width, fillchar=' ', /)

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower()

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

static maketrans()

Return a translation table usable for str.translate().

If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

partition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

removeprefix(prefix, /)

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix(suffix, /)

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

replace(old, new, count=-1, /)

Return a copy with all occurrences of substring old replaced by new.

count

Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are replaced.

rfind(sub[, start[, end]]) int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

rindex(sub[, start[, end]]) int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rpartition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

rsplit(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

split(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the front of the string and works to the end.

Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

splitlines(keepends=False)

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

startswith(prefix[, start[, end]]) bool

Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

strip(chars=None, /)

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

translate(table, /)

Replace each character in the string using the given translation table.

table

Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

AcsAdvancedMessageDeliveryStatusUpdatedEventName = 'Microsoft.Communication.AdvancedMessageDeliveryStatusUpdated'
AcsAdvancedMessageReceivedEventName = 'Microsoft.Communication.AdvancedMessageReceived'
AcsChatMemberAddedToThreadWithUserEventName = 'Microsoft.Communication.ChatMemberAddedToThreadWithUser'
AcsChatMemberRemovedFromThreadWithUserEventName = 'Microsoft.Communication.ChatMemberRemovedFromThreadWithUser'
AcsChatMessageDeletedEventName = 'Microsoft.Communication.ChatMessageDeleted'
AcsChatMessageDeletedInThreadEventName = 'Microsoft.Communication.ChatMessageDeletedInThread'
AcsChatMessageEditedEventName = 'Microsoft.Communication.ChatMessageEdited'
AcsChatMessageEditedInThreadEventName = 'Microsoft.Communication.ChatMessageEditedInThread'
AcsChatMessageReceivedEventName = 'Microsoft.Communication.ChatMessageReceived'
AcsChatMessageReceivedInThreadEventName = 'Microsoft.Communication.ChatMessageReceivedInThread'
AcsChatParticipantAddedToThreadEventName = 'Microsoft.Communication.ChatThreadParticipantAdded'
AcsChatParticipantAddedToThreadWithUserEventName = 'Microsoft.Communication.ChatParticipantAddedToThreadWithUser'
AcsChatParticipantRemovedFromThreadEventName = 'Microsoft.Communication.ChatThreadParticipantRemoved'
AcsChatParticipantRemovedFromThreadWithUserEventName = 'Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser'
AcsChatThreadCreatedEventName = 'Microsoft.Communication.ChatThreadCreated'
AcsChatThreadCreatedWithUserEventName = 'Microsoft.Communication.ChatThreadCreatedWithUser'
AcsChatThreadDeletedEventName = 'Microsoft.Communication.ChatThreadDeleted'
AcsChatThreadParticipantAddedEventName = 'Microsoft.Communication.ChatThreadParticipantAdded'
AcsChatThreadParticipantRemovedEventName = 'Microsoft.Communication.ChatThreadParticipantRemoved'
AcsChatThreadPropertiesUpdatedEventName = 'Microsoft.Communication.ChatThreadPropertiesUpdated'
AcsChatThreadPropertiesUpdatedPerUserEventName = 'Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser'
AcsChatThreadWithUserDeletedEventName = 'Microsoft.Communication.ChatThreadWithUserDeleted'
AcsEmailDeliveryReportReceivedEventName = 'Microsoft.Communication.EmailDeliveryReportReceived'
AcsEmailEngagementTrackingReportReceivedEventName = 'Microsoft.Communication.EmailEngagementTrackingReportReceived'
AcsIncomingCallEventName = 'Microsoft.Communication.IncomingCall'
AcsRecordingFileStatusUpdatedEventName = 'Microsoft.Communication.RecordingFileStatusUpdated'
AcsRouterJobCancelledEventName = 'Microsoft.Communication.RouterJobCancelled'
AcsRouterJobClassificationFailedEventName = 'Microsoft.Communication.RouterJobClassificationFailed'
AcsRouterJobClassifiedEventName = 'Microsoft.Communication.RouterJobClassified'
AcsRouterJobClosedEventName = 'Microsoft.Communication.RouterJobClosed'
AcsRouterJobCompletedEventName = 'Microsoft.Communication.RouterJobCompleted'
AcsRouterJobDeletedEventName = 'Microsoft.Communication.RouterJobDeleted'
AcsRouterJobExceptionTriggeredEventName = 'Microsoft.Communication.RouterJobExceptionTriggered'
AcsRouterJobQueuedEventName = 'Microsoft.Communication.RouterJobQueued'
AcsRouterJobReceivedEventName = 'Microsoft.Communication.RouterJobReceived'
AcsRouterJobSchedulingFailedEventName = 'Microsoft.Communication.RouterJobSchedulingFailed'
AcsRouterJobUnassignedEventName = 'Microsoft.Communication.RouterJobUnassigned'
AcsRouterJobWaitingForActivationEventName = 'Microsoft.Communication.RouterJobWaitingForActivation'
AcsRouterJobWorkerSelectorsExpiredEventName = 'Microsoft.Communication.RouterJobWorkerSelectorsExpired'
AcsRouterWorkerDeletedEventName = 'Microsoft.Communication.RouterWorkerDeleted'
AcsRouterWorkerDeregisteredEventName = 'Microsoft.Communication.RouterWorkerDeregistered'
AcsRouterWorkerOfferAcceptedEventName = 'Microsoft.Communication.RouterWorkerOfferAccepted'
AcsRouterWorkerOfferDeclinedEventName = 'Microsoft.Communication.RouterWorkerOfferDeclined'
AcsRouterWorkerOfferExpiredEventName = 'Microsoft.Communication.RouterWorkerOfferExpired'
AcsRouterWorkerOfferIssuedEventName = 'Microsoft.Communication.RouterWorkerOfferIssued'
AcsRouterWorkerOfferRevokedEventName = 'Microsoft.Communication.RouterWorkerOfferRevoked'
AcsRouterWorkerRegisteredEventName = 'Microsoft.Communication.RouterWorkerRegistered'
AcsRouterWorkerUpdatedEventName = 'Microsoft.Communication.RouterWorkerUpdated'
AcsSmsDeliveryReportReceivedEventName = 'Microsoft.Communication.SMSDeliveryReportReceived'
AcsSmsReceivedEventName = 'Microsoft.Communication.SMSReceived'
AcsUserDisconnectedEventName = 'Microsoft.Communication.UserDisconnected'
ApiCenterApiDefinitionAddedEventName = 'Microsoft.ApiCenter.ApiDefinitionAdded'
ApiCenterApiDefinitionUpdatedEventName = 'Microsoft.ApiCenter.ApiDefinitionUpdated'
ApiManagementApiCreatedEventName = 'Microsoft.ApiManagement.APICreated'
ApiManagementApiDeletedEventName = 'Microsoft.ApiManagement.APIDeleted'
ApiManagementApiReleaseCreatedEventName = 'Microsoft.ApiManagement.APIReleaseCreated'
ApiManagementApiReleaseDeletedEventName = 'Microsoft.ApiManagement.APIReleaseDeleted'
ApiManagementApiReleaseUpdatedEventName = 'Microsoft.ApiManagement.APIReleaseUpdated'
ApiManagementApiUpdatedEventName = 'Microsoft.ApiManagement.APIUpdated'
ApiManagementGatewayApiAddedEventName = 'Microsoft.ApiManagement.GatewayAPIAdded'
ApiManagementGatewayApiRemovedEventName = 'Microsoft.ApiManagement.GatewayAPIRemoved'
ApiManagementGatewayCertificateAuthorityCreatedEventName = 'Microsoft.ApiManagement.GatewayCertificateAuthorityCreated'
ApiManagementGatewayCertificateAuthorityDeletedEventName = 'Microsoft.ApiManagement.GatewayCertificateAuthorityDeleted'
ApiManagementGatewayCertificateAuthorityUpdatedEventName = 'Microsoft.ApiManagement.GatewayCertificateAuthorityUpdated'
ApiManagementGatewayCreatedEventName = 'Microsoft.ApiManagement.GatewayCreated'
ApiManagementGatewayDeletedEventName = 'Microsoft.ApiManagement.GatewayDeleted'
ApiManagementGatewayHostnameConfigurationCreatedEventName = 'Microsoft.ApiManagement.GatewayHostnameConfigurationCreated'
ApiManagementGatewayHostnameConfigurationDeletedEventName = 'Microsoft.ApiManagement.GatewayHostnameConfigurationDeleted'
ApiManagementGatewayHostnameConfigurationUpdatedEventName = 'Microsoft.ApiManagement.GatewayHostnameConfigurationUpdated'
ApiManagementGatewayUpdatedEventName = 'Microsoft.ApiManagement.GatewayUpdated'
ApiManagementProductCreatedEventName = 'Microsoft.ApiManagement.ProductCreated'
ApiManagementProductDeletedEventName = 'Microsoft.ApiManagement.ProductDeleted'
ApiManagementProductUpdatedEventName = 'Microsoft.ApiManagement.ProductUpdated'
ApiManagementSubscriptionCreatedEventName = 'Microsoft.ApiManagement.SubscriptionCreated'
ApiManagementSubscriptionDeletedEventName = 'Microsoft.ApiManagement.SubscriptionDeleted'
ApiManagementSubscriptionUpdatedEventName = 'Microsoft.ApiManagement.SubscriptionUpdated'
ApiManagementUserCreatedEventName = 'Microsoft.ApiManagement.UserCreated'
ApiManagementUserDeletedEventName = 'Microsoft.ApiManagement.UserDeleted'
ApiManagementUserUpdatedEventName = 'Microsoft.ApiManagement.UserUpdated'
AppConfigurationKeyValueDeletedEventName = 'Microsoft.AppConfiguration.KeyValueDeleted'
AppConfigurationKeyValueModifiedEventName = 'Microsoft.AppConfiguration.KeyValueModified'
AppConfigurationSnapshotCreatedEventName = 'Microsoft.AppConfiguration.SnapshotCreated'
AppConfigurationSnapshotModifiedEventName = 'Microsoft.AppConfiguration.SnapshotModified'
AvsClusterCreatedEventName = 'Microsoft.AVS.ClusterCreated'
AvsClusterDeletedEventName = 'Microsoft.AVS.ClusterDeleted'
AvsClusterFailedEventName = 'Microsoft.AVS.ClusterFailed'
AvsClusterUpdatedEventName = 'Microsoft.AVS.ClusterUpdated'
AvsClusterUpdatingEventName = 'Microsoft.AVS.ClusterUpdating'
AvsPrivateCloudFailedEventName = 'Microsoft.AVS.PrivateCloudFailed'
AvsPrivateCloudUpdatedEventName = 'Microsoft.AVS.PrivateCloudUpdated'
AvsPrivateCloudUpdatingEventName = 'Microsoft.AVS.PrivateCloudUpdating'
AvsScriptExecutionCancelledEventName = 'Microsoft.AVS.ScriptExecutionCancelled'
AvsScriptExecutionFailedEventName = 'Microsoft.AVS.ScriptExecutionFailed'
AvsScriptExecutionFinishedEventName = 'Microsoft.AVS.ScriptExecutionFinished'
AvsScriptExecutionStartedEventName = 'Microsoft.AVS.ScriptExecutionStarted'
ContainerRegistryArtifactEventName = 'Microsoft.AppConfiguration.KeyValueModified'
ContainerRegistryChartDeletedEventName = 'Microsoft.ContainerRegistry.ChartDeleted'
ContainerRegistryChartPushedEventName = 'Microsoft.ContainerRegistry.ChartPushed'
ContainerRegistryEventName = 'Microsoft.ContainerRegistry.ChartPushed'
ContainerRegistryImageDeletedEventName = 'Microsoft.ContainerRegistry.ImageDeleted'
ContainerRegistryImagePushedEventName = 'Microsoft.ContainerRegistry.ImagePushed'
ContainerServiceClusterSupportEndedEventName = 'Microsoft.ContainerService.ClusterSupportEnded'
ContainerServiceClusterSupportEndingEventName = 'Microsoft.ContainerService.ClusterSupportEnding'
ContainerServiceNewKubernetesVersionAvailableEventName = 'Microsoft.ContainerService.NewKubernetesVersionAvailable'
ContainerServiceNodePoolRollingFailedEventName = 'Microsoft.ContainerService.NodePoolRollingFailed'
ContainerServiceNodePoolRollingStartedEventName = 'Microsoft.ContainerService.NodePoolRollingStarted'
ContainerServiceNodePoolRollingSucceededEventName = 'Microsoft.ContainerService.NodePoolRollingSucceeded'
DataBoxCopyCompletedEventName = 'Microsoft.DataBox.CopyCompleted'
DataBoxCopyStartedEventName = 'Microsoft.DataBox.CopyStarted'
DataBoxOrderCompletedEventName = 'Microsoft.DataBox.OrderCompleted'
EventGridMQTTClientCreatedOrUpdatedEventName = 'Microsoft.EventGrid.MQTTClientCreatedOrUpdated'
EventGridMQTTClientDeletedEventName = 'Microsoft.EventGrid.MQTTClientDeleted'
EventGridMQTTClientSessionConnectedEventName = 'Microsoft.EventGrid.MQTTClientSessionConnected'
EventGridMQTTClientSessionDisconnectedEventName = 'Microsoft.EventGrid.MQTTClientSessionDisconnected'
EventGridSubscriptionDeletedEventName = 'Microsoft.EventGrid.SubscriptionDeletedEvent'
EventGridSubscriptionValidationEventName = 'Microsoft.EventGrid.SubscriptionValidationEvent'
EventHubCaptureFileCreatedEventName = 'Microsoft.EventHub.CaptureFileCreated'
HealthcareDicomImageCreatedEventName = 'Microsoft.HealthcareApis.DicomImageCreated'
HealthcareDicomImageDeletedEventName = 'Microsoft.HealthcareApis.DicomImageDeleted'
HealthcareDicomImageUpdatedEventName = 'Microsoft.HealthcareApis.DicomImageUpdated'
HealthcareFhirResourceCreatedEventName = 'Microsoft.HealthcareApis.FhirResourceCreated'
HealthcareFhirResourceDeletedEventName = 'Microsoft.HealthcareApis.FhirResourceDeleted'
HealthcareFhirResourceUpdatedEventName = 'Microsoft.HealthcareApis.FhirResourceUpdated'
IoTHubDeviceConnectedEventName = 'Microsoft.Devices.DeviceConnected'
IoTHubDeviceCreatedEventName = 'Microsoft.Devices.DeviceCreated'
IoTHubDeviceDeletedEventName = 'Microsoft.Devices.DeviceDeleted'
IoTHubDeviceDisconnectedEventName = 'Microsoft.Devices.DeviceDisconnected'
IotHubDeviceConnectedEventName = 'Microsoft.Devices.DeviceConnected'
IotHubDeviceCreatedEventName = 'Microsoft.Devices.DeviceCreated'
IotHubDeviceDeletedEventName = 'Microsoft.Devices.DeviceDeleted'
IotHubDeviceDisconnectedEventName = 'Microsoft.Devices.DeviceDisconnected'
IotHubDeviceTelemetryEventName = 'Microsoft.Devices.DeviceTelemetry'
KeyVaultAccessPolicyChangedEventName = 'Microsoft.KeyVault.VaultAccessPolicyChanged'
KeyVaultCertificateExpiredEventName = 'Microsoft.KeyVault.CertificateExpired'
KeyVaultCertificateNearExpiryEventName = 'Microsoft.KeyVault.CertificateNearExpiry'
KeyVaultCertificateNewVersionCreatedEventName = 'Microsoft.KeyVault.CertificateNewVersionCreated'
KeyVaultKeyExpiredEventName = 'Microsoft.KeyVault.KeyExpired'
KeyVaultKeyNearExpiryEventName = 'Microsoft.KeyVault.KeyNearExpiry'
KeyVaultKeyNewVersionCreatedEventName = 'Microsoft.KeyVault.KeyNewVersionCreated'
KeyVaultSecretExpiredEventName = 'Microsoft.KeyVault.SecretExpired'
KeyVaultSecretNearExpiryEventName = 'Microsoft.KeyVault.SecretNearExpiry'
KeyVaultSecretNewVersionCreatedEventName = 'Microsoft.KeyVault.SecretNewVersionCreated'
KeyVaultVaultAccessPolicyChangedEventName = 'Microsoft.KeyVault.VaultAccessPolicyChanged'
MachineLearningServicesDatasetDriftDetectedEventName = 'Microsoft.MachineLearningServices.DatasetDriftDetected'
MachineLearningServicesModelDeployedEventName = 'Microsoft.MachineLearningServices.ModelDeployed'
MachineLearningServicesModelRegisteredEventName = 'Microsoft.MachineLearningServices.ModelRegistered'
MachineLearningServicesRunCompletedEventName = 'Microsoft.MachineLearningServices.RunCompleted'
MachineLearningServicesRunStatusChangedEventName = 'Microsoft.MachineLearningServices.RunStatusChanged'
MapsGeofenceEnteredEventName = 'Microsoft.Maps.GeofenceEntered'
MapsGeofenceExitedEventName = 'Microsoft.Maps.GeofenceExited'
MapsGeofenceResultEventName = 'Microsoft.Maps.GeofenceResult'
MediaJobCanceledEventName = 'Microsoft.Media.JobCanceled'
MediaJobCancelingEventName = 'Microsoft.Media.JobCanceling'
MediaJobErroredEventName = 'Microsoft.Media.JobErrored'
MediaJobFinishedEventName = 'Microsoft.Media.JobFinished'
MediaJobOutputCanceledEventName = 'Microsoft.Media.JobOutputCanceled'
MediaJobOutputCancelingEventName = 'Microsoft.Media.JobOutputCanceling'
MediaJobOutputErroredEventName = 'Microsoft.Media.JobOutputErrored'
MediaJobOutputFinishedEventName = 'Microsoft.Media.JobOutputFinished'
MediaJobOutputProcessingEventName = 'Microsoft.Media.JobOutputProcessing'
MediaJobOutputProgressEventName = 'Microsoft.Media.JobOutputProgress'
MediaJobOutputScheduledEventName = 'Microsoft.Media.JobOutputScheduled'
MediaJobOutputStateChangeEventName = 'Microsoft.Media.JobOutputStateChange'
MediaJobProcessingEventName = 'Microsoft.Media.JobProcessing'
MediaJobScheduledEventName = 'Microsoft.Media.JobScheduled'
MediaJobStateChangeEventName = 'Microsoft.Media.JobStateChange'
MediaLiveEventChannelArchiveHeartbeatEventName = 'Microsoft.Media.LiveEventChannelArchiveHeartbeat'
MediaLiveEventConnectionRejectedEventName = 'Microsoft.Media.LiveEventConnectionRejected'
MediaLiveEventEncoderConnectedEventName = 'Microsoft.Media.LiveEventEncoderConnected'
MediaLiveEventEncoderDisconnectedEventName = 'Microsoft.Media.LiveEventEncoderDisconnected'
MediaLiveEventIncomingDataChunkDroppedEventName = 'Microsoft.Media.LiveEventIncomingDataChunkDropped'
MediaLiveEventIncomingStreamReceivedEventName = 'Microsoft.Media.LiveEventIncomingStreamReceived'
MediaLiveEventIncomingStreamsOutOfSyncEventName = 'Microsoft.Media.LiveEventIncomingStreamsOutOfSync'
MediaLiveEventIncomingVideoStreamsOutOfSyncEventName = 'Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync'
MediaLiveEventIngestHeartbeatEventName = 'Microsoft.Media.LiveEventIngestHeartbeat'
MediaLiveEventTrackDiscontinuityDetectedEventName = 'Microsoft.Media.LiveEventTrackDiscontinuityDetected'
PolicyInsightsPolicyStateChangedEventName = 'Microsoft.PolicyInsights.PolicyStateChanged'
PolicyInsightsPolicyStateCreatedEventName = 'Microsoft.PolicyInsights.PolicyStateCreated'
PolicyInsightsPolicyStateDeletedEventName = 'Microsoft.PolicyInsights.PolicyStateDeleted'
RedisExportRDBCompletedEventName = 'Microsoft.Cache.ExportRDBCompleted'
RedisImportRDBCompletedEventName = 'Microsoft.Cache.ImportRDBCompleted'
RedisPatchingCompletedEventName = 'Microsoft.Cache.PatchingCompleted'
RedisScalingCompletedEventName = 'Microsoft.Cache.ScalingCompleted'
ResourceActionCancelEventName = 'Microsoft.Resources.ResourceActionCancel'
ResourceActionCancelName = 'Microsoft.Resources.ResourceActionCancel'
ResourceActionFailureEventName = 'Microsoft.Resources.ResourceActionFailure'
ResourceActionFailureName = 'Microsoft.Resources.ResourceActionFailure'
ResourceActionSuccessEventName = 'Microsoft.Resources.ResourceActionSuccess'
ResourceActionSuccessName = 'Microsoft.Resources.ResourceActionSuccess'
ResourceDeleteCancelEventName = 'Microsoft.Resources.ResourceDeleteCancel'
ResourceDeleteCancelName = 'Microsoft.Resources.ResourceDeleteCancel'
ResourceDeleteFailureEventName = 'Microsoft.Resources.ResourceDeleteFailure'
ResourceDeleteFailureName = 'Microsoft.Resources.ResourceDeleteFailure'
ResourceDeleteSuccessEventName = 'Microsoft.Resources.ResourceDeleteSuccess'
ResourceDeleteSuccessName = 'Microsoft.Resources.ResourceDeleteSuccess'
ResourceNotificationsHealthResourcesAnnotatedEventName = 'Microsoft.ResourceNotifications.HealthResources.ResourceAnnotated'
ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventName = 'Microsoft.ResourceNotifications.HealthResources.AvailabilityStatusChanged'
ResourceNotificationsResourceManagementCreatedOrUpdatedEventName = 'Microsoft.ResourceNotifications.Resources.CreatedOrUpdated'
ResourceNotificationsResourceManagementDeletedEventName = 'Microsoft.ResourceNotifications.Resources.Deleted'
ResourceWriteCancelEventName = 'Microsoft.Resources.ResourceWriteCancel'
ResourceWriteCancelName = 'Microsoft.Resources.ResourceWriteCancel'
ResourceWriteFailureEventName = 'Microsoft.Resources.ResourceWriteFailure'
ResourceWriteFailureName = 'Microsoft.Resources.ResourceWriteFailure'
ResourceWriteSuccessEventName = 'Microsoft.Resources.ResourceWriteSuccess'
ResourceWriteSuccessName = 'Microsoft.Resources.ResourceWriteSuccess'
ServiceBusActiveMessagesAvailablePeriodicNotificationsEventName = 'Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications'
ServiceBusActiveMessagesAvailableWithNoListenersEventName = 'Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners'
ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventName = 'Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications'
ServiceBusDeadletterMessagesAvailableWithNoListenerEventName = 'Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners'
ServiceBusDeadletterMessagesAvailableWithNoListenersEventName = 'Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners'
SignalRServiceClientConnectionConnectedEventName = 'Microsoft.SignalRService.ClientConnectionConnected'
SignalRServiceClientConnectionDisconnectedEventName = 'Microsoft.SignalRService.ClientConnectionDisconnected'
StorageAsyncOperationInitiatedEventName = 'Microsoft.Storage.AsyncOperationInitiated'
StorageBlobCreatedEventName = 'Microsoft.Storage.BlobCreated'
StorageBlobDeletedEventName = 'Microsoft.Storage.BlobDeleted'
StorageBlobInventoryPolicyCompletedEventName = 'Microsoft.Storage.BlobInventoryPolicyCompleted'
StorageBlobRenamedEventName = 'Microsoft.Storage.BlobRenamed'
StorageBlobTierChangedEventName = 'Microsoft.Storage.BlobTierChanged'
StorageDirectoryCreatedEventName = 'Microsoft.Storage.DirectoryCreated'
StorageDirectoryDeletedEventName = 'Microsoft.Storage.DirectoryDeleted'
StorageDirectoryRenamedEventName = 'Microsoft.Storage.DirectoryRenamed'
StorageLifecyclePolicyCompletedEventName = 'Microsoft.Storage.LifecyclePolicyCompleted'
StorageTaskAssignmentCompletedEventName = 'Microsoft.Storage.StorageTaskAssignmentCompleted'
StorageTaskAssignmentQueuedEventName = 'Microsoft.Storage.StorageTaskAssignmentQueued'
StorageTaskCompletedEventName = 'Microsoft.Storage.StorageTaskCompleted'
StorageTaskQueuedEventName = 'Microsoft.Storage.StorageTaskQueued'
SubscriptionDeletedEventName = 'Microsoft.EventGrid.SubscriptionDeletedEvent'
SubscriptionValidationEventName = 'Microsoft.EventGrid.SubscriptionValidationEvent'
WebAppServicePlanUpdatedEventName = 'Microsoft.Web.AppServicePlanUpdated'
WebAppUpdatedEventName = 'Microsoft.Web.AppUpdated'
WebBackupOperationCompletedEventName = 'Microsoft.Web.BackupOperationCompleted'
WebBackupOperationFailedEventName = 'Microsoft.Web.BackupOperationFailed'
WebBackupOperationStartedEventName = 'Microsoft.Web.BackupOperationStarted'
WebRestoreOperationCompletedEventName = 'Microsoft.Web.RestoreOperationCompleted'
WebRestoreOperationFailedEventName = 'Microsoft.Web.RestoreOperationFailed'
WebRestoreOperationStartedEventName = 'Microsoft.Web.RestoreOperationStarted'
WebSlotSwapCompletedEventName = 'Microsoft.Web.SlotSwapCompleted'
WebSlotSwapFailedEventName = 'Microsoft.Web.SlotSwapFailed'
WebSlotSwapStartedEventName = 'Microsoft.Web.SlotSwapStarted'
WebSlotSwapWithPreviewCancelledEventName = 'Microsoft.Web.SlotSwapWithPreviewCancelled'
WebSlotSwapWithPreviewStartedEventName = 'Microsoft.Web.SlotSwapWithPreviewStarted'
azure.eventgrid.generate_sas(endpoint: str, shared_access_key: str, expiration_date_utc: datetime, *, api_version: str = '2018-01-01') str[source]

Helper method to generate shared access signature given hostname, key, and expiration date. :param str endpoint: The topic endpoint to send the events to. Similar to <YOUR-TOPIC-NAME>.<YOUR-REGION-NAME>-1.eventgrid.azure.net :param str shared_access_key: The shared access key to be used for generating the token :param datetime.datetime expiration_date_utc: The expiration datetime in UTC for the signature. :keyword str api_version: The API Version to include in the signature. If not provided, the default API version will be used. :return: A shared access signature string. :rtype: str

Example:

Generate a shared access signature.
import os
from azure.eventgrid import generate_sas
from datetime import datetime, timedelta

topic_key = os.environ["EVENTGRID_TOPIC_KEY"]
endpoint = os.environ["EVENTGRID_TOPIC_ENDPOINT"]

# represents the expiration date for sas
expiration_date_utc = datetime.utcnow() + timedelta(hours=10)

signature = generate_sas(endpoint, topic_key, expiration_date_utc)

Subpackages