<pre>
Use this operation to upgrade NetScaler.
</pre>
352341
public static ns_upgrade upgrade(nitro_service client, ns_upgrade resource) throws Exception
	{
		return ((ns_upgrade[]) resource.perform_operation(client, "upgrade"))[0];
	}
1146890
public static ns add(nitro_service client, ns resource) throws Exception
	{
		resource.validate("add");
		return ((ns[]) resource.perform_operation(client, "add"))[0];
	}
186895
@Override
    public void upgrade() {
        // All default rotation strategy settings.
        final MessageCountRotationStrategyConfig messageCountRotationStrategyConfig = clusterConfigService.get(MessageCountRotationStrategyConfig.class);
        final SizeBasedRotationStrategyConfig sizeBasedRotationStrategyConfig = clusterConfigService.get(SizeBasedRotationStrategyConfig.class);
        final TimeBasedRotationStrategyConfig timeBasedRotationStrategyConfig = clusterConfigService.get(TimeBasedRotationStrategyConfig.class);

        if (messageCountRotationStrategyConfig == null) {
            final MessageCountRotationStrategyConfig countConfig = MessageCountRotationStrategyConfig.create(elasticsearchConfiguration.getMaxDocsPerIndex());
            clusterConfigService.write(countConfig);
            LOG.info("Migrated \"{}\" setting: {}", "elasticsearch_max_docs_per_index", countConfig);
        }
        if (sizeBasedRotationStrategyConfig == null) {
            final SizeBasedRotationStrategyConfig sizeConfig = SizeBasedRotationStrategyConfig.create(elasticsearchConfiguration.getMaxSizePerIndex());
            clusterConfigService.write(sizeConfig);
            LOG.info("Migrated \"{}\" setting: {}", "elasticsearch_max_size_per_index", sizeConfig);
        }
        if (timeBasedRotationStrategyConfig == null) {
            final TimeBasedRotationStrategyConfig timeConfig = TimeBasedRotationStrategyConfig.create(elasticsearchConfiguration.getMaxTimePerIndex());
            clusterConfigService.write(timeConfig);
            LOG.info("Migrated \"{}\" setting: {}", "elasticsearch_max_time_per_index", timeConfig);
        }

        // All default retention strategy settings
        final ClosingRetentionStrategyConfig closingRetentionStrategyConfig = clusterConfigService.get(ClosingRetentionStrategyConfig.class);
        final DeletionRetentionStrategyConfig deletionRetentionStrategyConfig = clusterConfigService.get(DeletionRetentionStrategyConfig.class);

        if (closingRetentionStrategyConfig == null) {
            final ClosingRetentionStrategyConfig closingConfig = ClosingRetentionStrategyConfig.create(elasticsearchConfiguration.getMaxNumberOfIndices());
            clusterConfigService.write(closingConfig);
            LOG.info("Migrated \"{}\" setting: {}", "elasticsearch_max_number_of_indices", closingConfig);
        }

        if (deletionRetentionStrategyConfig == null) {
            final DeletionRetentionStrategyConfig deletionConfig = DeletionRetentionStrategyConfig.create(elasticsearchConfiguration.getMaxNumberOfIndices());
            clusterConfigService.write(deletionConfig);
            LOG.info("Migrated \"{}\" setting: {}", "elasticsearch_max_number_of_indices", deletionConfig);
        }

        // Selected rotation and retention strategies.
        final IndexManagementConfig indexManagementConfig = clusterConfigService.get(IndexManagementConfig.class);
        if (indexManagementConfig == null) {
            final Class<? extends RotationStrategy> rotationStrategyClass;
            switch (elasticsearchConfiguration.getRotationStrategy()) {
                case "size":
                    rotationStrategyClass = SizeBasedRotationStrategy.class;
                    break;
                case "time":
                    rotationStrategyClass = TimeBasedRotationStrategy.class;
                    break;
                case "count":
                    rotationStrategyClass = MessageCountRotationStrategy.class;
                    break;
                default:
                    LOG.warn("Unknown retention strategy \"{}\"", elasticsearchConfiguration.getRotationStrategy());
                    rotationStrategyClass = MessageCountRotationStrategy.class;
            }

            final Class<? extends RetentionStrategy> retentionStrategyClass;
            switch (elasticsearchConfiguration.getRetentionStrategy()) {
                case "close":
                    retentionStrategyClass = ClosingRetentionStrategy.class;
                    break;
                case "delete":
                    retentionStrategyClass = DeletionRetentionStrategy.class;
                    break;
                default:
                    LOG.warn("Unknown retention strategy \"{}\"", elasticsearchConfiguration.getRetentionStrategy());
                    retentionStrategyClass = DeletionRetentionStrategy.class;
            }

            final IndexManagementConfig config = IndexManagementConfig.create(
                    rotationStrategyClass.getCanonicalName(),
                    retentionStrategyClass.getCanonicalName());
            clusterConfigService.write(config);
            LOG.info("Migrated \"{}\" and \"{}\" setting: {}", "rotation_strategy", "retention_strategy", config);
        }

        final SearchesClusterConfig searchesClusterConfig = clusterConfigService.get(SearchesClusterConfig.class);
        if (searchesClusterConfig == null) {
            final SearchesClusterConfig config = SearchesClusterConfig.createDefault();
            LOG.info("Creating searches cluster config: {}", config);
            clusterConfigService.write(config);
        }
    }
