code: def upgrade(self, name, params=None):
          
          # Allow non-namespaced upgrades. (e.g. advanced vs logging:advanced)
          if ':' not in name:
              name = '{0}:{1}'.format(self.type, name)
  
          r = self._h._http_resource(
              method='PUT',
              resource=('apps', self.app.name, 'addons', quote(name)),
              params=params,
              data=' '   # Server weirdness.
          )
          r.raise_for_status()
          return self.app.addons[name]
docs: Upgrades an addon to the given tier.