Publishing an Optim request as a service to a registry

Use the publisher to generate a service from a specified request and publish the service to a registry. After a request is published to a registry, you can access the manager on an application server and use the manager to run the request. Requests can be published individually, or multiple requests can be published at a time by using a text file that contains a list of the requests.

You must install the publisher on a computer that meets the following conditions:
  • The computer must be either an Optim™ workstation or an Optim server.
  • The computer must be able to access the Optim Directory that contains the requests that you want to publish.

You must also configure each proxy that is used to run the services so that the proxy can access the Optim Directory that contains the requests. When the service is run, the proxy reads the request in the Optim Directory and uses the request settings to run the service. For example, the proxy uses the local access definition and table map from the Optim Directory. The request settings cannot be changed in the manager.

To publish many requests at a time, create a text file that contains a list of the requests. Each request must be on its own line of the text file. All requests in the file must be of the same request type.

To publish an Optim request as a service to a registry, run the appropriate servicePublisher script on your computer. The servicePublisher scripts are located in the installation directory that you specified for the Optim Service Publisher installation package. The following diagram illustrates the syntax of the servicePublisher scripts.
Read syntax diagramSkip visual syntax diagram
>>-+-servicePublisher.bat-+--+- --reqtype-+-+-archive-+--------->
   '-servicePublisher.sh--'  '- --t-------' +-a-------+   
                                            +-extract-+   
                                            +-e-------+   
                                            +-insert--+   
                                            +-i-------+   
                                            +-load----+   
                                            +-l-------+   
                                            +-restore-+   
                                            +-r-------+   
                                            +-delete--+   
                                            +-d-------+   
                                            +-convert-+   
                                            '-c-------'   

>--+-+- --reqname-+-REQUEST.NAME-------+------------------------>
   | '- --n-------'                    |   
   '-+- --file-+-request_list_file.txt-'   
     '- --f----'                           

>--+- --registry-+-registry_url--------------------------------->
   '- --r--------'                

>--+---------------------------------+-------------------------->
   '-+- --platform-+-+-distributed-+-'   
     '- --p--------' '-d-----------'     

>--+-------------------------------------+---------------------->
   '-+- --server-+---optim_server_name---'   
     '- --s------'                           

>--+-------------------------------------------+---------------><
   '-+- --directory-+---optim_directory_name---'   
     '- --d---------'                              

The servicePublisher script accepts the following parameters.
--reqtype or --r
The --reqtype parameter defines the request type of the requests to be published. If you publish requests by using a request list file, all requests in the file must be of the same request type.
Mandatory
Yes
Valid values
  • archive or a
  • extract or e
  • insert or i
  • load or l
  • restore or r
  • delete or d
  • convert or c
Default value
None
Case sensitive
No
--reqname or --n
The --reqname parameter defines the name of the request as it exists in the Optim Directory. The --reqname parameter allows for a user to publish one service request from the command line.
Mandatory
Either --reqname or --file must be specified, but both cannot be specified
Valid values
Any valid request defined in the Optim Directory (no validation is performed)
Example
OPTDMO.HRDATA
Default value
None
Case sensitive
No
--file or --f
The --file parameter defines a file that contains a series of request names as they exist in the Optim Directory. The request names are separated by a carriage return and line feed. The --file parameter allows for a user to publish multiple service requests of the same type from the command line.
Mandatory
Either --reqname or --file must be specified, but both cannot be specified
Valid values
Any valid file containing requests defined in the Optim Directory (no validation is performed)
Example
C:\requests\extractRequests.txt
Default value
None
Case sensitive
Yes
--registry or --r
The --registry parameter defines the location of the registry to which the service request is published.
Mandatory
Yes
Valid values
Any valid registry location (no validation is performed)
Example
http://mgmtserverhostname:8080/server/registry
Default value
None
Case sensitive
No
--platform or --p
The --platform parameter defines the service execution component of the request.
Mandatory
No
Valid values
distributed or d
Default value
distributed
Case sensitive
No
--server or --s
The --server parameter defines the name of the Optim server that is to be used by each service request. When the publisher creates a service for a request, the publisher uses this Optim server in the service plan. The server in this parameter must be a valid server on the proxy that is used to run the services. If no value is specified, then the service is set to use the default Optim server for the proxy on which the service is run.
Mandatory
No
Valid values
Any valid server on the proxy (no validation is performed)
Default value
None
Case sensitive
No
--directory or --d
The --directory parameter defines the Optim Directory that is to be used by each service request. When the publisher creates a service for a request, the publisher uses this Optim Directory in the service plan. If no value is specified, then the service is set to use the default Optim Directory for the proxy on which the service is run.
Mandatory
No
Valid values
Any valid Optim Directory on the proxy (no validation is performed)
Default value
None
Case sensitive
No
When you enter the following command on a single line on a Windows computer, the publisher creates services that are based on the extract request in the C:\requests\extractRequests.txt file. The services are published to the registry http://mgmtsserverhostname:8080/server/registry.
servicePublisher.bat --p distributed --t extract --r http://mgmtsserverhostname:8080/server/registry 
--f C:\requests\extractRequests.txt
When you enter the following command on a single line on a Linux computer, the publisher creates a service that is based on the extract request EXT.MYEXTRACT. The service is published to the registry http://mgmtsserverhostname:8080/server/registry.
servicePublisher.sh --p distributed --t extract --r http://mgmtserverhostname:8080/server/registry 
--n EXT.MYEXTRACT