def create_table(self, table, fail_on_exist=False): ''' Creates a new table in the storage account. table: Name of the table to create. Table name may contain only alphanumeric characters and cannot begin with a numeric character. It is case-insensitive and must be from 3 to 63 characters long. fail_on_exist: Specify whether throw exception when table exists. ''' _validate_not_none('table', table) request = HTTPRequest() request.method = 'POST' request.host = self._get_host() request.path = '/Tables' request.body = _get_request_body(_convert_table_to_xml(table)) request.path, request.query = _update_request_uri_query_local_storage( request, self.use_local_storage) request.headers = _update_storage_table_header(request) if not fail_on_exist: try: self._perform_request(request) return True except WindowsAzureError as ex: _dont_fail_on_exist(ex) return False else: self._perform_request(request) return True
def create_table(self, table, fail_on_exist=False): ''' Creates a new table in the storage account. table: Name of the table to create. Table name may contain only alphanumeric characters and cannot begin with a numeric character. It is case-insensitive and must be from 3 to 63 characters long. fail_on_exist: Specify whether throw exception when table exists. ''' _validate_not_none('table', table) request = HTTPRequest() request.method = 'POST' request.host = self._get_host() request.path = '/Tables' request.body = _get_request_body(_convert_table_to_xml(table)) request.path, request.query = _update_request_uri_query_local_storage(request, self.use_local_storage) request.headers = _update_storage_table_header(request) if not fail_on_exist: try: self._perform_request(request) return True except WindowsAzureError as e: _dont_fail_on_exist(e) return False else: self._perform_request(request) return True