acquia / acsf-tools

Command line tools for working with Acquia Cloud Site Factory
20 stars 25 forks source link

Use v2 endpoint for acsf-tools:content-staging-deploy #143

Closed marcoscano closed 2 years ago

marcoscano commented 2 years ago

On the 10.x-dev branch, when executing drush acsf-tools:content-staging-deploy , we get a warning that the v1 endpoint is deprecated and the v2 endpoint should be used for this operation:

$ drush @default.dev acsf-tools:content-staging-deploy dev default
Staging deployment has been initiated - WIP6116. This endpoint is deprecated. Please use the v2 endpoint to utilize the single site staging feature.

When checking /api/v2/ on my factory environment I do see there is a single endpoint available:

GET /api/v2/stage
POST /api/v2/stage

I am not familiar with the changes, just wanted to surface this so we can track progress, when the moment is appropriate.

vbouchet31 commented 2 years ago

It seems we are only using the to_env and sites arguments in POST data.

$post_data = array(
      'to_env' => $env,
      'sites' => $to_stage,
    );

These arguments are same on v1 and v2 so it should be safe to switch to v2 without any other code change. Ideally we should expose some more arguments (like wipe_target_environment, wipe_stacks, skip_site_files and skip_site_files_overwrite).

vbouchet31 commented 2 years ago

Thanks for the PR. It has been merged in the 10.x branch.