/v1/server/upgrade_plan
        POST - account
        Upgrade the plan of a virtual machine. The virtual machine will be
        rebooted upon a successful upgrade.

        Link: https://www.vultr.com/api/#server_upgrade_plan
543300
def upgrade_plan(self, subid, vpsplanid, params=None):
        ''' 
        '''
        params = update_params(params, {
            'SUBID': subid,
            'VPSPLANID': vpsplanid
        })
        return self.request('/v1/server/upgrade_plan', params, 'POST')
565033
public static xen_upgrade[] upgrade(nitro_service client, xen_upgrade[] resources) throws Exception
	{
		if(resources == null)
			throw new Exception("Null resource array");
		
		
		if(resources.length == 1)
			return ((xen_upgrade[]) resources[0].update_resource(client));
		
		return ((xen_upgrade[]) update_bulk_request(client, resources));
	}
508456
public static xen_upgrade upgrade(nitro_service client, xen_upgrade resource) throws Exception
	{
		return ((xen_upgrade[]) resource.update_resource(client))[0];
	}
233582
function onupgradeneeded() {
            self.db = request.result;
            self.transaction = request.transaction;

            // NB! in case of a version conflict, we don't try to migrate,
            // instead just throw away the old store and create a new one.
            // this happens if somebody changed the 
            try {
                self.db.deleteObjectStore(self.record);
            } catch (e) { /* ignore */ }

            // create object store.
            var objectStoreOptions = {
                autoIncrement: useAutoIncrement()
            }
            if( typeof( self.keyPath )) {
                objectStoreOptions.keyPath = self.keyPath;
            }
            self.db.createObjectStore(self.record, objectStoreOptions);
        }
352341
public static ns_upgrade upgrade(nitro_service client, ns_upgrade resource) throws Exception
	{
		return ((ns_upgrade[]) resource.perform_operation(client, "upgrade"))[0];
	}
1088956
def list_upgrades(refresh=True, **kwargs):  # pylint: disable=W0613
    '''
    
    '''
    if salt.utils.data.is_true(refresh):
        refresh_db()
    upgrades = {}
    lines = __salt__['cmd.run_stdout'](
        '/opt/csw/bin/pkgutil -A --parse').splitlines()
    for line in lines:
        comps = line.split('\t')
        if comps[2] == "SAME":
            continue
        if comps[2] == "not installed":
            continue
        upgrades[comps[0]] = comps[1]
    return upgrades
1092791
def upgrade():
    """"""
    op.create_table(
        'oauthclient_remoteaccount',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('user_id', sa.Integer(), nullable=False),
        sa.Column('client_id', sa.String(length=255), nullable=False),
        sa.Column(
            'extra_data',
            sqlalchemy_utils.JSONType(),
            nullable=False),
        sa.ForeignKeyConstraint(['user_id'], [u'accounts_user.id'], ),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('user_id', 'client_id')
    )
    op.create_table(
        'oauthclient_useridentity',
        sa.Column('id', sa.String(length=255), nullable=False),
        sa.Column('method', sa.String(length=255), nullable=False),
        sa.Column('id_user', sa.Integer(), nullable=False),
        sa.ForeignKeyConstraint(['id_user'], [u'accounts_user.id'], ),
        sa.PrimaryKeyConstraint('id', 'method')
    )
    op.create_index(
        'useridentity_id_user_method', 'oauthclient_useridentity',
        ['id_user', 'method'], unique=True
    )
    op.create_table(
        'oauthclient_remotetoken',
        sa.Column('id_remote_account', sa.Integer(), nullable=False),
        sa.Column('token_type', sa.String(length=40), nullable=False),
        sa.Column(
            'access_token',
            sqlalchemy_utils.EncryptedType(),
            nullable=False),
        sa.Column('secret', sa.Text(), nullable=False),
        sa.ForeignKeyConstraint(
            ['id_remote_account'], [u'oauthclient_remoteaccount.id'],
            name='fk_oauthclient_remote_token_remote_account'
        ),
        sa.PrimaryKeyConstraint('id_remote_account', 'token_type')
    )
