def create_event_hub(self, hub_name, hub=None, fail_on_exist=False):
_validate_not_none('<STR_LIT>', hub_name)<EOL>request = HTTPRequest()<EOL>request.method = '<STR_LIT>'<EOL>request.host = self._get_host()<EOL>request.path = '<STR_LIT:/>' + _str(hub_name) + '<STR_LIT>'<EOL>request.body = _get_request_body(_convert_event_hub_to_xml(hub))<EOL>request.path, request.query = self._httpclient._update_request_uri_query(request)  <EOL>request.headers = self._update_service_bus_header(request)<EOL>if not fail_on_exist:<EOL><INDENT>try:<EOL><INDENT>self._perform_request(request)<EOL>return True<EOL><DEDENT>except AzureHttpError as ex:<EOL><INDENT>_dont_fail_on_exist(ex)<EOL>return False<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self._perform_request(request)<EOL>return True<EOL><DEDENT>
Creates a new Event Hub.

hub_name:
    Name of event hub.
hub:
    Optional. Event hub properties. Instance of EventHub class.
hub.message_retention_in_days:
    Number of days to retain the events for this Event Hub.
hub.status:
    Status of the Event Hub (enabled or disabled).
hub.user_metadata:
    User metadata.
hub.partition_count:
    Number of shards on the Event Hub.
fail_on_exist:
    Specify whether to throw an exception when the event hub exists.