Question
I want to use a REST API job with multiple profiles.
We have production and development profiles, and they have different settings of connector and variable for DB connection.
I want to change only <profile name> in the following URL and run the job.
https://<domain name >.square.hulft.com/<profile name >/<base path >/<resource path >
Answer
It is possible to use REST API jobs with multiple profiles by following method below.
Procedure
*Assumption: API client has already been created.
- Create an API project for each profile
The endpoint of a REST API job is different for each profile, and since one API project cannot link with multiple REST API jobs, it is necessary to create API projects as many as profiles.
- Create a REST API job for each profile
Create a job for each profile, for the same reason as step1.
- Create environment variables for profiles and base paths
From DATA INTEGRATION >Variables, create environment variables to dynamically specify profile and base path of the same URL.
You can set values for each profile within one environment variable.
- Create a connection resource for REST connection
Specify multiple profiles and URLs that includes environment variables.
Example: https://<domain name>/%{ forProfile }/%{ forBasePath }
- Issue an HTTP request
By specifying a profile and issuing an HTTP request to the URL specified in step 4, you can switch the profiles to be referenced by the script.
Please refer to the following tutorial for detailed setting values for each item.
Execute a script using an HTTP REST request
https://www.hulft.com/help/en-us/HULFTSquare/Content/TOP/Tutorial/tutorial_job_HTTPREST.htm
Supplementation
If a resource path is required, create a connection resource for each profile and specify the path in environment variables for each profile.
As with environment variables, you can configure connection settings for each profile in a single connection resource.
Comments
0 comments
Article is closed for comments.