203246
def _scheduleUpgrade(self,
                         ev_data: UpgradeLogData,
                         failTimeout) -> None:
        
        logger.info(
            "{}'s upgrader processing upgrade for version {}={}"
            .format(self, ev_data.pkg_name, ev_data.version))
        now = datetime.utcnow().replace(tzinfo=dateutil.tz.tzutc())

        self._notifier.sendMessageUponNodeUpgradeScheduled(
            "Upgrade of package {} on node '{}' to version {} "
            "has been scheduled on {}"
            .format(ev_data.pkg_name, self.nodeName,
                    ev_data.version, ev_data.when))
        self._actionLog.append_scheduled(ev_data)

        callAgent = partial(self._callUpgradeAgent, ev_data, failTimeout)
        delay = 0
        if now < ev_data.when:
            delay = (ev_data.when - now).total_seconds()
        self.scheduledAction = ev_data
        self._schedule(callAgent, delay)
374863
def upgrade(directory, sql, tag, x_arg, revision):
    """"""
    _upgrade(directory, revision, sql, tag, x_arg)
862902
def restore_and_grow(server,new_size,force)
      options = { "EBS_MOUNT_POINT" => "text:#{@mount_point}",
              "EBS_TOTAL_VOLUME_GROUP_SIZE" => "text:#{new_size}",
              "OPT_DB_FORCE_RESTORE" => "text:#{force}",
              "EBS_LINEAGE" => "text:#{@lineage}" }
      audit = server.run_executable(@scripts_to_run['grow_volume'], options)
      audit.wait_for_completed
    end
979533
public static br_upgrade[] upgrade(nitro_service client, br_upgrade[] resources) throws Exception
	{
		if(resources == null)
			throw new Exception("Null resource array");
		
		
		if(resources.length == 1)
			return ((br_upgrade[]) resources[0].perform_operation(client, "upgrade"));
		
		return ((br_upgrade[]) perform_operation_bulk_request(client, resources, "upgrade"));
	}
1001874
public boolean isShowUpgradeWizard() {
        HttpSession session = Stapler.getCurrentRequest().getSession(false);
        if(session != null) {
            return Boolean.TRUE.equals(session.getAttribute(SHOW_UPGRADE_WIZARD_FLAG));
        }
        return false;
    }
1082507
@SuppressWarnings("deprecation")
    public boolean upgrade() throws Exception {
        // We need to start a client so we can send requests to elasticsearch
        try {
            esClient.start();
        } catch (Exception t) {
            logger.fatal("We can not start Elasticsearch Client. Exiting.", t);
            return false;
        }

        // The upgrade script is for now a bit dumb. It assumes that you had an old version of FSCrawler (< 2.3) and it will
        // simply move data from index/folder to index_folder
        String index = settings.getElasticsearch().getIndex();

        // Check that the old index actually exists
        if (esClient.isExistingIndex(index)) {
            // We check that the new indices don't exist yet or are empty
            String indexFolder = settings.getElasticsearch().getIndexFolder();
            boolean indexExists = esClient.isExistingIndex(indexFolder);
            long numberOfDocs = 0;
            if (indexExists) {
                ESSearchResponse responseFolder = esClient.search(new ESSearchRequest().withIndex(indexFolder));
                numberOfDocs = responseFolder.getTotalHits();
            }
            if (numberOfDocs > 0) {
                logger.warn("[{}] already exists and is not empty. No upgrade needed.", indexFolder);
            } else {
                logger.debug("[{}] can be upgraded.", index);

                // Create the new indices with the right mappings (well, we don't read existing user configuration)
                if (!indexExists) {
                    esClient.createIndices();
                    logger.info("[{}] has been created.", indexFolder);
                }

                // Run reindex task for folders
                logger.info("Starting reindex folders...");
                int folders = esClient.reindex(index, INDEX_TYPE_FOLDER, indexFolder);
                logger.info("Done reindexing [{}] folders...", folders);

                // Run delete by query task for folders
                logger.info("Starting removing folders from [{}]...", index);
                esClient.deleteByQuery(index, INDEX_TYPE_FOLDER);
                logger.info("Done removing folders from [{}]", index);

                logger.info("You can now upgrade your elasticsearch cluster to >=6.0.0!");
                return true;
            }
        } else {
            logger.info("[{}] does not exist. No upgrade needed.", index);
        }

        return false;
    }
193875
def managed(name, servers=None):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'NTP servers already configured as specified'}

    if not _check_servers(servers):
        ret['result'] = False
        ret['comment'] = 'NTP servers must be a list of strings'

    before_servers = _get_servers()
    desired_servers = set(servers)

    if before_servers == desired_servers:
        return ret

    if __opts__['test']:
        ret['result'] = None
        ret['comment'] = ('NTP servers will be updated to: {0}'
                          .format(', '.join(sorted(desired_servers))))
        return ret

    __salt__['ntp.set_servers'](*desired_servers)
    after_servers = _get_servers()

    if after_servers == desired_servers:
        ret['comment'] = 'NTP servers updated'
        ret['changes'] = {'old': sorted(before_servers),
                          'new': sorted(after_servers)}
    else:
        ret['result'] = False
        ret['comment'] = 'Failed to update NTP servers'
        if before_servers != after_servers:
            ret['changes'] = {'old': sorted(before_servers),
                              'new': sorted(after_servers)}

    return ret
