Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
UPGRADE ADVISORY for Qlik Replicate 2024.5: Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
feal
Creator
Creator

REST API command to modify ASM string on a Oracle Endpoint

Hello

 

i looked at QLIK Enterprise manager REST API documentation and i found there is a command to stop end start resume processing for a  Qlik CDC task 

StopTask | Qlik Enterprise Manager Help

StopTask | Qlik Enterprise Manager Help

Is it possible to perform a change of ASM string connection of a ORACLE Source Endpoint or or manual GUI operation is the only way to perform it?
Server list changes very seldom ,so we can afford to have two fixed list to use accordlingly when a switchover may occurr.
I looked at available REST API command but i found no "UpdateEndpoint" or similar command useful for our scenario.

Can you tell me if there is a command to perform that ?

Let me know

Best regards

AF

Labels (1)
3 Solutions

Accepted Solutions
DesmondWOO
Support
Support

Hi @feal ,

I've conducted following test:

1. Export a task to a JSON file.
2. Update the hostname for 'server' setting.
3. Save it and import it back to repository.
4. Other tasks which use the same endpoint are updated as well.

So, tasks associated with the modified endpoint should be stopped. Other tasks can be kept running.

Regards,
Desmond

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!

View solution in original post

DesmondWOO
Support
Support

Hi @feal ,

At Step 1, I performed "export with task". I've tried "export with Endpoint" also, it works fine.

At Step 4, after import from the modified JSON, I could test connection successfully without typing password again.

Regarding "resume processing", if both ASM environments are same in terms of SCN, redo log sequence etc., it should be fine. I recommend testing it in your test environment. 

Regards,
Desmond

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!

View solution in original post

DesmondWOO
Support
Support

Hi @feal ,

Regarding the PatchEndpoint API, you can replace asm_server entry only. Let's say you want to change the ASM entry to 'QlikServer'.

1. Open a Notepad, enter following information.

[
{ "op":"replace", "path":"/db_settings/asm_server", "value":"QlikServer" }
]

2. Save the file e.g. patchasm.json.

3. Execute a curl command. For example,
curl -i -k -X PATCH --header "EnterpriseManager.APISessionID: bWbkjcwyolnkmTHLpOvOLw" https://your_qem_server/attunityenterprisemanager/api/v1/servers/your_server/endpoints/your_endpoint... -T "C:\Tmp\patchasm.json"

Regards,
Desmond

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!

View solution in original post

9 Replies
Heinvandenheuvel
Specialist III
Specialist III

You have to use EXPORT and IMPORT to update task or endpoint characteristics.

Export ALL will give a starting point, and you could just maintain 2 of those for import.

If you just need to update a (few) endpoint(s) I would recommend to trim down the export all and remove everything (TASKS, SCHEDULER, NOTIFICATIONS...) except DATABASES and the path to that.

Removed all endpoints not needed. Save twice each with the configuration needed.

When needed, just import the appropriate reduced JSON with the just the desired databases endpoint(s) 

Hein.

feal
Creator
Creator
Author

Hello Hein

 

just to clarify :

The procedure could be

- export_all to a JSON file

- trim down the export all and remove all Endpoint not needed and leave only Endtpoint that need to be modified 

 trim down the export all JSON flat file and remove everything (TASKS, SCHEDULER, NOTIFICATIONS...) except DATABASES of Impacted Endpoint and save the version with "asm-server"  string with reference 1 and generate the JSON file "reduced_1"

- trim down the export all JSON flat file and remove everything (TASKS, SCHEDULER, NOTIFICATIONS...) except DATABASES of Impacted Endpoint and save the version with "asm-server"  string with reference 2 and generate the JSON file "reduced_2"

- import task or import_all  (?) rom JSON file "reduced_1" or JSON file "reduced_2" when needed , correct ?

Has this operation  some impact on tasks ? Must I to stop/start only task  impacted by modified endpoints ? Other task can run without issue during import_all ? 

Let me know 

