addons:upgrade ADDON_NAME ADDON_SERVICE:PLAN

 upgrade an existing add-on resource to PLAN
509726
def upgrade
      addon_name, plan = args.shift, args.shift

      if addon_name && !plan # If invocated as `addons:Xgrade service:plan`
        deprecate("No add-on name specified (see `heroku help #{current_command}`)")

        addon = nil
        plan = addon_name
        service = plan.split(':').first

        action("Finding add-on from service #{service} on app #{app}") do
          # resolve with the service only, because the user has passed in the
          # *intended* plan, not the current plan.
          addon = resolve_addon!(service)
          addon_name = addon['name']
        end
        display "Found #{addon_name} (#{addon['plan']['name']}) on #{app}."
      else
        raise CommandFailed.new("Missing add-on name") if addon_name.nil?
        addon_name = addon_name.sub(/^@/, '')
      end

      raise CommandFailed.new("Missing add-on plan") if plan.nil?

      action("Changing #{addon_name} plan to #{plan}") do
        @addon = api.request(
          :body     => json_encode({
            "plan"   => { "name" => plan }
          }),
          :expects  => 200..300,
          :headers  => {
            "Accept" => "application/vnd.heroku+json; version=3",
            "Accept-Expansion" => "plan",
            "X-Heroku-Legacy-Provider-Messages" => "true"
          },
          :method   => :patch,
          :path     => "/apps/#{app}/addons/#{addon_name}"
        ).body
        @status = "(#{format_price @addon['plan']['price']})" if @addon['plan'].has_key?('price')
      end
      display @addon['provision_message'] unless @addon['provision_message'].to_s.strip == ""
    end
1126302
def insert(self, context, plan):
	
		
		
		op = execution.Insert(self.__comp_name, self.__comp())
		if op not in plan and self.available(context) != True:
			for dep_stub in self.dependencies():
				dep_stub.insert(context, plan)
			plan.append(op)
903139
protected void addOnDone() {
        for (Addon addon : addons) {
            try {
                addon.done(this);
            } catch (Exception e) {
                logger.error(Messages.get("info.addon.error", addon.getClass().getName()), e);
            }
        }
    }
983802
def create_add_on(self, add_on):
        """"""
        url = urljoin(self._url, '/add_ons')
        return add_on.post(url)
613741
def upgrade(yes, dry_run, patches):
    
    patcher = _get_mongopatcher()
    if dry_run:
        patcher.discover_and_apply(directory=patches, dry_run=dry_run)
    else:
        if (yes or prompt_bool("Are you sure you want to alter %s" %
                               green(patcher.db))):
            patcher.discover_and_apply(patches)
        else:
            raise SystemExit('You changed your mind, exiting...')
105861
def add_provide(self, provide):
        
        for p in self.provides:
            if p.value == provide.value:
                return
        self.provides.append(provide)
306770
public AddOn updateAddOn(final String planCode, final String addOnCode, final AddOn addOn) {
        return doPUT(Plan.PLANS_RESOURCE +
                "/" +
                planCode +
                AddOn.ADDONS_RESOURCE +
                "/" +
                addOnCode,
                addOn,
                AddOn.class);
    }
1273807
def rename(new_name, options = {})
      endpoint = "/api/build/rename/#{url_safe(name)}" + "?to=#{new_name}"
      client.post(endpoint, {})
      true
    rescue Error::HTTPError => e
      false
    end
806295
def update_admin_object_resource(name, server=None, **kwargs):
    '''
    
    '''
    if 'jndiName' in kwargs:
        del kwargs['jndiName']
    return _update_element(name, 'resources/admin-object-resource', kwargs, server)
604010
def update(self, *args, **kwargs):
        
        if request.method == 'PUT':
            logging.warning("Called not implemented resource method PUT")

        resource = super(JsonServerResource, self).update(*args, **kwargs)

        if resource:
            return resource
        else:
            return NOT_FOUND
996632
def services
      if current_command == "addons:list"
        deprecate("`heroku #{current_command}` has been deprecated. Please use `heroku addons:services` instead.")
      end

      display_table(get_services, %w[name human_name state], %w[Slug Name State])
      display "\nSee plans with `heroku addons:plans SERVICE`"
    end
183894
def add(self, resource, replace=False):
        """"""
        uri = resource.uri
        if (uri in self and not replace):
            raise ResourceSetDupeError(
                "Attempt to add resource already in this set")
        self[uri] = resource
655101
def _expand_address(addy):
    '''
    
    '''
    ret = {}
    ret.update(addy.__dict__)
    ret['extra']['zone'] = addy.region.name
    return ret
510190
def update(self, **kwargs):
        
        if 'useProxyServer' in kwargs and kwargs['useProxyServer'] == 'enabled':
            if 'proxyServerPool' not in kwargs:
                error = 'Missing proxyServerPool parameter value.'
                raise MissingUpdateParameter(error)
        if hasattr(self, 'useProxyServer'):
            if getattr(self, 'useProxyServer') == 'enabled' and 'proxyServerPool' not in self.__dict__:
                error = 'Missing proxyServerPool parameter value.'
                raise MissingUpdateParameter(error)

        self._update(**kwargs)

        return self
1302206
public AddOn getAddOn(final String planCode, final String addOnCode) {
        if (addOnCode == null || addOnCode.isEmpty())
            throw new RuntimeException("addOnCode cannot be empty!");

        return doGET(Plan.PLANS_RESOURCE +
                     "/" +
                     planCode +
                     AddOn.ADDONS_RESOURCE +
                     "/" +
                     addOnCode, AddOn.class);
    }
828326
def fetch(self, addon_id, data={}, **kwargs):
        "
        return super(Addon, self).fetch(addon_id, data, **kwargs)
1081722
def AddService(self, new_service):
    
    for service in self._services:
      if new_service == service:
        # If this service is the same as one we already know about, we
        # just want to add where it came from.
        service.sources.append(new_service.sources[0])
        return

    # We only add a new object to our list if we don't have
    # an identical one already.
    self._services.append(new_service)