API endpoint or way to get current container scale / resources

Is there any way to programmatically get the current scale configuration of our applications on Aptible via the CLI or API? For instance:

  • container count
  • memory
  • cpu share

Could you provide some more details on what you’d like to use the information for?

If you need to access the container size or CPU share from within the container itself, using the APTIBLE_CONTAINTER_SIZE environment variable is the best option. CPU share can be calculated from the container size (APTIBLE_CONTAINER_SIZE / 4096). The container count is not readily available within the containers.

For use outside of a running container, it depends more on what you’re trying to do but the CLI is the only officially supported method for interacting with Aptible resources so it’s generally the best option. The CLI supports outputting data in JSON format by setting APTIBLE_OUTPUT_FORMAT=json in your local environment. For example:

APTIBLE_OUTPUT_FORMAT=json aptible apps
1 Like