'Create an IP block
:param  location: The location of the IP block.
:type   location: :class:`NodeLocation`
:param  size: The size of the IP block.
:type   size: ``int``
:param  name: The name of the IP block.
:type   name: ``str``
:return:    Instance class ``ProfitBricksIPBlock``
:rtype:     :class:`ProfitBricksIPBlock`'

def ex_create_ip_block(self, location, size, name=None):

    body = {'properties': {'location': location.id, 'size': size}}
    if (name is not None):
        body['properties']['name'] = name
    response = self.connection.request(action='ipblocks', headers={'Content-Type': 'application/json'}, data=body, method='POST')
    return self._to_ip_block(response.object, response.headers)
