Commit ba0bac4
committed
feat: add billing commands for cost summaries and resource listing
Implements 'upctl billing' commands to view billing information:
## billing summary
View cost summary by category with flexible period options:
- Named periods: 'month', 'day', 'quarter', 'year', 'last month'
- Relative periods: '3months' (3 months ago), '2weeks' (2 weeks ago)
- Relative from date: '2months from 2024-06', '+3months from 2024-01'
- Direct format: 'YYYY-MM'
- Optional --resource filter for specific resource UUID
- Optional --detailed flag for full breakdown
## billing list
List detailed billing with resource names:
- Fetches and displays resource names (servers, storage)
- Same flexible --period options as summary
- --match flag for name filtering (case-insensitive)
- --category flag to filter by resource type
- Shows both UUID and name for identification
Both commands:
- Default to current month if period not specified
- Support JSON/YAML output for scripting
- Use existing GetBillingSummary API endpoint
Addresses #3391 parent 2590f76 commit ba0bac4
File tree
5 files changed
+850
-0
lines changed- internal/commands
- base
- billing
5 files changed
+850
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments