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

[Public Cloud] Very slow loading #145

Open
stonebuzz opened this issue Mar 7, 2024 · 0 comments
Open

[Public Cloud] Very slow loading #145

stonebuzz opened this issue Mar 7, 2024 · 0 comments

Comments

@stonebuzz
Copy link

Hello OVH team,

I'd like to tell you about a problem I'm currently experiencing while writing a script to retrieve information about Public Clouds.

I currently have 3 projects containing public clouds for a total of around 100 instances

This simple script

try {
    $ovh = new Api(
        $application_key,
        $application_secret,
        "ovh-eu",
        $consumer_key
    );

    $all_project = $ovh->get('/cloud/project'); // load all project
    foreach ($all_project as $project_name) { // foreach instance
        $ovh_project_infos                  = $ovh->get('/cloud/project/' . $project_name); // get project infos
        $ovh_project_instances = $ovh->get('/cloud/project/' . $project_name . '/instance'); // get all instances for this project
        foreach ($ovh_project_instances as $instance) { // foreach instance
            $ovh_instance_infos                 = $ovh->get('/cloud/project/' . $project_name . '/instance/' . $instance['id']); // get instance info
            $ovh_interface_infos[$instance['id']]  = $ovh->get('/cloud/project/' . $project_name . '/instance/' . $instance['id'] . '/interface'); // get instance interface
        }
    }
} catch (\Throwable $e) {
    error_log('Failed to get data for Public Cloud ');
}

takes about 5 minutes to retrieve the information.

Is there a problem with my script?

How can I improve response times from the API?

Best regards

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

No branches or pull requests

1 participant