'Update a datacenter.
:param  datacenter: The DC you are renaming.
:type   datacenter: :class:`Datacenter`
:param  name: The DC name.
:type   name: : ``str``
:return:    Instance of class ``Datacenter``
:rtype:     :class:`Datacenter`'

def ex_rename_datacenter(self, datacenter, name):

    action = datacenter.href
    body = {'name': name}
    response = self.connection.request(action=action, headers={'Content-Type': 'application/json'}, data=body, method='PATCH', with_full_url=True)
    return self._to_datacenter(response.object, response.headers)
