def update(cls, id, name, size, quantity, password, sshkey, upgrade,
               console, snapshot_profile, reset_mysql_password, background):
        """Update a PaaS instance."""
        if not background and not cls.intty():
            background = True

        paas_params = {}

        if name:
            paas_params['name'] = name

        if size:
            paas_params['size'] = size

        if quantity:
            paas_params['quantity'] = quantity

        if password:
            paas_params['password'] = password

        paas_params.update(cls.convert_sshkey(sshkey))

        if upgrade:
            paas_params['upgrade'] = upgrade

        if console:
            paas_params['console'] = console

        # XXX to delete a snapshot_profile the value has to be an empty string
        if snapshot_profile is not None:
            paas_params['snapshot_profile'] = snapshot_profile

        if reset_mysql_password:
            paas_params['reset_mysql_password'] = reset_mysql_password

        result = cls.call('paas.update', cls.usable_id(id), paas_params)
        if background:
            return result

        # interactive mode, run a progress bar
        cls.echo('Updating your PaaS instance.')
        cls.display_progress(result)
def update ( cls , id , name , size , quantity , password , sshkey , upgrade , console , snapshot_profile , reset_mysql_password , background ) : if not background and not cls . intty ( ) : background = True paas_params = { } if name : paas_params [ 'name' ] = name if size : paas_params [ 'size' ] = size if quantity : paas_params [ 'quantity' ] = quantity if password : paas_params [ 'password' ] = password paas_params . update ( cls . convert_sshkey ( sshkey ) ) if upgrade : paas_params [ 'upgrade' ] = upgrade if console : paas_params [ 'console' ] = console if snapshot_profile is not None : paas_params [ 'snapshot_profile' ] = snapshot_profile if reset_mysql_password : paas_params [ 'reset_mysql_password' ] = reset_mysql_password result = cls . call ( 'paas.update' , cls . usable_id ( id ) , paas_params ) if background : return result cls . echo ( 'Updating your PaaS instance.' ) cls . display_progress ( result )
Update a PaaS instance.