Skip to content

Adds full CLI support for the OVHcloud WebHosting API#168

Merged
amstuta merged 37 commits intoovh:mainfrom
arnaud-jost:dev/ajost/split-webhosting
Apr 2, 2026
Merged

Adds full CLI support for the OVHcloud WebHosting API#168
amstuta merged 37 commits intoovh:mainfrom
arnaud-jost:dev/ajost/split-webhosting

Conversation

@arnaud-jost
Copy link
Copy Markdown
Contributor

@arnaud-jost arnaud-jost commented Apr 1, 2026

Description

This PR adds full CLI support for the OVHcloud WebHosting API.

New commands
The ovhcloud webhosting command group now covers the entire WebHosting surface:

  • Service: get, edit, list, terminate, request-action, request-boost, restore-snapshot, unblock-tcp-out, abuse-state, boost-history, incident, token, service-info
  • Attached domains: domain — list, get, add, update, delete, find, dig-status, purge-cache, restart, available-offer
  • Databases: db — list, get, create, delete, change-password, import, restore, stats, request-action, capabilities, creation-capabilities, available-type, available-version, copy, dump
  • Environment variables: env — list, get, create, update, delete
  • Cron tasks: cron — list, get, create, update, delete, available-languages
  • Modules: module — list, get, install, delete, catalog
  • Runtimes: runtime — list, get, create, update, delete, domains, available-types
  • Websites: website — list, get, create, update, delete, deploy, deployment, creation-capabilities
  • Users (FTP/SSH): user — list, get, create, update, delete, change-password
  • CDN: cdn — get, domain, operation, service-info, available-options
  • SSL certificates: ssl — get, create, delete, domains
  • OVH config: ovh-config — list, get, change, rollback, refresh, recommended, capabilities
  • Email: email — info, update, bounces, volumes, request-action
  • Email options: email-option — list, get, terminate, service-info
  • Extra SQL: extra-sql — list, get, databases, terminate, service-info
  • Own logs: own-log — list, get, user
  • VCS webhooks: vcs webhooks
  • Tasks: tasks — list, get
  • Local SEO: local-seo — account, location, directories, visibility-check, visibility-result, email-availability
  • SSH keys: ssh-key — get, create
  • Offer: offer — capabilities, vcs-supported

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code
  • I ran go mod tidy
  • I have added tests that prove my fix is effective or that my feature works

Tests

webhosting module list
$ ovhcloud webhosting module list arnaud-pxx.ovh
┌────────────┬───────────┬───────────┬─────────┬────────────────────┬──────┬──────────┬────────┐
│ Install ID │  Module   │ Module ID │ Status  │       Target       │ Path │ Language │ Admin  │
├────────────┼───────────┼───────────┼─────────┼────────────────────┼──────┼──────────┼────────┤
│ 1747684    │ wordpress │ 1096      │ created │ www.arnaud-pxx.ovh │ www  │ fr       │ arnaud │
└────────────┴───────────┴───────────┴─────────┴────────────────────┴──────┴──────────┴──────┘
webhosting website list
$ ovhcloud webhosting website list arnaud-pxx.ovh
┌──────┬──────────┬────────┬───────────┐
│  id  │   path   │ vcsUrl │ vcsBranch │
├──────┼──────────┼────────┼───────────┤
│ 8222 │ .        │        │           │
│ 8223 │ wpmonito │        │           │
│ 8224 │ www      │        │           │
└──────┴──────────┴────────┴───────────┘
webhosting tasks list
$ ovhcloud webhosting tasks list arnaud-pxx.ovh
┌───────────┬───────────────────┬──────────┐
│    id     │     function      │  status  │
├───────────┼───────────────────┼──────────┤
│ 491130403 │ ovhConfig/update  │ ovhError │
│ 491124149 │ ovhConfig/refresh │ ovhError │
└───────────┴───────────────────┴──────────┘
webhosting list -o json (extrait)
$ ovhcloud webhosting list -o json
[
  {
    "availableBoostOffer": [
      {
        "offer": "PERFORMANCE_2",
        "price": { "currencyCode": "EUR", "text": "0.54 €", "value": 0.539 }
      },
      ...
    ],
    "boostOffer": null,
    "cluster": "cluster116",
    ...
  }
]

@arnaud-jost arnaud-jost requested a review from a team as a code owner April 1, 2026 19:06
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds comprehensive CLI coverage for the OVHcloud WebHosting API surface by introducing many new command docs and interactive templates, plus a few supporting changes in display and filtering.

Changes:

  • Added many new WebHosting interactive output templates (website, runtime, CDN, SSL, Local SEO, tasks, users, etc.).
  • Added autogenerated CLI documentation pages for the new ovhcloud webhosting ... command tree.
  • Extended filtering tests and introduced a new WebHosting “v2” schema asset file; added a wasm output helper (currently with behavioral issues).

Reviewed changes

