try to terminate a running ATP instance using the following API from oci java sdk. TerminateDbSystemRequest terminateDbSystemRequest = TerminateDbSystemRequest.builder().dbSystemId(dbSystemId).build(); databaseClient.terminateDbSystem(terminateDbSystemRequest);
an exception caught Exception in thread "main" com.oracle.bmc.model.BmcException: (404, NotAuthorizedOrNotFound, false) Authorization failed or requested resource not found.
I can stop and start the atp instance successfully, just wondering which class should be used to terminate the atp instance.
That is the right code to perform the action you are trying to perform using the OCI Java SDK, but it looks like you are hitting one of the two below issues:
dbSystemIdis not a valid DB System identifier. One way to confirm if you have the correctdbSystemIdvalue is to confirm if you are able to stop and start the DB System using the same value.dbSystemIdis a valid DB System identifier, but the credentials you are using to terminate the DB System do not have the proper permissions to do so. One way to confirm if this is a permissions issue is to see if, using the same account whose credentials you are using from the Java SDK, you are able to terminate the DB System from the OCI web portal