IBM i NetServer is normally administered through the user interface provided in iSeries Navigator. However, you can also access the administration functions by calling the IBM i NetServer APIs. This page contains brief reference information to get you started. You may also visit the Information Center for complete API documentation in order to build your own administration interface.
Note: Starting in V5R2, you have the option of installing a green screen command menu of IBM i NetServer function. Click here for details.
Following is a partial list of the APIs available for administration of the IBM i NetServer. They do not include the latest parameter options, however, they demonstrate the use for all the required parameters. The error code structure is always the last parameter and in these examples x'00000000' is being used instead of the actual structure. For more information about the error code structure reference the iSeries System API guide, SC41-4801-00.
Note: Server configuration changes will take place the next time IBM i NetServer is started. All share addition, changes and removal, will take place immediately.
Start/Stop IBM i NetServer
CALL QZLSSTRS PARM('0' x'00000000')
Start IBM i NetServer. See the QZLSSERVER job under the QSERVER subsystem. The QZLSSERVER is automatically started every time the QSERVER subsystem is started.
Parameters:
- '0' - Reset (0 indicated no reset)
- x'00000000' - used in lieu of error code structure
CALL QZLSENDS PARM(x'00000000')
End IBM i NetServer.
Parameters:
- x'00000000' - used in lieu of error code structure
Add/change a file share
CALL QZLSADFS PARM(MYSHARE '/Data' x'00000005' x'00000000' 'My shared data folder' x'00000001' x'ffffffff' x'00000000') CALL QZLSCHFS PARM(MYSHARE '/Data' x'00000005' x'00000000' 'My shared data folder' x'00000002' x'ffffffff' x'00000000')
The first command adds the file share MYSHARE, which shares the /Data folder read-only. The second command changes the file share properties to be read-write.
Parameters:
- MYSHARE - share name
- '/Data' - path name
- x'00000005' - length of path name
- x'00000000' - CCSID encoding of path name (0 indicates same as job)
- 'My shared data folder' - text description
- x'00000002' - permissions (2 indicates r/w, 1 is read-only)
- x'ffffffff' - maximum users (-1 indicates no max)
- x'00000000' - used in lieu of error code structure
Add/change a printer share
CALL QZLSADPS PARM(LASEROQ 'QPRINT QGPL ' 'Default iSeries outq' x'00000001' 'IBM 4039 LaserPrinter' x'00000000') CALL QZLSCHPS PARM(LASEROQ 'QPRINT QGPL ' 'LASEROQ iSeries outq' x'00000001' 'IBM 4039 LaserPrinter' x'00000000')
Add or change a print server share. Takes effect immediately.
Parameters:
- LASEROQ - share name
- 'QPRINT QGPL ' - qualified output queue (10 spaces needed for queue, and 10 for library)
- 'Default iSeries outq' - text description (changed in the QZLSCHPS call)
- x'0000001' - spool file type (1 indicates *USERASCII, 2 *AFP, 3 *SCS)
- 'IBM 4039 LaserPrinter' - print driver type (indentifes appropriate print driver for share)
- x'00000000' - used in lieu of error code structure
Remove share
CALL QZLSRMS PARM(MYSHARE x'00000000')
Remove a server share. Takes effect immediately.
Parameters:
- MYSHARE - share name
- x'00000000' - used in lieu of error code structure
Change Guest
CALL QZLSCHSG PARM(NETGUEST x'00000000')
Change server guest profile. The initial configuration is to disallow guest users from accessing shares. Note: The requested changes will take place the next time IBM i NetServer is started.
- NETGUEST - name of guest user profile
- x'00000000' - used in lieu of error code structure
Change server information
CALL QZLSCHSI PARM(RequestVar x'00000112' ZLSS0100 x'00000000')
Change IBM i NetServer information/properties.
Parameters:
- RequestVar - variable holding input data structure
- x'00000112' - length of variable data
- ZLSS0100 - format requested for change (ZLSS0100 indicates server information)
- x'00000000' - used in lieu of error code structure
Change server name
CALL QZLSCHSN PARM(AWESERVE SMBMANIA 'demo server' x'00000000')
Change server name. Note: The requested changes will take place the next time IBM i NetServer is started.
Parameters:
- AWESERVE - server name
- SMBMANIA - domain name
- 'demo server' - text description
- x'00000000' - used in lieu of error code structure
List server information
CALL QUSCRTUS PARM('OUTDATA QGPL '
PF 2048 X'00' *ALL 'API output space')
CALL QZLSLSTI PARM('OUTDATA QGPL '
ZLSL0100 *ALL x'00000000')
DSPF STMF('/qsys.lib/qgpl.lib/outdata.usrspc')
List server information. Data is dumped to a user space. A program could be written to interpret the data.
QUSCRTUS Parameters:
- 'OUTDATA QGPL ' - name of user space to create (10 spaces needed for space name, 10 for library)
- PF - extended attribute (PF = physical file)
- 2048 - initial size for user space
- X'00' - initial value to clear user space with
- *ALL - public authority
- 'API output space' - text description
QZLSLSTI Parameters:
- 'OUTDATA QGPL ' - name of user space to receive information (10 spaces needed for space name, 10 for library)
- ZLSL0100 - format of data requested
- ZLSL0100 - Share information
- ZLSL0200 - dump configuration information
- ZLSL0300 - Session information
- *ALL - information qualifier
- x'00000000' - used in lieu of error code structure
DSPF Parameter:
- '/qsys.lib/qgpl.lib/outdata.usrspc' - stream file path name of the user space
End session
CALL QZLSENSS PARM(BUCKY x'00000000')
End server session(s) from workstation BUCKY.
Parameters:
- BUCKY - workstation name
- x'00000000' - used in lieu of error code structure
