Automic Workload Automation

 View Only

 AE REST - Unable to reset public key

Marc Monlouis's profile image
Marc Monlouis posted May 21, 2025 10:12 AM

Hi 

I try to reset a agent public key using AE REST API without success.

When i do following request it work great, i get information 

curl -f --request GET -u "UC/UC:UC" https://xxxxxxxxxxxxxxx/ae/api/v1/0/system/agents/LINUX-1
{
  "active" : true,
  "name" : "LINUX-1",
  "jcl_variant" : "UNIX",
  "platform" : "UNIX",
  "authenticated" : true,
  "version" : "24.2.0+hf.1.build.1728932644725",
  "hardware" : "x86_64/16",
  "ip_address" : "yyyyyyyyyyyyyyy",
  "port" : 2301,
  "software" : "Linux",
  "workload_max_job" : -1,
  "workload_max_ft" : -1,
  "tls" : true,
  "linked" : false
}

But when i execute request bellow i get error 400

curl -f --request POST -u "UC/UC:UC" https://xxxxxxxxxxxxxxxxxxxx:9443/ae/api/v1/0/system/agents/LINUX-1/resetpublickey
curl: (22) The requested URL returned error: 400 Bad Request

However, the request seems to be correct. 
According swagger there is no body needed 
Any idea is welcome !

Thanks in advance for help


Markus Embacher's profile image
Broadcom Employee Markus Embacher

Hi Marc,

I copied your request and it runs fine in my instance. It returns 400 only if I put any special characters into the request. Try escaping the dash (-) with %2D.

Regards, Markus

Marc Monlouis's profile image
Marc Monlouis

Hi Markus and thanks a lot for your answer.

I did the try with dash encoded without more success.
i.e: curl -f --request  POST -u "UC/UC:UC" "xxxxxxxxxxxxxxxx:9443/ae/api/v1/0/system/agents/LINUX%2d1/resetpublickey"
curl: (22) The requested URL returned error: 400 Bad Request

So it seem something is wrong with our installation or setup. But i can't see how it can be possible.

Binary installation just is a "tar xvzf" of AutomicEngine package without any modification.

For configuration, please find REST section of ucsrv.ini  below :

449 [REST]
450 ;
451 ; host: Hostname where the REST API will be reachable from external. Configure this when using an SSL Termination proxy.
452 ;
453 host=xxxxxxxxxxxxxxxxxxx
454 ;
455 ; port: Port where the REST API will accept HTTP/HTTPS requests
456 ;
457 port=9443
458 ;
459 ; sslEnabled: Defines if HTTP or HTTPS will be used
460 ; 0 - HTTP will be used
461 ; 1 - HTTPS will be used
462 ;
463 sslEnabled=1
464 ;
465 ; docu: Enable or disable the REST-API documentation on this URL: http[s]://{host}:{port}/ae/api/{version}.
466 ; 0 - Documentation is disabled
467 ; 1 - Documentation is enabled
468 ;
469 docu=1
470 ;
471 ; sessionTimeout: Session timeout in seconds, if a session is not used within this time span the AE user session is closed
472 ; 2..2147483648 - seconds (maxvalue 2^31)
473 ;
474 sessionTimeout=120
475 ;
476 ; trackPerformanceMetrics: Track performance metrics for all the HTTP requests. These metrics are available for prometheus scraping.
477 ; 0 - Performance metrics are not tracked
478 ; 1 - Performance metrics are tracked
479 ;
480 trackPerformanceMetrics=0
481 ;
482 ; corsSupportEnabled: Enable or disable the Access-Control-Allow-Origin response header configured with CORSACCESSCONTROLALLOWORIGIN, more details: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS.
483 ; 0 - CORS requests are not allowed
484 ; 1 - CORS requests are allowed
485 ;
486 corsSupportEnabled=0
487 ;
488 ; corsAccessControlAllowOrigin: This sets the The Access-Control-Allow-Origin response header which indicates whether the response can be shared with resources with the given origin. If multiple origins are allowed, they must be separated with char ','    . Use char '*' if all origins should be allowed.
489 ;
490 corsAccessControlAllowOrigin=*
491 ;
492 ; gzipSupportEnabled: Enable GZIP compression for REST API responses.
493 ; 0 - gzip support is disabled
494 ; 1 - gzip support is enabled
495 ;
496 gzipSupportEnabled=0
497 ;
498 ; minPoolSize: Minimum number of threads waiting for incoming requests, raise this if you expect multiple parallel requests to maximize the response time.
499 ;
500 minPoolSize=8
501 ;
502 ; maxPoolSize: Maximum number of threads waiting for incoming requests.
503 ;
504 maxPoolSize=200
505 ;
506 ; idleTimeout: Set the maximum idle time for threads in the thread pool. Threads that are idle for longer than this period may be stopped.
507 ;
508 idleTimeout=60000


Any idea is welcome :)

Thanks in advance


Joel Wiesmann's profile image
Joel Wiesmann

Whops sorry, while re-reading your initial post I just realized you already tried the GET I wanted to suggest.

Eric Lontz's profile image
Eric Lontz

Marc,

If we take the url being correct as a given, that leaves us with the object. With the GET I see that the Agent is not linked. I would link the Agent in the AWI. Log on to client 0 > Administration > Open Agent Linux-1 then define the Phrase, Name, and Port.

I hope this helps