852156
def upgrade():
    """"""
    op.create_table(
        'access_actionsroles',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('action', sa.String(length=80), nullable=True),
        sa.Column('exclude', sa.Boolean(name='exclude'), server_default='0',
                  nullable=False),
        sa.Column('argument', sa.String(length=255), nullable=True),
        sa.Column('role_id', sa.Integer(), nullable=False),
        sa.ForeignKeyConstraint(['role_id'], [u'accounts_role.id'], ),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('action', 'exclude', 'argument', 'role_id',
                            name='access_actionsroles_unique')
    )
    op.create_index(
        op.f('ix_access_actionsroles_action'), 'access_actionsroles',
        ['action'], unique=False)
    op.create_index(
        op.f('ix_access_actionsroles_argument'), 'access_actionsroles',
        ['argument'], unique=False)
    op.create_table(
        'access_actionsusers',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('action', sa.String(length=80), nullable=True),
        sa.Column('exclude', sa.Boolean(name='exclude'), server_default='0',
                  nullable=False),
        sa.Column('argument', sa.String(length=255), nullable=True),
        sa.Column('user_id', sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(['user_id'], [u'accounts_user.id'], ),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('action', 'exclude', 'argument', 'user_id',
                            name='access_actionsusers_unique')
    )
    op.create_index(
        op.f('ix_access_actionsusers_action'), 'access_actionsusers',
        ['action'], unique=False)
    op.create_index(
        op.f('ix_access_actionsusers_argument'), 'access_actionsusers',
        ['argument'], unique=False)
1098090
def _upgrade(system_image, kickstart_image, issu, **kwargs):
    '''
    
    '''
    si = system_image
    ki = kickstart_image
    dev = 'bootflash'
    cmd = 'terminal dont-ask ; install all'

    if ki is None:
        logmsg = 'Upgrading device using combined system/kickstart image.'
        logmsg += '\nSystem Image: {}'.format(si)
        cmd = cmd + ' nxos {0}:{1}'.format(dev, si)
        if issu:
            cmd = cmd + ' non-disruptive'
    else:
        logmsg = 'Upgrading device using separate system/kickstart images.'
        logmsg += '\nSystem Image: {}'.format(si)
        logmsg += '\nKickstart Image: {}'.format(ki)
        if not issu:
            log.info('Attempting upgrade using force option')
            cmd = cmd + ' force'
        cmd = cmd + ' kickstart {0}:{1} system {0}:{2}'.format(dev, ki, si)

    if issu:
        logmsg += '\nIn Service Software Upgrade/Downgrade (non-disruptive) requested.'
    else:
        logmsg += '\nDisruptive Upgrade/Downgrade requested.'

    log.info(logmsg)
    log.info("Begin upgrade using command: '%s'", cmd)

    kwargs.update({'timeout': kwargs.get('timeout', 900)})
    error_pattern_list = ['Another install procedure may be in progress']
    kwargs.update({'error_pattern': error_pattern_list})

    # Begin Actual Upgrade
    try:
        upgrade_result = __salt__['nxos.sendline'](cmd, **kwargs)
    except CommandExecutionError as e:
        upgrade_result = ast.literal_eval(e.message)
    except NxosError as e:
        if re.search('Code: 500', e.message):
            upgrade_result = e.message
        else:
            upgrade_result = ast.literal_eval(e.message)
    return _parse_upgrade_data(upgrade_result)
289705
def yum_update(self, allow_reboot=False):
        
        self.run('yum clean all')
        self.run('test -f /usr/bin/subscription-manager && subscription-manager repos --list-enabled',
                 ignore_error=True)
        self.run('yum repolist')
        self.run('yum update -y --quiet', retry=3)
        # reboot if a new initrd has been generated since the boot
        if allow_reboot:
            self.run('grubby --set-default $(ls /boot/vmlinuz-*.x86_64|tail -1)')
            default_kernel = self.run('grubby --default-kernel')[0].rstrip()
            cur_kernel = self.run('uname -r')[0].rstrip()
            if cur_kernel not in default_kernel:
                self.run('reboot', ignore_error=True)
            self.ssh_pool.stop_all()