Get SFTP server information

This document shows how to get information about your Cloud FTP servers. You can list all SFTP servers in a project and location. You can also get detailed information about a specific server, such as the server's state and its connection details.

Required roles

To get the permissions that you need to get information about SFTP servers, ask your administrator to grant you the Cloud FTP Viewer (roles/ftp.viewer) IAM role on your project. For more information about granting roles, see Manage access to projects, folders, and organizations.

This predefined role contains the permissions required to get information about SFTP servers. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

The following permissions are required to get information about SFTP servers:

  • List servers: ftp.servers.list
  • Get server details: ftp.servers.get

You might also be able to get these permissions with custom roles or other predefined roles.

List servers

gcloud

To list SFTP servers, run the gcloud alpha storage ftp servers list command.

Before using any of the command data below, make the following replacements:

  • 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 list --location=LOCATION_ID

Windows (PowerShell)

gcloud alpha storage ftp servers list --location=LOCATION_ID

Windows (cmd.exe)

gcloud alpha storage ftp servers list --location=LOCATION_ID

REST

To list SFTP servers, use the servers.list 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.

HTTP method and URL:

GET https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers

To send your request, expand one of these options:

The response body is a JSON object with a list of Server resources.

Get details about a server

To get detailed information about a specific server, including the server's IP address or service attachment, state, credentials, and the service agent email address, use the following steps.

gcloud

To get details about an SFTP server, run the gcloud alpha storage ftp servers describe 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 describe SERVER_ID --location=LOCATION_ID

Windows (PowerShell)

gcloud alpha storage ftp servers describe SERVER_ID --location=LOCATION_ID

Windows (cmd.exe)

gcloud alpha storage ftp servers describe SERVER_ID --location=LOCATION_ID

REST

To get details about an SFTP server, use the servers.get 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:

GET 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 body is a Server resource.