1083738
public static base_response update(nitro_service client, snmpmanager resource) throws Exception {
		snmpmanager updateresource = new snmpmanager();
		updateresource.ipaddress = resource.ipaddress;
		updateresource.netmask = resource.netmask;
		updateresource.domainresolveretry = resource.domainresolveretry;
		return updateresource.update_resource(client);
	}
1301706
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]
733315
public static base_response update(nitro_service client, nat64 resource) throws Exception {
		nat64 updateresource = new nat64();
		updateresource.name = resource.name;
		updateresource.acl6name = resource.acl6name;
		updateresource.netprofile = resource.netprofile;
		return updateresource.update_resource(client);
	}
1013626
public static ntp_server add(nitro_service client, ntp_server resource) throws Exception
	{
		resource.validate("add");
		return ((ntp_server[]) resource.perform_operation(client, "add"))[0];
	}
460288
@Override
    public void run() {
        try {
            GrayUpgradeConfig grayUpgradeConf = (GrayUpgradeConfig) stormClusterState.get_gray_upgrade_conf(topologyId);

            // no upgrade request
            if (grayUpgradeConf == null) {
                LOG.debug("gray upgrade conf is null, skip...");
                return;
            }

            if (grayUpgradeConf.isCompleted() && !grayUpgradeConf.isRollback()) {
                LOG.debug("detected a complete upgrade, skip...");
                return;
            }

            if (grayUpgradeConf.isExpired() && !grayUpgradeConf.isRollback()) {
                LOG.info("detected an expired upgrade, completing...");
                // todo: should we check all task status?
                GrayUpgradeConfig.completeUpgrade(grayUpgradeConf);
                //stormClusterState.remove_gray_upgrade_info(topologyId);
                stormClusterState.set_gray_upgrade_conf(topologyId, grayUpgradeConf);
                stormClusterState.update_storm(topologyId, new StormStatus(StatusType.active));
                return;
            }

            // first time, set workers
            if (this.totalWorkers.size() == 0) {
                setTotalWorkers(tmContext);
            }

            // notify current upgrading workers to upgrade (again)
            Set<String> upgradingWorkers = Sets.newHashSet(stormClusterState.get_upgrading_workers(topologyId));
            if (upgradingWorkers.size() > 0) {
                LOG.info("Following workers are under upgrade:{}", upgradingWorkers);
                for (String worker : upgradingWorkers) {
                    notifyToUpgrade(worker);
                }
                return;
            }

            Set<String> upgradedWorkers = Sets.newHashSet(stormClusterState.get_upgraded_workers(topologyId));
            if (grayUpgradeConf.isRollback()) {
                LOG.info("Rollback has completed, removing upgrade info in zk and updating storm status...");
                // there's no way back after a rollback
                stormClusterState.remove_gray_upgrade_info(topologyId);
                stormClusterState.update_storm(topologyId, new StormStatus(StatusType.active));
                return;
            }

            if (isUpgradeCompleted(upgradedWorkers, totalWorkers)) {
                LOG.info("This upgraded has finished! Marking upgrade config as completed...");
                GrayUpgradeConfig.completeUpgrade(grayUpgradeConf);
                stormClusterState.set_gray_upgrade_conf(topologyId, grayUpgradeConf);
                //stormClusterState.remove_gray_upgrade_info(topologyId);
                stormClusterState.update_storm(topologyId, new StormStatus(StatusType.active));
                return;
            }

            // assign next batch of workers
            if (grayUpgradeConf.continueUpgrading()) {
                pickWorkersToUpgrade(grayUpgradeConf, upgradedWorkers);
            }

            // pause upgrading
            grayUpgradeConf.setContinueUpgrade(false);
            stormClusterState.set_gray_upgrade_conf(topologyId, grayUpgradeConf);
        } catch (Exception ex) {
            LOG.error("Failed to get upgrade config from zk, will abort this upgrade...", ex);
            recover();
        }
    }
