Skip to content

add db.container_profile and account.stack#374

Merged
benjodo merged 4 commits intomasterfrom
add_additional_output
Mar 7, 2025
Merged

add db.container_profile and account.stack#374
benjodo merged 4 commits intomasterfrom
add_additional_output

Conversation

@benjodo
Copy link
Member

@benjodo benjodo commented Feb 28, 2025

Add the following for JSON output:

Database Container Profile in db:list:

  {
    "id": 4898,
    "handle": "pg-gridiron",
...
    "container_size": 1024,
    "container_profile": "m"
  }

Account/Environment Stack info in environment:list (to get region, for example):

  {
    "id": 1,
    "handle": "aptible-production",
    "created_at": "2014-03-20 22:23:02 UTC",
    "stack": {
      "name": "aptible-us-east-1",
      "id": 341,
      "region": "us-east-1",
      "outbound_ip_addresses": [
        "34.233.103.245",
        "3.214.223.169"
      ]
    }
  }

Copy link
Member

@UserNotFound UserNotFound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the stack information isn't very efficient, and at least double the amount of time it takes to list aptible apps in our account, and will be even worse for our customers that need the performance improvements we've recently added.

So, I request that we don't include the stack when we use attach_account, so it's only embedded in the aptible environment:list command as requested.

@UserNotFound
Copy link
Member

UserNotFound commented Mar 3, 2025

Also, I really question the customers plan to use this information programatically. They suggested they would use their destination stack's region to select the "right" backup like so:

APTIBLE_OUTPUT_FORMAT=json aptible backup:list --max-age=3d database-handle | jq ‘.[] | select(.region == “us-west-1”) | .id’ | head -n 1

However:
A) This isn't a dynamic restore, they know the destination stack is in us-west-1, and they can set that as a constant or variable in their script
B) we haven't promised them single-region backup copies yet? So the right thing here would not be finding the backup via .region == "us-west-1", it would be .region != "us-east-1"?? And again, us-east-1 is "constant" for their purposes.

@UserNotFound
Copy link
Member

@benjodo benjodo merged commit fcae5bc into master Mar 7, 2025
11 checks passed
@benjodo benjodo deleted the add_additional_output branch March 7, 2025 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants