Start of change

RESTSERVICEDEFAULT bind option

The RESTSERVICEDEFAULT bind option determines whether the specified REST service package version identified by the PACKAGE option will be modified to be the default service version for the service.

This option can only be used when rebinding a local REST service package and is invalid when used for any other package type.

Command option Option values Used with
RESTSERVICEDEFAULT
  • (YES)
Note:
  1. The RESTSERVICEDEFAULT bind option is only valid for REBIND of packages for native REST services.

Option descriptions for RESTSERVICEDEFAULT

RESTSERVICEDEFAULT(YES)
Specifies that the REST service package version identified by the PACKAGE option will be modified to become the active REST service default service version. This option value can only be used when rebinding a versioned REST service package on the local Db2 system. The REST service package being rebound, as specified by the PACKAGE bind option, must specify a valid, non-empty string version-id. Additionally, the RESTSERVICEDEFAULT option can only be used to modify a REST service package on the local Db2 subsystem. If a location-name is specified in the PACKAGE bind option, the location-name must be the location name of the local Db2 system. If the RESTSERVICEDEFAULT bind option is specified and the package being rebound is not a local, versioned REST service package, Db2 will issue an error message.

Usage notes for RESTSERVICEDEFAULT

The RESTSERVICEDEFAULT option is not allowed when using an asterisk (*) wildcarding for any portion of the package name values used in the PACKAGE option.

There is no validation of the REST service compatibility when changing the default service versioning. The Db2 REST service versioning support allows each version of a REST service to be created using a different SQL statement with different input and output parameters and different bind options. This means that your REST client applications may require code changes to be compatible with a new default version of a REST service. Db2 does not check or validate REST service version compatibility when changing the default service version. It is recommended that you compare the JSON request and response schemas between the current and new default REST service version to determine if there are any incompatible differences before changing the default service version of a REST service. The REST service discover API can be used to obtain the REST service JSON request and response schemas for review. You should also review any REST client applications that are useing the default service version URI (/services/<collection id>/<service name>) to ensure that they are compatible before changing the default service version of a REST service.

Examples for RESTSERVICEDEFAULT

  • Rebind the existing local REST service package MyServices.createCustomer.(v2) to be the default service version for the MyServices.createCustomer REST service.

    REBIND PACKAGE("MyServices"."createCustomer".(v2)) RESTSERVICEDEFAULT (YES)
  • Rebind the existing local REST service package payroll.getEmployee.(v3), which is located at the local location STLEC1, to be the default service version for the payroll.getEmployee REST service.

    REBIND PACKAGE(STLEC1."payroll"."getEmployee".(v3)) RESTSERVICEDEFAULT (YES)

Default values for RESTSERVICEDEFAULT

Process Default value
REBIND Package None (No change to the REST service default service version)

Catalog records for RESTSERVICEDEFAULT

See the ISDEFAULT column in Db2 REST services table (SYSIBM.DSNSERVICE).

End of change