Copilot reviewed 248 out of 249 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/services/webhosting/templates/website.tmpl Adds interactive template for “website get” output.
internal/services/webhosting/templates/website_deployment.tmpl Adds interactive template for website deployment details.
internal/services/webhosting/templates/website_creation_capabilities.tmpl Adds interactive template for website creation capabilities.
internal/services/webhosting/templates/vcs_webhooks.tmpl Adds interactive template for VCS webhook URL output.
internal/services/webhosting/templates/user.tmpl Adds interactive template for FTP/SSH user details.
internal/services/webhosting/templates/user_log.tmpl Adds interactive template for user log details.
internal/services/webhosting/templates/token.tmpl Adds interactive template for DNS verification token output.
internal/services/webhosting/templates/task.tmpl Adds interactive template for task details output.
internal/services/webhosting/templates/ssl.tmpl Adds interactive template for SSL details output.
internal/services/webhosting/templates/ssl_resource_certificates.tmpl Adds interactive template for resource certificate listing output.
internal/services/webhosting/templates/ssh_key.tmpl Adds interactive template for SSH public key output.
internal/services/webhosting/templates/runtime.tmpl Adds interactive template for runtime details output.
internal/services/webhosting/templates/runtime_available_types.tmpl Adds interactive template for available runtime types output.
internal/services/webhosting/templates/own_log.tmpl Adds interactive template for own-log entry output.
internal/services/webhosting/templates/own_log_user.tmpl Adds interactive template for own-log user output (dual-shape payload).
internal/services/webhosting/templates/ovh_config.tmpl Adds interactive template for .ovhconfig entry output.
internal/services/webhosting/templates/ovh_config_recommended.tmpl Adds interactive template for recommended .ovhconfig values.
internal/services/webhosting/templates/ovh_config_capabilities.tmpl Adds interactive template for .ovhconfig capability matrix output.
internal/services/webhosting/templates/module_catalog.tmpl Adds interactive template for module catalog entry output.
internal/services/webhosting/templates/local_seo_visibility_result.tmpl Adds interactive template for Local SEO visibility results.
internal/services/webhosting/templates/local_seo_visibility_check.tmpl Adds interactive template for Local SEO visibility check output.
internal/services/webhosting/templates/local_seo_location.tmpl Adds interactive template for Local SEO location details.
internal/services/webhosting/templates/local_seo_email.tmpl Adds interactive template for Local SEO email availability output.
internal/services/webhosting/templates/local_seo_directories.tmpl Adds interactive template for Local SEO directory catalogs.
internal/services/webhosting/templates/local_seo_account.tmpl Adds interactive template for Local SEO account details.
internal/services/webhosting/templates/extra_sql_service_info.tmpl Adds interactive template for Extra SQL service info output.
internal/services/webhosting/templates/extra_sql_option.tmpl Adds interactive template for Extra SQL option details output.
internal/services/webhosting/templates/env_var.tmpl Adds interactive template for environment variable details output.
internal/services/webhosting/templates/email.tmpl Adds interactive template for email settings output.
internal/services/webhosting/templates/email_option.tmpl Adds interactive template for email option details output.
internal/services/webhosting/templates/email_option_service_info.tmpl Adds interactive template for email option service info output.
internal/services/webhosting/templates/database.tmpl Adds interactive template for database details output.
internal/services/webhosting/templates/database_dump.tmpl Adds interactive template for database dump details output.
internal/services/webhosting/templates/database_copy.tmpl Adds interactive template for database copy details output.
internal/services/webhosting/templates/database_capabilities.tmpl Adds interactive template for DB capability flags output.
internal/services/webhosting/templates/database_available_versions.tmpl Adds interactive template for DB available versions output.
internal/services/webhosting/templates/cron.tmpl Adds interactive template for cron task details output.
internal/services/webhosting/templates/cdn.tmpl Adds interactive template for CDN details output.
internal/services/webhosting/templates/cdn_operation.tmpl Adds interactive template for CDN operation details output.
internal/services/webhosting/templates/cdn_domain.tmpl Adds interactive template for CDN domain details output.
internal/services/webhosting/templates/cdn_domain_statistics.tmpl Adds interactive template for CDN domain time series stats.
internal/services/webhosting/templates/cdn_domain_option.tmpl Adds interactive template for CDN domain option details.
internal/services/webhosting/templates/cdn_available_options.tmpl Adds interactive template for CDN available options output.
internal/services/webhosting/templates/boost_history.tmpl Adds interactive template for boost history output.
internal/services/webhosting/templates/attached_domain.tmpl Adds interactive template for attached domain details output.
internal/services/webhosting/templates/attached_domain_dig_status.tmpl Adds interactive template for DNS dig-status output.
internal/services/webhosting/templates/abuse_state.tmpl Adds interactive template for abuse-state output.
internal/filters/filters_test.go Adds test coverage for wildcard-to-regex normalization in filters.
internal/display/display_wasm.go Adds wasm OutputWithFormat helper (currently diverges from non-wasm behavior).
internal/assets/api-schemas/webhosting_v2.json Adds a small v2 WebHosting schema fragment (currently not wired into embedded assets).
doc/ovhcloud_webhosting_website_update.md New CLI doc page for webhosting website update.
doc/ovhcloud_webhosting_website_list.md New CLI doc page for webhosting website list.
doc/ovhcloud_webhosting_website_get.md New CLI doc page for webhosting website get.
doc/ovhcloud_webhosting_website_deployment.md New CLI doc page for webhosting website deployment.
doc/ovhcloud_webhosting_website_deployment_logs.md New CLI doc page for webhosting website deployment logs.
doc/ovhcloud_webhosting_website_deployment_get.md New CLI doc page for webhosting website deployment get.
doc/ovhcloud_webhosting_website_deploy.md New CLI doc page for webhosting website deploy.
doc/ovhcloud_webhosting_website_delete.md New CLI doc page for webhosting website delete.
doc/ovhcloud_webhosting_website_creation-capabilities.md New CLI doc page for webhosting website creation-capabilities.
doc/ovhcloud_webhosting_website_create.md New CLI doc page for webhosting website create.
doc/ovhcloud_webhosting_vcs.md New CLI doc page for webhosting vcs.
doc/ovhcloud_webhosting_vcs_webhooks.md New CLI doc page for webhosting vcs webhooks.
doc/ovhcloud_webhosting_user_update.md New CLI doc page for webhosting user update.
doc/ovhcloud_webhosting_user_list.md New CLI doc page for webhosting user list.
doc/ovhcloud_webhosting_user_get.md New CLI doc page for webhosting user get.
doc/ovhcloud_webhosting_user_delete.md New CLI doc page for webhosting user delete.
doc/ovhcloud_webhosting_user_create.md New CLI doc page for webhosting user create.
doc/ovhcloud_webhosting_user_change-password.md New CLI doc page for webhosting user change-password.
doc/ovhcloud_webhosting_unblock-tcp-out.md New CLI doc page for webhosting unblock-tcp-out.
doc/ovhcloud_webhosting_token.md New CLI doc page for webhosting token.
doc/ovhcloud_webhosting_terminate.md New CLI doc page for webhosting terminate.
doc/ovhcloud_webhosting_tasks.md New CLI doc page for webhosting tasks.
doc/ovhcloud_webhosting_tasks_list.md New CLI doc page for webhosting tasks list.
doc/ovhcloud_webhosting_tasks_get.md New CLI doc page for webhosting tasks get.
doc/ovhcloud_webhosting_ssl.md New CLI doc page for webhosting ssl.
doc/ovhcloud_webhosting_ssl_get.md New CLI doc page for webhosting ssl get.
doc/ovhcloud_webhosting_ssl_domains.md New CLI doc page for webhosting ssl domains.
doc/ovhcloud_webhosting_ssl_delete.md New CLI doc page for webhosting ssl delete.
doc/ovhcloud_webhosting_ssl_create.md New CLI doc page for webhosting ssl create.
doc/ovhcloud_webhosting_ssh-key.md New CLI doc page for webhosting ssh-key.
doc/ovhcloud_webhosting_ssh-key_get.md New CLI doc page for webhosting ssh-key get.
doc/ovhcloud_webhosting_ssh-key_create.md New CLI doc page for webhosting ssh-key create.
doc/ovhcloud_webhosting_service-info.md New CLI doc page for webhosting service-info.
doc/ovhcloud_webhosting_service-info_update.md New CLI doc page for webhosting service-info update.
doc/ovhcloud_webhosting_service-info_get.md New CLI doc page for webhosting service-info get.
doc/ovhcloud_webhosting_runtime_update.md New CLI doc page for webhosting runtime update.
doc/ovhcloud_webhosting_runtime_list.md New CLI doc page for webhosting runtime list.
doc/ovhcloud_webhosting_runtime_get.md New CLI doc page for webhosting runtime get.
doc/ovhcloud_webhosting_runtime_domains.md New CLI doc page for webhosting runtime domains.
doc/ovhcloud_webhosting_runtime_delete.md New CLI doc page for webhosting runtime delete.
doc/ovhcloud_webhosting_runtime_create.md New CLI doc page for webhosting runtime create.
doc/ovhcloud_webhosting_restore-snapshot.md New CLI doc page for webhosting restore-snapshot.
doc/ovhcloud_webhosting_request-boost.md New CLI doc page for webhosting request-boost.
doc/ovhcloud_webhosting_request-action.md New CLI doc page for webhosting request-action.
doc/ovhcloud_webhosting_own-log.md New CLI doc page for webhosting own-log.
doc/ovhcloud_webhosting_own-log_user_update.md New CLI doc page for webhosting own-log user update.
doc/ovhcloud_webhosting_own-log_user_get.md New CLI doc page for webhosting own-log user get.
doc/ovhcloud_webhosting_own-log_user_delete.md New CLI doc page for webhosting own-log user delete.
doc/ovhcloud_webhosting_own-log_user_create.md New CLI doc page for webhosting own-log user create.
doc/ovhcloud_webhosting_own-log_user_change-password.md New CLI doc page for webhosting own-log user change-password.
doc/ovhcloud_webhosting_own-log_get.md New CLI doc page for webhosting own-log get.
doc/ovhcloud_webhosting_ovh-config_rollback.md New CLI doc page for webhosting ovh-config rollback.
doc/ovhcloud_webhosting_ovh-config_refresh.md New CLI doc page for webhosting ovh-config refresh.
doc/ovhcloud_webhosting_ovh-config_recommended.md New CLI doc page for webhosting ovh-config recommended.
doc/ovhcloud_webhosting_ovh-config_get.md New CLI doc page for webhosting ovh-config get.
doc/ovhcloud_webhosting_offer.md New CLI doc page for webhosting offer.
doc/ovhcloud_webhosting_offer_capabilities.md New CLI doc page for webhosting offer capabilities.
doc/ovhcloud_webhosting_module.md New CLI doc page for webhosting module.
doc/ovhcloud_webhosting_module_list.md New CLI doc page for webhosting module list.
doc/ovhcloud_webhosting_module_install.md New CLI doc page for webhosting module install.
doc/ovhcloud_webhosting_module_get.md New CLI doc page for webhosting module get.
doc/ovhcloud_webhosting_module_delete.md New CLI doc page for webhosting module delete.
doc/ovhcloud_webhosting_module_catalog.md New CLI doc page for webhosting module catalog.
doc/ovhcloud_webhosting_module_catalog_get.md New CLI doc page for webhosting module catalog get.
doc/ovhcloud_webhosting_local-seo_visibility-result.md New CLI doc page for webhosting local-seo visibility-result.
doc/ovhcloud_webhosting_local-seo_visibility-check.md New CLI doc page for webhosting local-seo visibility-check.
doc/ovhcloud_webhosting_local-seo_location_terminate.md New CLI doc page for webhosting local-seo location terminate.
doc/ovhcloud_webhosting_local-seo_location_service-info.md New CLI doc page for webhosting local-seo location service-info.
doc/ovhcloud_webhosting_local-seo_location_service-info_get.md New CLI doc page for webhosting local-seo location service-info get.
doc/ovhcloud_webhosting_local-seo_location_get.md New CLI doc page for webhosting local-seo location get.
doc/ovhcloud_webhosting_local-seo_email-availability.md New CLI doc page for webhosting local-seo email-availability.
doc/ovhcloud_webhosting_local-seo_directories.md New CLI doc page for webhosting local-seo directories.
doc/ovhcloud_webhosting_local-seo_account.md New CLI doc page for webhosting local-seo account.
doc/ovhcloud_webhosting_local-seo_account_login.md New CLI doc page for webhosting local-seo account login.
doc/ovhcloud_webhosting_local-seo_account_get.md New CLI doc page for webhosting local-seo account get.
doc/ovhcloud_webhosting_incident.md New CLI doc page for webhosting incident.
doc/ovhcloud_webhosting_extra-sql_terminate.md New CLI doc page for webhosting extra-sql terminate.
doc/ovhcloud_webhosting_extra-sql_service-info.md New CLI doc page for webhosting extra-sql service-info.
doc/ovhcloud_webhosting_extra-sql_service-info_get.md New CLI doc page for webhosting extra-sql service-info get.
doc/ovhcloud_webhosting_extra-sql_get.md New CLI doc page for webhosting extra-sql get.
doc/ovhcloud_webhosting_env.md New CLI doc page for webhosting env.
doc/ovhcloud_webhosting_env_update.md New CLI doc page for webhosting env update.
doc/ovhcloud_webhosting_env_list.md New CLI doc page for webhosting env list.
doc/ovhcloud_webhosting_env_get.md New CLI doc page for webhosting env get.
doc/ovhcloud_webhosting_env_delete.md New CLI doc page for webhosting env delete.
doc/ovhcloud_webhosting_env_create.md New CLI doc page for webhosting env create.
doc/ovhcloud_webhosting_email.md New CLI doc page for webhosting email.
doc/ovhcloud_webhosting_email-option.md New CLI doc page for webhosting email-option.
doc/ovhcloud_webhosting_email-option_terminate.md New CLI doc page for webhosting email-option terminate.
doc/ovhcloud_webhosting_email-option_service-info.md New CLI doc page for webhosting email-option service-info.
doc/ovhcloud_webhosting_email-option_get.md New CLI doc page for webhosting email-option get.
doc/ovhcloud_webhosting_email_update.md New CLI doc page for webhosting email update.
doc/ovhcloud_webhosting_email_request-action.md New CLI doc page for webhosting email request-action.
doc/ovhcloud_webhosting_email_info.md New CLI doc page for webhosting email info.
doc/ovhcloud_webhosting_email_bounces.md New CLI doc page for webhosting email bounces.
doc/ovhcloud_webhosting_edit.md Updates docs for webhosting edit to include --clear-display-name.
doc/ovhcloud_webhosting_domain_restart.md New CLI doc page for webhosting domain restart.
doc/ovhcloud_webhosting_domain_purge-cache.md New CLI doc page for webhosting domain purge-cache.
doc/ovhcloud_webhosting_domain_list.md New CLI doc page for webhosting domain list.
doc/ovhcloud_webhosting_domain_get.md New CLI doc page for webhosting domain get.
doc/ovhcloud_webhosting_domain_find.md New CLI doc page for webhosting domain find.
doc/ovhcloud_webhosting_domain_dig-status.md New CLI doc page for webhosting domain dig-status.
doc/ovhcloud_webhosting_domain_delete.md New CLI doc page for webhosting domain delete.
doc/ovhcloud_webhosting_domain_available-offer.md New CLI doc page for webhosting domain available-offer.
doc/ovhcloud_webhosting_db_restore.md New CLI doc page for webhosting db restore.
doc/ovhcloud_webhosting_db_request-action.md New CLI doc page for webhosting db request-action.
doc/ovhcloud_webhosting_db_list.md New CLI doc page for webhosting db list.
doc/ovhcloud_webhosting_db_import.md New CLI doc page for webhosting db import.
doc/ovhcloud_webhosting_db_get.md New CLI doc page for webhosting db get.
doc/ovhcloud_webhosting_db_dump.md New CLI doc page for webhosting db dump group.
doc/ovhcloud_webhosting_db_dump_restore.md New CLI doc page for webhosting db dump restore.
doc/ovhcloud_webhosting_db_dump_get.md New CLI doc page for webhosting db dump get.
doc/ovhcloud_webhosting_db_dump_delete.md New CLI doc page for webhosting db dump delete.
doc/ovhcloud_webhosting_db_dump_create.md New CLI doc page for webhosting db dump create.
doc/ovhcloud_webhosting_db_delete.md New CLI doc page for webhosting db delete.
doc/ovhcloud_webhosting_db_copy.md New CLI doc page for webhosting db copy group.
doc/ovhcloud_webhosting_db_copy_restore.md New CLI doc page for webhosting db copy restore.
doc/ovhcloud_webhosting_db_copy_get.md New CLI doc page for webhosting db copy get.
doc/ovhcloud_webhosting_db_copy_delete.md New CLI doc page for webhosting db copy delete.
doc/ovhcloud_webhosting_db_copy_create.md New CLI doc page for webhosting db copy create.
doc/ovhcloud_webhosting_db_change-password.md New CLI doc page for webhosting db change-password.
doc/ovhcloud_webhosting_db_capabilities.md New CLI doc page for webhosting db capabilities.
doc/ovhcloud_webhosting_db_available-version.md New CLI doc page for webhosting db available-version.
doc/ovhcloud_webhosting_cron_update.md New CLI doc page for webhosting cron update.
doc/ovhcloud_webhosting_cron_get.md New CLI doc page for webhosting cron get.
doc/ovhcloud_webhosting_cron_delete.md New CLI doc page for webhosting cron delete.
doc/ovhcloud_webhosting_cron_create.md New CLI doc page for webhosting cron create.
doc/ovhcloud_webhosting_cron_available-languages.md New CLI doc page for webhosting cron available-languages.
doc/ovhcloud_webhosting_cdn_service-info.md New CLI doc page for webhosting cdn service-info.
doc/ovhcloud_webhosting_cdn_service-info_get.md New CLI doc page for webhosting cdn service-info get.
doc/ovhcloud_webhosting_cdn_operation.md New CLI doc page for webhosting cdn operation group.
doc/ovhcloud_webhosting_cdn_operation_get.md New CLI doc page for webhosting cdn operation get.
doc/ovhcloud_webhosting_cdn_get.md New CLI doc page for webhosting cdn get.
doc/ovhcloud_webhosting_cdn_domain_refresh.md New CLI doc page for webhosting cdn domain refresh.
doc/ovhcloud_webhosting_cdn_domain_purge.md New CLI doc page for webhosting cdn domain purge.
doc/ovhcloud_webhosting_cdn_domain_option_get.md New CLI doc page for webhosting cdn domain option get.
doc/ovhcloud_webhosting_cdn_domain_option_delete.md New CLI doc page for webhosting cdn domain option delete.
doc/ovhcloud_webhosting_cdn_domain_get.md New CLI doc page for webhosting cdn domain get.
doc/ovhcloud_webhosting_api.md New CLI doc page for webhosting api group.
doc/ovhcloud_webhosting_api_call.md New CLI doc page for webhosting api call.
doc/ovhcloud_webhosting_abuse-state.md New CLI doc page for webhosting abuse-state.
Comments suppressed due to low confidence (1)

