Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
NewbieQlik
Contributor III
Contributor III

patch_endpoint API to update Replicate Oracle source end point attribute

Hi

I have created an AWS lambda function to update source oracle endpoint attribute archivedLogDestId using python. 

my payload to patch_endpoint is [{"op":"replace","path":"/db_settings/archivedLogDestId","value":str(taskdet['oracledestid'])}] along with that I am passing replicate server name and endpoint name. When I tried to run the lambda I am getting "errorMessage": "'AemClient' object has no attribute 'patch_endpoint'"

I am able use EM API's to get server details , task details and archivedLogDestId (existing value using export_task) from the task, but for some reason patch_endpoint is not working. Any help on this topic is greatly appriciated

7 Replies
sureshkumar
Support
Support

Hello @NewbieQlik 

Any specific error you're getting while executing PatchEndpoint. kindly share us the curl command you're trying to execute.

 

Regards,

Suresh

NewbieQlik
Contributor III
Contributor III
Author

I am getting this error "errorMessage": "'AemClient' object has no attribute 'patch_endpoint'". I am not using curl I am trying patch_endpoint from lambda using python.

This is what I am trying

aem_program.aem_client.patch_endpoint([{"op":"replace","path":"/db_settings/archivedLogDestId","value":str(taskdet['oracledestid'])}], servername, str(taskdet['endpointname']))

SushilKumar
Support
Support

Hello @NewbieQlik 

Request you to please elaborate PATCH endpoint in the context to get info around it.

Regards,

Sushil Kumar

NewbieQlik
Contributor III
Contributor III
Author

I figured out the issue, the reason why I am getting this error is because the aem_client.py that I am using in my lambda does not have patch_endpoint method in it. So I got a newer version of aem_client.py (May 2022 version) and used it in my lambda.

After the change I am getting a different error which is due to the json path. Please see the error below

"errorMessage": "('AEM_PATCH_ENDPOINT_INNER_ERR', 'Failed to patch replication endpoint \"<endpointname>\" from server \"<servername>\". Error \"SYS-E-HTTPFAIL, Failed to apply json-patch.\", Detailed error: \"SYS,GENERAL_EXCEPTION,Failed to apply json-patch,Failed to parse json; Failed to apply json patch\".')",

I am trying to update oracle source end point attribute archivedLogDestId and the json path for that is 

['cmd.replication_definition']['databases'][0]['db_settings']['archivedLogDestId'] and the payload path that I am sending in my patch_endpoint function is

payload = [{"op":"replace","path":"/cmd.replication_definition/databases/db_settings/archivedLogDestId/","value":str(taskdet['endpointname'])}]

 

 

Shai_E
Support
Support

Hi @NewbieQlik 

Two things that i noticed:

1. path property, going by the documentation the path should be in the following format

/db_settings/endpoint-setting

See the following user guide section

PatchEndpoint | Qlik Enterprise Manager Help

 

2. I see that the request body needs to be sent as a JSON file

 

Best Regards

DesmondWOO
Support
Support

Hi @NewbieQlik ,

The link you provided is for REST API. Could you verify this link for the patch_endpoint in the Python API

For the payload parameter, it mentions that

"The operation to execute and the field on which to execute the operation (sent as a JSON file)."

If you discover any inaccuracies in the documentation, please submit a support ticket. We will address the issue as promptly as possible.


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!
NewbieQlik
Contributor III
Contributor III
Author

This issue is resolved. This is the correct way to pass the payload the json path.

payload = '[{"op":"replace","path":"/db_settings/archivedLogDestId","value":' + str(taskdet['oracledestid']) +'}]'