def create_subscription(self, subscription):
if subscription.subscription_id is not None:<EOL><INDENT>self._validate_uuid(subscription.subscription_id)<EOL><DEDENT>if subscription.endpoint is not None:<EOL><INDENT>if subscription.endpoint.subscriber_id is not None:<EOL><INDENT>self._validate_subscriber_id(<EOL>subscription.endpoint.subscriber_id)<EOL><DEDENT>if subscription.endpoint.endpoint_id is not None:<EOL><INDENT>self._validate_uuid(subscription.endpoint.endpoint_id)<EOL><DEDENT><DEDENT>if subscription.channel is not None:<EOL><INDENT>self._validate_uuid(subscription.channel.channel_id)<EOL><DEDENT>url = "<STR_LIT>"<EOL>response = NWS_DAO().postURL(url, self._write_headers(),<EOL>self._json_body(subscription.json_data()))<EOL>if response.status != <NUM_LIT>:<EOL><INDENT>raise DataFailureException(url, response.status, response.data)<EOL><DEDENT>return response.status<EOL>
Create a new subscription
:param subscription: the new subscription the client wants to create