internal/services/webhosting/templates/cdn_domain_option.tmpl:27

  • This user-facing hint mixes French with otherwise English CLI output ("pour afficher..."). For consistency (and to keep templates searchable/maintainable), please translate this line to English like the other templates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +167 to +185
func OutputWithFormat(msg *OutputMessage, outputFormat *OutputFormat) {
if msg.Error {
exitError("%s", msg.Message)
return
}
if msg.Warning {
exitError("%s", msg.Message)
return
}

if msg.Details != nil {
if err := prettyPrintJSON(msg.Details); err != nil {
exitError("error displaying JSON results: %s", err)
}
return
}

outputf("%s", msg.Message)
}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

In the wasm build, OutputWithFormat currently ignores outputFormat (yaml/custom/interactive) and treats warnings as errors by calling exitError, which sets ResultError. This behavior diverges from internal/display/display.go and can cause warnings to be surfaced as fatal errors or output to be formatted incorrectly. Consider implementing the same switch-on-format logic as the non-wasm version and setting ResultError only for msg.Error (and for msg.Warning without marking it as an error).

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +13
- Status: {{with (index $ssl "status")}}{{.}}{{else}}N/A{{end}}
- Regenerable: {{with (index $ssl "regenerable")}}{{.}}{{else}}N/A{{end}}
- Report bound: {{with (index $ssl "isReportable")}}{{.}}{{else}}N/A{{end}}
- Task ID: {{with (index $ssl "taskId")}}{{.}}{{else}}N/A{{end}}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The label "Report bound" looks like a typo/inaccurate wording for the isReportable field. Renaming it to something like "Reportable" (or "Is reportable") would better match the underlying field and avoid confusing users.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +5
{
"/webhosting/resource/{name}/certificate": {
"get": {
"summary": "List SSL certificates for a hosting resource",
"description": "Beta endpoint returning certificates detected on a WebHosting resource.",
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

This new schema file is added under internal/assets/api-schemas, but it is not embedded/registered in internal/assets/assets.go (which explicitly lists embedded schemas). If any CLI code needs to load this spec at runtime, it won't be available in the compiled binary unless you add the corresponding go:embed entry and exported var (and wire it where needed).

Copilot uses AI. Check for mistakes.
@amstuta
Copy link
Copy Markdown
Collaborator

amstuta commented Apr 2, 2026

Code Review: dev/ajost/split-webhosting branch

Review of data model correctness against the OVH API schemas:

  • v1: https://eu.api.ovh.com/v1/hosting/web.json?format=openapi3
  • v2: https://eu.api.ovh.com/v2/webhosting.json?format=openapi3

Critical Issues

1. website update sends fields the API does not accept

Files: internal/services/webhosting/webhosting.go:2250-2271, internal/cmd/webhosting.go:948-957

The v1 API PUT /hosting/web/{serviceName}/website/{id} schema (hosting.web.website.Update) only accepts one field:

vcsBranch: string (nullable)

But the CLI exposes and sends three fields:

// webhosting.go:2252-2260
if cmd.Flags().Changed("path") {
    params["path"] = WebsitePath       // NOT in API schema
}
if cmd.Flags().Changed("vcs-url") {
    params["vcsUrl"] = WebsiteVcsURL   // NOT in API schema
}
if cmd.Flags().Changed("branch") {
    params["vcsBranch"] = WebsiteBranch // OK
}

And in the command definition:

// cmd/webhosting.go:954-956
websiteUpdateCmd.Flags().StringVar(&webhosting.WebsitePath, "path", "", "Deployment path")         // invalid
websiteUpdateCmd.Flags().StringVar(&webhosting.WebsiteVcsURL, "vcs-url", "", "Repository URL")     // invalid
websiteUpdateCmd.Flags().StringVar(&webhosting.WebsiteBranch, "branch", "", "Branch to deploy")    // valid

Impact: Users passing --path or --vcs-url to webhosting website update will see the flags accepted without error, but the API will silently ignore them (or return a 400). This is misleading.

Fix: Remove --path and --vcs-url flags from the update command. Only --branch should be exposed.


2. website deploy is missing the reset parameter

Files: internal/services/webhosting/webhosting.go:2285-2293, internal/cmd/webhosting.go:967-973

The v1 API POST /hosting/web/{serviceName}/website/{id}/deploy accepts a request body (hosting.web.website.DeploymentRequest):

reset: boolean (optional) — Whether a reset was requested before deploying

But the code sends an empty body:

// webhosting.go:2287-2288
body := map[string]any{}
if err := httpLib.Client.Post(endpoint, body, nil); err != nil {

And the command exposes no --reset flag:

// cmd/webhosting.go:967-973
websiteDeployCmd := &cobra.Command{
    Use:   "deploy <service_name> <id>",
    Short: "Trigger a deployment",
    Args:  cobra.ExactArgs(2),
    Run:   webhosting.DeployWebsite,
}
// No flags added

Impact: Users cannot request a reset-before-deploy, which is a documented API feature.

Fix: Add a --reset boolean flag to the deploy command and pass it in the request body.


3. user update sends password in PUT body — API uses a dedicated endpoint

Files: internal/services/webhosting/webhosting.go:2825-2845, internal/cmd/webhosting.go:1238-1248

The v1 API PUT /hosting/web/{serviceName}/user/{login} accepts editable fields home and sshState. Password changes use a separate POST /hosting/web/{serviceName}/user/{login}/changePassword endpoint.

But the update command sends password in the PUT:

// webhosting.go:2830-2832
if UserPassword != "" {
    params["password"] = UserPassword
}

The CLI already has a proper change-password subcommand using the correct endpoint (line 2857-2868).

Impact: The --password flag on user update will either be silently ignored or cause an API error. Users would think they changed the password but it didn't actually change.

Fix: Remove the --password flag from the user update command. The separate user change-password command is the correct way.


Medium Issues

4. cron create and cron update don't expose the status field

Files: internal/services/webhosting/webhosting.go:574-643, internal/cmd/webhosting.go:180-207

The API's cron input model (hosting.web.Cron) includes:

status: hosting.web.cron.StatusEnum  (disabled | enabled | suspended)

Neither create nor update commands expose a --status flag. This means:

  • You cannot create a cron in disabled state
  • You cannot enable/disable a cron without using --editor or --from-file

Fix: Add --status flag to both cron create and cron update commands.


5. user SSH state help text is incomplete

Files: internal/cmd/webhosting.go:1234,1246

The --ssh-state flag description says:

allowed: active, none

But the v1 API hosting.web.user.SshStateEnum supports three values:

  • active
  • none
  • sftponly

The v2 API equivalently has: ACTIVE, NONE, SFTP_ONLY.

Impact: Users don't know they can set SFTP-only access.

Fix: Update help text to "allowed: active, none, sftponly".


6. own-log user create editor example includes a path parameter

File: internal/services/webhosting/webhosting.go:322-327

The editor example includes ownLogsId:

const ownLogUserCreateExample = `{
  "login": "",
  "password": "",
  "description": "",
  "ownLogsId": 0
}`

But ownLogsId is already passed as a path parameter (args[1]). Including it in the editor body is confusing and the API will either ignore it or reject it.

Fix: Remove ownLogsId from the example:

const ownLogUserCreateExample = `{
  "login": "",
  "password": "",
  "description": ""
}`

7. SSL commands use per-domain endpoints — service-level SSL is not exposed

Files: internal/services/webhosting/webhosting.go:2356-2396, internal/cmd/webhosting.go:1012-1042

The code routes SSL operations to:

  • GET/POST/DELETE /v1/hosting/web/{serviceName}/attachedDomain/{domain}/ssl

But the main v1 API also has service-level SSL endpoints:

  • GET /hosting/web/{serviceName}/ssl — returns the global hosting.web.SSL object
  • POST /hosting/web/{serviceName}/ssl — create with custom certificate/chain/key (hosting.web.SSLInput)
  • DELETE /hosting/web/{serviceName}/ssl — delete the global certificate
  • GET /hosting/web/{serviceName}/ssl/domains — list domains covered
  • POST /hosting/web/{serviceName}/ssl/regenerate — regenerate
  • GET /hosting/web/{serviceName}/ssl/report — get SSL report

The per-domain endpoints are valid but limited. Users cannot:

  • Import a custom SSL certificate (requires the service-level POST with certificate/chain/key body)
  • Regenerate the SSL
  • View the SSL report
  • List all SSL domains at the v1 level

Impact: Important SSL management functionality is not available through the CLI.

Suggestion: Consider also exposing the service-level /ssl endpoints alongside the per-domain ones.


Minor Issues / Observations

8. ListWebsites columns match v1 schema — correct

The list command displays id, path, vcsUrl, vcsBranch which align with hosting.web.Website properties. The v1 Website response also includes domains, hostingDisplayName, hostingServiceName, name, status which are not shown in the list table but would appear in get output via the template. This is fine.

9. Attached domain model — correct

The AddAttachedDomain and UpdateAttachedDomain functions correctly map to the v1 API's hosting.web.AttachedDomain input model:

  • domain, path, ssl, cdn, firewall, ipLocation, ownLog, runtimeId, bypassDNSConfiguration

All field names and types match the API schema.

10. Database create model — correct (including the capabilitie typo)

The API field is literally named capabilitie (not capability), and the code correctly uses this misspelled name:

params["capabilitie"] = DatabaseCapability

This matches the API schema. The flag is named --capability for better UX, which is appropriate.

11. Cron create model — correct

Required fields command, frequency, language are enforced. Optional fields email, description are exposed. Matches hosting.web.Cron input model (minus status as noted above).

12. Env var model — correct

Fields key, type, value match hosting.web.EnvVarInput with types integer|password|string.

13. Runtime create model — mostly correct

Fields name, type, publicDir, appEnv, appBootstrap, isDefault match the hosting.web.runtime write model. The attachedDomains field in create is not in the standard OpenAPI schema but may be accepted by the API as an extension.

14. Module install model — correct

Fields moduleId, domain, path, language, adminName, adminPassword match the POST body for module installation.

15. CDN domain option model — correct

The nested config object with destination, followUri, origins, patternType, priority, queryParameters, resources, statusCode, ttl correctly maps to the API's CDN option configuration structure.

16. Local SEO visibility check — correct

Required fields country, name, street, zip match the API's required fields for hosting.web.localSeo.SearchData.

17. Boost offer validation — intentionally restrictive

The code validates against 8 offers while the API enum has 12+. The excluded values (CLOUDWEB_*, POWER_BETA_*) are likely not valid boost targets, so this restriction is correct.

18. v2 API usage — minimal and correct

Only one v2 endpoint is used: GET /v2/webhosting/resource/{name}/certificate for ssl domains. This matches the v2 schema and returns webhosting.SSL[]. All other operations correctly go through v1.


Summary

# Severity Issue Location
1 Critical website update sends path and vcsUrl — API only accepts vcsBranch webhosting.go:2250, cmd:948
2 Critical website deploy missing reset parameter webhosting.go:2285, cmd:967
3 Critical user update sends password — should use changePassword endpoint webhosting.go:2825, cmd:1238
4 Medium cron create/update missing --status flag webhosting.go:574, cmd:180
5 Medium user --ssh-state help text missing sftponly value cmd:1234
6 Medium own-log user create editor example contains stale ownLogsId field webhosting.go:322
7 Medium Service-level SSL endpoints not exposed (custom cert, regenerate, report) webhosting.go:2356

@arnaud-jost
Copy link
Copy Markdown
Contributor Author

Code review fixes

# Severity Review point Files modified Change made
1 Critical website update was sending path and vcsUrl which the API does not accept webhosting.go:2250, cmd/webhosting.go:954 Removed --path and --vcs-url flags and their corresponding params — only --branch (→ vcsBranch) is kept
2 Critical website deploy was missing the reset parameter webhosting.go:2285, cmd/webhosting.go:967 Added --reset bool flag and pass it in the POST request body
3 Critical user update was sending password in the PUT body — the dedicated changePassword endpoint should be used instead webhosting.go:2825, cmd/webhosting.go:1245 Removed --password flag and password param from UpdateUser (the change-password subcommand remains the only way to change a password)
4 Medium cron create and cron update were not exposing the status field webhosting.go:574/622, cmd/webhosting.go:190/205 Added CronStatus variable, --status flag on both commands, param passing, and updated the editor JSON example
5 Medium --ssh-state help text was missing the sftponly value cmd/webhosting.go:1234/1246 Updated help text to "allowed: active, none, sftponly" on both user create and user update
6 Medium Editor example for own-log user create included ownLogsId which is already a path parameter webhosting.go:322 Removed "ownLogsId": 0 from ownLogUserCreateExample
7 Medium Service-level SSL endpoints were not exposed webhosting.go:2411+, cmd/webhosting.go:1035+, ssl_service.tmpl, ssl_report.tmpl Added 5 new commands: ssl service-get, ssl service-create (with --certificate/--chain/--key), ssl service-delete, ssl regenerate, ssl report

Test results

# Command tested Result
1 webhosting website update arnaud-pxx.ovh 8224 --branch main ✅ Only --branch exposed, --path and --vcs-url are gone. API returns 200 updated
2 webhosting website deploy arnaud-pxx.ovh 8224 --reset "reset": true confirmed in request body via --debug. Without --reset: deployment succeeds. With --reset on an already-running deployment: 409 Conflict as expected
3 webhosting user update arnaud-pxx.ovh arnaudpoqy --ssh-state active --password absent from help. Update with --ssh-state returns 200 updated
4 webhosting cron create ... --status disabled then update ... --status enabled ✅ Cron created with disabled status, then updated to enabled, confirmed via list -o json
5 webhosting user update --help and user create --help ✅ Help text shows "allowed: active, none, sftponly"
6 Inspection of ownLogUserCreateExample in source ownLogsId removed from the editor example
7 webhosting ssl --help, ssl service-get, ssl service-create --help, ssl regenerate --help, ssl report ✅ All 5 new commands present. service-get correctly calls GET /v1/hosting/web/{service}/ssl (confirmed via --debug). 400 Web has multiple SSLs responses are expected API behaviour for this account

@arnaud-jost arnaud-jost force-pushed the dev/ajost/split-webhosting branch from ac030ed to 16cf0d5 Compare April 2, 2026 16:59
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 255 out of 256 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{{ end -}}
{{ end }}

💡 Use option -o json or -o yaml pour afficher toutes les informations brutes
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The help tip is partly in French ("pour afficher toutes les informations brutes"), while the rest of the CLI templates/docs are in English. Please translate this line to English to keep output consistent.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +30
{
"/webhosting/resource/{name}/certificate": {
"get": {
"summary": "List SSL certificates for a hosting resource",
"description": "Beta endpoint returning certificates detected on a WebHosting resource.",
"parameters": [
{
"in": "path",
"name": "name",
"required": true,
"schema": { "type": "string" },
"description": "Hosting service name"
}
],
"responses": {
"200": {
"description": "List of certificates",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": { "type": "object" }
}
}
}
}
}
}
}
}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

This schema file is added but appears unused in the compiled CLI: internal/assets/assets.go only embeds api-schemas/webhosting.json (no webhosting_v2.json), and there are no references to webhosting_v2.json/a corresponding embedded variable in internal/assets. If this schema is required at runtime, please embed it and wire it into the assets/openapi selection; otherwise consider removing it to avoid shipping an unused/forgotten schema.

Copilot uses AI. Check for mistakes.
Signed-off-by: Arnaud Jost <arnaud.jost@ovhcloud.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 254 out of 255 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@amstuta amstuta merged commit 11351ce into ovh:main Apr 2, 2026
8 checks passed
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.

3 participants