Run Publication Subscription Command Line API
Use the Data Integration Hub Run Publication Subscription command line API to start the running of a specific publication and of a specific subscription from a command line utility. The API is available on Windows and UNIX operating systems.
You can run the Run Publication Subscription command line API from the Data Integration Hub server.
Tip: Use the Run Publication Subscription REST API to start the running of publications and subscriptions from a remote server.
The Run Publication Subscription API returns the response code of the action that you perform. If the publication or subscription runs successfully, the API returns the event ID of the publication or the subscription event that Data Integration Hub generates. You can run the Data Integration Hub Event Status API to query the status of the publication or subscription event.
To run a publication or a subscription from the API, you must use a Data Integration Hub user with permissions and privileges for the publication or for the subscription that you want to run. For more information, see the Data Integration Hub Administrator Guide.
Data Integration Hub Run Publication Subscription Command Line API Command Syntax
The Data Integration Hub Run Publication Subscription command line API uses the following syntax:
runsubscriptionpublication
<-c|--command> publication|subscription
<-n|--name> name
<-u|--user> user
<-p|--password> password
[-r|--preprocess]
[-f|--file "<parameters file path>"]
[-v|--parameter "<key>=<value>"...]
[--server "<hostname:port>"]
Note: When you run a publication or a subscription with both the --file and the --parameter options, Data Integration Hub orders the parameters according to the following sequence:
- 1. Parameters defined in the workflow-specific section of the parameters file that you specify in --file.
- 2. Parameters that you define in --parameter.
- 3. Parameters defined in the Global section of the parameters file that you specify in --file.
The command line API is in the following location: <DIHInstallationDir>/dx-tools
The following table describes the Data Integration Hub Run Publication Subscription command line API options and arguments:
Option | Argument | Description |
---|
-c --command | command | Required. Command to run the publication or to run the subscription. Enter one of following commands: - - publication. Instructs Data Integration Hub to trigger the publication workflow for the publication that you define in the --name option.
- - subscription. Instructs Data Integration Hub to trigger the subscription workflow for the subscription that you define in the --name option.
|
-n --name | name | Required. Name of the publication to run or of the subscription to run. Data Integration Hub verifies the permissions and privileges to run the publication or the subscription against this user. |
-u --user | user name | Optional. User name of an Operation Console user account with the Manage Data privileges to run the runsubscriptionpublication command. To run a subscription or a publication with the command, the user account must have run subscription or run publication privileges. If you use Informatica domain authentication or Informatica domain with Kerberos authentication, the user name must specify the Informatica security domain, separated by the @ symbol. For example: Administrator@SecurityDomain |
-U | Environment variable | Optional. Environment variable that contains a user name. User name of an Operation Console user account with the Manage Data privileges to run the runsubscriptionpublication command. To run a subscription or a publication with the command, the user account must have run subscription or run publication privileges. If you use Informatica domain authentication or Informatica domain with Kerberos authentication, the user name must specify the Informatica security domain, separated by the @ symbol. For example: Administrator@SecurityDomain Note: You must specify at least one of the user name options, -u or -U. |
-p --password | password | Optional. Password for the Operation Console user that runs the runsubscriptionpublication command. |
-P | Environment variable | Optional. Environment variable that contains the a password. Password for the Operation Console user that runs the runsubscriptionpublication command. The password must be encrypted. Use dxencrypt for the encrypted value. Note: You must specify at least one of the password options, -p or -P. |
-r --preprocess | - | Optional for the publication command. For publications where a pre-process is defined, this command runs the pre-process. |
-f --file | parameters_file_path | Optional. A path to a workflow parameter file. Data Integration Hub uses the content of the file as the content of the workflow parameter file. |
-v --parameter | <key>=<value> | Optional. A key-value pair pass as a custom workflow parameter: - - When the API runs a publication, Data Integration Hub passes the parameter to the publication workflow.
- - When the API runs a publication pre-process, using the --preprocess option, Data Integration Hub passes the parameter to the pre-process workflow.
- - When the API runs a subscription, Data Integration Hub passes the parameter to the subscription workflow.
You can enter multiple parameters. For example: -c subscription -v "employee_ID=148" -v "department=sales" Note: The parameter or parameters must be defined for the workflow of the entity that the API runs. Data Integration Hub does not pass undefined parameters to PowerCenter, and does not display an error. |
--server | hostname:port | Optional. Host name and port number of the Data Integration Hub server. If you do not enter a value, the Run Publication Subscription API connects to the localhost server with the default port 18095. You must enclose the value in quotation marks. For example: -c subscription --server "localhost:18096" |
Run Publication Subscription Command Line API Notifications
When you use the Data Integration Hub command line API to start the running of a publication or of a subscription, Data Integration Hub notifies you whether the command has succeeded or not.
If the command succeeds, the notification includes the event ID of the publication or the subscription event that Data Integration Hub generates.
If the command fails, the notification includes an error message with the cause of the failure. A failure can be caused by one of the following reasons:
- •The publication or the subscription is disabled.
- •Publication in process. Applicable to relational database publications only. Data Integration Hub cannot run the publication because the publication is currently running.
- •No publications to consume. Applicable to subscriptions only. Data Integration Hub did not run the subscription because no publications are ready for consumption by the subscription.