Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
Please refer to
I tried below solution suggested in above post
curl -i -k -v -X POST --header "EnterpriseManager.APISessionID: PXGgboAmc9pjTUPyANj2gw" --header "Content-Type: application/json" https://test/attunityenterprisemanager/api/v1/servers/test?action=import -T c:\myrepsrv1.json
myrepsrv1.json
{"$type": "AemReplicateServer", "name": test", "description": "test", "host": "test", "port": "3552", "username": "admin", "password": "{{}}", "verify_server_certificate": false, "monitored": true}
but it gives me below error
{"error_code":"DESERIALIZE_TO_TYPE","error_message":"Failed to deserialize json to type ReplicationDefinitionExport: Type specified in JSON 'Attunity.AemDataModel.AemReplicateServer, AemDataModel, Version=2022.11.0.860, Culture=neutral, PublicKeyToken=null' is not compatible with 'Attunity.Replicate.Globals.ReplicationDefinitionExport, RepuiGlobals, Version=2022.11.0.860, Culture=neutral, PublicKeyToken=null'. Path '$type', line 1, position 30.."}*
Looks like it didnt like "AemReplicateServer"
Any idea?
The post action seems to be working and correctly reporting a problem with the provided JSON and tells you so:
"Failed to deserialize json to type ReplicationDefinitionExport: Type specified in JSON"
So what you are saying is that the POST action is working very well, but you cannot read.
Did I say that out loudly? That wasn't very nice. Sorry. Do you see what I mean though?
The JSON provided is for a server definition, a one-time action for which the "def" command should/can be used (or just use the GUI for this step!)
According to the API guide the ".../servers/{ServerName}?action=import" belongs to ImportAll which often is done over and over, and needs to be fed the output from an Export All (GUI or API or REPCTL) command: "All valid JSON definitions provided in the request body will be imported. This includes server settings,
task settings, endpoints, and other definitions. " -
This command should follow the PutServer command as it uses that server definition to find it by ServerName and then provide it the selected server the commands/information needed
Nit-picking: This post post title reads "Qlik replicate CURL POST not working". Well, replicate does NOT have a CURL POST interface. The Enterprise Manages does and is has a specific sub-forum which might be more appropriate, but admittedly gets far fewer (but more dedicated??) readers.
https://community.qlik.com/t5/Qlik-Enterprise-Manager/bd-p/qlik-enterprise-manager-discussions
Good luck!
Hein
I used GetServer followed by PutServer in same function definition(using same session) and it worked. Thanks for providing the clue
@RajneeshSharma Hi, I see you posted a few times, I released them please delete the duplicates and if you cannot send me links and I will delete. You can only delete if someone hasn't commented. Sorry about this.
Thanks. I deleted a duplicate.
The post action seems to be working and correctly reporting a problem with the provided JSON and tells you so:
"Failed to deserialize json to type ReplicationDefinitionExport: Type specified in JSON"
So what you are saying is that the POST action is working very well, but you cannot read.
Did I say that out loudly? That wasn't very nice. Sorry. Do you see what I mean though?
The JSON provided is for a server definition, a one-time action for which the "def" command should/can be used (or just use the GUI for this step!)
According to the API guide the ".../servers/{ServerName}?action=import" belongs to ImportAll which often is done over and over, and needs to be fed the output from an Export All (GUI or API or REPCTL) command: "All valid JSON definitions provided in the request body will be imported. This includes server settings,
task settings, endpoints, and other definitions. " -
This command should follow the PutServer command as it uses that server definition to find it by ServerName and then provide it the selected server the commands/information needed
Nit-picking: This post post title reads "Qlik replicate CURL POST not working". Well, replicate does NOT have a CURL POST interface. The Enterprise Manages does and is has a specific sub-forum which might be more appropriate, but admittedly gets far fewer (but more dedicated??) readers.
https://community.qlik.com/t5/Qlik-Enterprise-Manager/bd-p/qlik-enterprise-manager-discussions
Good luck!
Hein
I used GetServer followed by PutServer in same function definition(using same session) and it worked. Thanks for providing the clue