Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rrddata #47

Closed
Ballard-dev opened this issue Apr 1, 2024 · 3 comments · Fixed by #48
Closed

Rrddata #47

Ballard-dev opened this issue Apr 1, 2024 · 3 comments · Fixed by #48

Comments

@Ballard-dev
Copy link

Ballard-dev commented Apr 1, 2024

https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/rrddata

    class Rrddata extends PVEPathClassBase
    
    ...

    public function get(): ?array
    {
        return $this->getPve()->getApi()->get($this->getPathAdditional());
    }

Rrddata requires timeframe.

Timeframe is a required parameter for rrddata hour | day | week | month | year enum

Without timeframe null will always be returned here.

I tried to open a PR, but cannot commit to a branch, here's my changes in Proxmox/Api/Nodes/Node/Rrddata.php

    /**
     * Read node RRD statistics
     * @link https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/rrddata
     * @param array $params An array specifying the time intervals for which statistics should be retrieved.
     * Supported keys:
     * ['timeframe' =>
     * - 'hour': Retrieve statistics for the last hour.
     * - 'day': Retrieve statistics for the last day.
     * - 'week': Retrieve statistics for the last week.
     * - 'month': Retrieve statistics for the last month.
     * - 'year': Retrieve statistics for the last year.
     * ]
     * @return array|null
     */
    public function get(array $params = []): ?array
    {
        return $this->getPve()->getApi()->get($this->getPathAdditional(), $params);
    }
@Ballard-dev
Copy link
Author

also 'cf' is an optional

@MrKampf
Copy link
Owner

MrKampf commented Apr 2, 2024

Thanks for information, this week i release a new version with fix!

@MrKampf MrKampf linked a pull request Apr 2, 2024 that will close this issue
MrKampf added a commit that referenced this issue Apr 2, 2024
Bugfix (#47): timeframe parameter needed
@Ballard-dev
Copy link
Author

Thanks!

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 a pull request may close this issue.

2 participants