1308516
public static base_response update(nitro_service client, nsip resource) throws Exception {
		nsip updateresource = new nsip();
		updateresource.ipaddress = resource.ipaddress;
		updateresource.td = resource.td;
		updateresource.netmask = resource.netmask;
		updateresource.arp = resource.arp;
		updateresource.icmp = resource.icmp;
		updateresource.vserver = resource.vserver;
		updateresource.telnet = resource.telnet;
		updateresource.ftp = resource.ftp;
		updateresource.gui = resource.gui;
		updateresource.ssh = resource.ssh;
		updateresource.snmp = resource.snmp;
		updateresource.mgmtaccess = resource.mgmtaccess;
		updateresource.restrictaccess = resource.restrictaccess;
		updateresource.dynamicrouting = resource.dynamicrouting;
		updateresource.ospf = resource.ospf;
		updateresource.bgp = resource.bgp;
		updateresource.rip = resource.rip;
		updateresource.hostroute = resource.hostroute;
		updateresource.hostrtgw = resource.hostrtgw;
		updateresource.metric = resource.metric;
		updateresource.vserverrhilevel = resource.vserverrhilevel;
		updateresource.ospflsatype = resource.ospflsatype;
		updateresource.ospfarea = resource.ospfarea;
		updateresource.vrid = resource.vrid;
		updateresource.icmpresponse = resource.icmpresponse;
		updateresource.arpresponse = resource.arpresponse;
		return updateresource.update_resource(client);
	}
763782
private <T,S> void upgradeWebSocket(ServiceWebSocket<T,S> service)
  {
    /*
    try {
      _service.open((WebRequest) request);
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
    }
    */
    TypeRef type = TypeRef.of(service.getClass()).to(ServiceWebSocket.class).param(0);

    ServiceRef selfRef = ServiceRef.current();

    service = selfRef.pin(service).as(ServiceWebSocket.class);

    Class<T> rawClass = (Class) type.rawClass();

    WebSocketBaratineImpl<T,S> ws
      = new WebSocketBaratineImpl<>(webApp().wsManager(),
                                    service, rawClass);

    try {
      if (! ws.handshake(this)) {
        throw new ServiceException("WebSocket handshake failed for " + this);
      }
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
      e.printStackTrace();

      fail(e);
    }
    //request.flush();
  }
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')
    )
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"));
	}
980005
def upgrade():
    """"""
    op.create_table(
        'transaction',
        sa.Column('issued_at', sa.DateTime(), nullable=True),
        sa.Column('id', sa.BigInteger(), nullable=False),
        sa.Column('remote_addr', sa.String(length=50), nullable=True),
    )
    op.create_primary_key('pk_transaction', 'transaction', ['id'])
    if op._proxy.migration_context.dialect.supports_sequences:
        op.execute(CreateSequence(Sequence('transaction_id_seq')))
557624
@RequirePOST
    public void doUpgrade(StaplerResponse rsp) throws IOException, ServletException {
        HudsonUpgradeJob job = new HudsonUpgradeJob(getCoreSource(), Jenkins.getAuthentication());
        if(!Lifecycle.get().canRewriteHudsonWar()) {
            sendError("Jenkins upgrade not supported in this running mode");
            return;
        }

        LOGGER.info("Scheduling the core upgrade");
        addJob(job);
        rsp.sendRedirect2(".");
    }
157568
public static ntp_server update(nitro_service client, ntp_server resource) throws Exception
	{
		resource.validate("modify");
		return ((ntp_server[]) resource.update_resource(client))[0];
	}
583584
@Help(help = "Upgrades a VNFR to a defined VNFD in a running NSR with specific id")
  public void upgradeVnfr(final String idNsr, final String idVnfr, final String idVnfd)
      throws SDKException {
    HashMap<String, Serializable> jsonBody = new HashMap<>();
    jsonBody.put("vnfdId", idVnfd);
    String url = idNsr + "/vnfrecords" + "/" + idVnfr + "/upgrade";
    requestPost(url, jsonBody);
  }
760846
public static base_response update(nitro_service client, csparameter resource) throws Exception {
		csparameter updateresource = new csparameter();
		updateresource.stateupdate = resource.stateupdate;
		return updateresource.update_resource(client);
	}