Skip to content

Conversation

@sureshanaparti
Copy link
Contributor

@sureshanaparti sureshanaparti commented May 13, 2025

This PR updates/sync the usage types in docs with the API response and code.

Fixes apache/cloudstack#10813

Current doc: https://docs.cloudstack.apache.org/en/latest/adminguide/usage.html#usage-types.

list usagetypes API response =>

(usageenv) 🐱 > list usagetypes 
{
  "count": 25,
  "usagetype": [
    {
      "description": "Running Vm Usage",
      "usagetypeid": 1
    },
    {
      "description": "Allocated Vm Usage",
      "usagetypeid": 2
    },
    {
      "description": "IP Address Usage",
      "usagetypeid": 3
    },
    {
      "description": "Network Usage (Bytes Sent)",
      "usagetypeid": 4
    },
    {
      "description": "Network Usage (Bytes Received)",
      "usagetypeid": 5
    },
    {
      "description": "Volume Usage",
      "usagetypeid": 6
    },
    {
      "description": "Template Usage",
      "usagetypeid": 7
    },
    {
      "description": "ISO Usage",
      "usagetypeid": 8
    },
    {
      "description": "Snapshot Usage",
      "usagetypeid": 9
    },
    {
      "description": "Security Group Usage",
      "usagetypeid": 10
    },
    {
      "description": "Load Balancer Usage",
      "usagetypeid": 11
    },
    {
      "description": "Port Forwarding Usage",
      "usagetypeid": 12
    },
    {
      "description": "Network Offering Usage",
      "usagetypeid": 13
    },
    {
      "description": "VPN users usage",
      "usagetypeid": 14
    },
    {
      "description": "VM Disk usage(I/O Read)",
      "usagetypeid": 21
    },
    {
      "description": "VM Disk usage(I/O Write)",
      "usagetypeid": 22
    },
    {
      "description": "VM Disk usage(Bytes Read)",
      "usagetypeid": 23
    },
    {
      "description": "VM Disk usage(Bytes Write)",
      "usagetypeid": 24
    },
    {
      "description": "VM Snapshot storage usage",
      "usagetypeid": 25
    },
    {
      "description": "Volume on secondary storage usage",
      "usagetypeid": 26
    },
    {
      "description": "VM Snapshot on primary storage usage",
      "usagetypeid": 27
    },
    {
      "description": "Backup storage usage",
      "usagetypeid": 28
    },
    {
      "description": "Bucket storage usage",
      "usagetypeid": 29
    },
    {
      "description": "Network usage",
      "usagetypeid": 30
    },
    {
      "description": "VPC usage",
      "usagetypeid": 31
    }
  ]
}
(usageenv) 🐱 > 

code =>

https://github.com/apache/cloudstack/blob/39c5641cbe674b19bc77082b850565f634a7cb84/api/src/main/java/org/apache/cloudstack/usage/UsageTypes.java#L24-L50


📚 Documentation preview 📚: https://cloudstack-documentation--504.org.readthedocs.build/en/504/

@sureshanaparti
Copy link
Contributor Author

@blueorangutan docbuild

@blueorangutan
Copy link

@sureshanaparti a Jenkins job has been kicked to build the document. I'll keep you posted as I make progress.

@blueorangutan
Copy link

QA-Doc build preview: https://qa.cloudstack.cloud/builds/docs-build/pr/504. (QA-JID 339)

@sureshanaparti
Copy link
Contributor Author

@rajujith Update the usage types (still the record formats for these to be updated)

@sureshanaparti
Copy link
Contributor Author

@blueorangutan docbuild

@blueorangutan
Copy link

@sureshanaparti a Jenkins job has been kicked to build the document. I'll keep you posted as I make progress.

@blueorangutan
Copy link

QA-Doc build preview: https://qa.cloudstack.cloud/builds/docs-build/pr/504. (QA-JID 342)

Copy link
Contributor

@rajujith rajujith left a comment

Choose a reason for hiding this comment

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

LGTM.

@DaanHoogland
Copy link
Contributor

quite frankly I am against this change. there is a list usage types API and it should document the usage types. adding/updating the docs on this in creating a split source of truth.

@rohityadavcloud rohityadavcloud added this to the 4.20.1 milestone Jun 3, 2025
@rohityadavcloud rohityadavcloud changed the base branch from 4.19 to 4.20 June 3, 2025 08:17
@rohityadavcloud rohityadavcloud requested a review from Pearl1594 June 3, 2025 08:17
@rohityadavcloud rohityadavcloud changed the base branch from 4.20 to 4.19 June 3, 2025 08:18
@rohityadavcloud rohityadavcloud modified the milestones: 4.20.1, 4.19.3 Jun 3, 2025
@abh1sar
Copy link
Contributor

abh1sar commented Jul 18, 2025

quite frankly I am against this change. there is a list usage types API and it should document the usage types. adding/updating the docs on this in creating a split source of truth.

@DaanHoogland, The doc in its current form has already diverged from the source of truth, so adding the missing usage types wouldn’t introduce any additional inconsistency.

As a potential improvement, perhaps we could sync the doc with the missing Usage Types and clearly mention that users should refer to the list Usage Types API for the most up-to-date information?

I was hoping to add some details related to Backup usage to the doc, but currently, Backup isn’t even mentioned as a usage type.

@sureshanaparti sureshanaparti modified the milestones: 4.19.3, 4.19.4 Jul 21, 2025
@DaanHoogland
Copy link
Contributor

@abh1sar ,

quite frankly I am against this change. there is a list usage types API and it should document the usage types. adding/updating the docs on this in creating a split source of truth.

@DaanHoogland, The doc in its current form has already diverged from the source of truth, so adding the missing usage types wouldn’t introduce any additional inconsistency.

I do not believe that is a reason to let it like this. I think the paragraph should be removed and replaced with a link/command to retrieve the data from the API. We are creating a path to continuous maintenance and probably technical debt if we allow for documentation of things which are also documented in code.

As a potential improvement, perhaps we could sync the doc with the missing Usage Types and clearly mention that users should refer to the list Usage Types API for the most up-to-date information?

If this is implemented in an update script we still need to have it run and humans will forget.

I was hoping to add some details related to Backup usage to the doc, but currently, Backup isn’t even mentioned as a usage type.

That should be solved in the source (i.e. the API doc, not in this file)

cc @Pearl1594 @sureshanaparti @rajujith

@rohityadavcloud rohityadavcloud modified the milestones: 4.19.4, 4.20.2 Aug 28, 2025
Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

code lgtm

@weizhouapache weizhouapache changed the base branch from 4.19 to 4.20 October 17, 2025 09:25
@DaanHoogland
Copy link
Contributor

@sureshanaparti @rajujith @weizhouapache , I do not like this way maintaining this information but am not going to reject it. Should we merge this?

@weizhouapache
Copy link
Member

@sureshanaparti @rajujith @weizhouapache , I do not like this way maintaining this information but am not going to reject it. Should we merge this?

@DaanHoogland
do you have a way to maintain the information ?

@DaanHoogland
Copy link
Contributor

@sureshanaparti @rajujith @weizhouapache , I do not like this way maintaining this information but am not going to reject it. Should we merge this?

@DaanHoogland do you have a way to maintain the information ?

In my opinion we should return the description in the table with the list usagetypes ouput, and only describe examples and use cases here. (#504 (comment))

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.

7 participants