This document shows how to delete an SFTP server.
Before you begin
- Remove all users from the server. For steps, see Delete users from an SFTP server.
Required roles
To get the permission that
you need to delete an SFTP server,
ask your administrator to grant you the
Cloud FTP Admin (roles/ftp.admin) IAM role on your project.
For more information about granting roles, see Manage access to projects, folders, and organizations.
This predefined role contains the
ftp.servers.delete
permission,
which is required to
delete an SFTP server.
You might also be able to get this permission with custom roles or other predefined roles.
Delete a server
gcloud
To delete an SFTP server, run the
gcloud alpha storage ftp servers delete command.
Before using any of the command data below, make the following replacements:
- SERVER_ID: the SFTP server ID.
- LOCATION_ID: the location of the server, such
as
us-west1.
Execute the following command:
Linux, macOS, or Cloud Shell
gcloud alpha storage ftp servers delete SERVER_ID --location=LOCATION_ID
Windows (PowerShell)
gcloud alpha storage ftp servers delete SERVER_ID --location=LOCATION_ID
Windows (cmd.exe)
gcloud alpha storage ftp servers delete SERVER_ID --location=LOCATION_ID
REST
To delete an SFTP server, use the
servers.delete method.
Before using any of the request data, make the following replacements:
- PROJECT_ID: the Google Cloud project ID.
- LOCATION_ID: the location of the server, such
as
us-west1. - SERVER_ID: the SFTP server ID.
HTTP method and URL:
DELETE https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID
To send your request, expand one of these options:
The response identifies a long-running operation. It takes about 10 minutes for the server to be deleted.Client libraries
C#
To learn how to install and use the client library for Cloud FTP, see Cloud FTP client libraries. For more information, see the Cloud FTP C# API reference documentation.
To authenticate to Cloud FTP, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To learn how to install and use the client library for Cloud FTP, see Cloud FTP client libraries. For more information, see the Cloud FTP Go API reference documentation.
To authenticate to Cloud FTP, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To learn how to install and use the client library for Cloud FTP, see Cloud FTP client libraries. For more information, see the Cloud FTP Java API reference documentation.
To authenticate to Cloud FTP, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for Cloud FTP, see Cloud FTP client libraries. For more information, see the Cloud FTP Node.js API reference documentation.
To authenticate to Cloud FTP, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
To learn how to install and use the client library for Cloud FTP, see Cloud FTP client libraries. For more information, see the Cloud FTP PHP API reference documentation.
To authenticate to Cloud FTP, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To learn how to install and use the client library for Cloud FTP, see Cloud FTP client libraries. For more information, see the Cloud FTP Python API reference documentation.
To authenticate to Cloud FTP, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
To learn how to install and use the client library for Cloud FTP, see Cloud FTP client libraries. For more information, see the Cloud FTP Ruby API reference documentation.
To authenticate to Cloud FTP, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.