Regards 

 

 

DesmondWOO
Support
Support

Hi @feal ,

I've conducted following test:

1. Export a task to a JSON file.
2. Update the hostname for 'server' setting.
3. Save it and import it back to repository.
4. Other tasks which use the same endpoint are updated as well.

So, tasks associated with the modified endpoint should be stopped. Other tasks can be kept running.

Regards,
Desmond

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
DesmondWOO
Support
Support

Hi @feal ,

Regarding REST API, you can use PatchEndpoint to update the connection setting. Please find this link: PatchEndpoint for details.

Regards,
Desmond

 

 

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
feal
Creator
Creator
Author

Hello Desmond

just for confirmation . you performed "export with Endopints"  at step 1) , correct ?

If i perform step 4 Import form the modified JSON , are there any issues linked to password on the Sourc Endpoint ?

Is it possible to restart the task stopped with resume processing so not loosing work between stop/start ? 

 

Let me know

regards

AF

Best regards

feal
Creator
Creator
Author

Hi Desmond

i looked at PatchEndpoint .

It seems very useful : it is possible to replace only the string of ASM entry ("asm_server" in the database part) in a desired way ?

/db_settings/asm_server='<string_i_want>

I notice that the task has to be stopped/restarted in order to get the desiderd modification but it seems OK for me 

DesmondWOO
Support
Support

Hi @feal ,

At Step 1, I performed "export with task". I've tried "export with Endpoint" also, it works fine.

At Step 4, after import from the modified JSON, I could test connection successfully without typing password again.

Regarding "resume processing", if both ASM environments are same in terms of SCN, redo log sequence etc., it should be fine. I recommend testing it in your test environment. 

Regards,
Desmond

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
DesmondWOO
Support
Support

Hi @feal ,

Regarding the PatchEndpoint API, you can replace asm_server entry only. Let's say you want to change the ASM entry to 'QlikServer'.

1. Open a Notepad, enter following information.

[
{ "op":"replace", "path":"/db_settings/asm_server", "value":"QlikServer" }
]

2. Save the file e.g. patchasm.json.

3. Execute a curl command. For example,
curl -i -k -X PATCH --header "EnterpriseManager.APISessionID: bWbkjcwyolnkmTHLpOvOLw" https://your_qem_server/attunityenterprisemanager/api/v1/servers/your_server/endpoints/your_endpoint... -T "C:\Tmp\patchasm.json"

Regards,
Desmond

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
Heinvandenheuvel
Specialist III
Specialist III

@feal  - yes. Create two versions. Of course you would create version 2 from the already 'trimmed down' version 1 to avoid mistakes.

I just used Export-all and a smart JSON aware editor like Notepad++. You can also just export any task which has the source endpoint needed. Same result. I use import-all because it feels more appropriate but you can use either best I recall.

End-point definitions are only read on task startup, so a stop + start is needed to make it take. Simple Resume is encouraged for cdc data integrity.

I conveniently forgot about patch_endpoint. It is a recent API addition. Besides the irrelevant fact that I do not like the name I find it relatively hard to understand. Simple JSON seems easier to me, but as an API the patch_endpoint has good potential. (https://[host]/attunityenterprisemanager/api/v1/servers/[server]/endpoints/[endpoint])

@DesmondWOO  - Yes you can just use a task export/edit/import. I _much_ prefer to trim it down to database only to avoid accidently reloading a stale task definition when what I wanted was to change an endpoint attribute.

In fact, if I was responsible for a Replicate solution, I would insist on my source management system to have clean trimmed down distinct json files for: servers, task, databases. My saved task sources would NOT have database sections. My databases would not have tasks as well. For some dev/qa/prod environment with dedicated dev/qa/prod servers that _could_ mean that a task source does not have to be changed as all to promote them to prod - The endpoint on the prod server will be already be pointing to the prod db(s).  On the other hand is is clear/safe to have the environment in the source endpoint name for example "SRC_HR_ORA_DEV"

Hein.