You can update the users who are allowed to connect to a
Cloud FTP server by updating the server's access configuration.
You can also update metadata like the server's display name.

You can't change whether a server is external or internal after the server has
been created.

## Required roles


To get the permissions that
you need to update an SFTP server,

ask your administrator to grant you the
[Cloud FTP Admin](https://docs.cloud.google.com/iam/docs/roles-permissions/ftp.md.txt#ftp.admin) (`roles/ftp.admin`) IAM role on your project.


For more information about granting roles, see [Manage access to projects, folders, and organizations](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access.md.txt).


This predefined role contains

the permissions required to update an SFTP server. To see the exact permissions that are
required, expand the **Required permissions** section:


#### Required permissions

The following permissions are required to update an SFTP server:

- `ftp.servers.update`
- If you use the Google Cloud console to do this task:
  - `ftp.servers.list`
  - `ftp.servers.get`


You might also be able to get
these permissions
with [custom roles](https://docs.cloud.google.com/iam/docs/creating-custom-roles.md.txt) or
other [predefined roles](https://docs.cloud.google.com/iam/docs/roles-overview.md.txt#predefined).

## Update access for an external server

### Console

1. In the Google Cloud console, go to the **Cloud FTP** page.

   [Go to Cloud FTP](https://console.cloud.google.com/transfer/ftp-servers)
2. Click the server ID.

3. In the **External config** section, click
   **Edit external configuration**.

4. In the **Allowed IP ranges** field, specify the IP addresses that are
   allowed to access the server:

   - To allow access for an IP range, provide a CIDR block, and then
     press <kbd>Enter</kbd>. For example, `192.0.2.0/24`.
     To allow connections from all IP addresses, use `0.0.0.0/0`.

   - To remove access for an IP range, click
     **Remove**.

   You must provide at least one value, and can provide a maximum of
   500 CIDR blocks.
5. Click **Save**.

### gcloud

To update the access configuration for an external server, run the
[`gcloud alpha storage ftp servers update` command](https://docs.cloud.google.com/sdk/gcloud/reference/alpha/storage/ftp/servers/update.md.txt).
Provide the `--allowed-cidr-blocks` flag.

> [!CAUTION]
> **Caution:** The CIDR blocks that you provide in the request overwrite all existing values.


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

- <var translate="no">SERVER_ID</var>: the server ID.
- <var translate="no">LOCATION_ID</var>: the [location](https://docs.cloud.google.com/cloud-ftp/locations.md.txt) of the server, such as `us-west1`.
- <var translate="no">CIDR_BLOCK</var>: a CIDR block that is allowed to access the server. For example, `192.0.2.0/24`. You must provide at least one value, and can provide a maximum of 500 CIDR blocks in a comma-separated list. To allow connections from all IP addresses, use `0.0.0.0/0`.


Execute the

following

command:

#### Linux, macOS, or Cloud Shell

> [!NOTE]
> **Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](https://docs.cloud.google.com/sdk/gcloud/reference/init); or [gcloud auth login](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) and [gcloud config set project](https://docs.cloud.google.com/sdk/gcloud/reference/config/set.md.txt).

```bash
gcloud alpha storage ftp servers update SERVER_ID --location=LOCATION_ID \
    --allowed-cidr-blocks=CIDR_BLOCK
```

#### Windows (PowerShell)

> [!NOTE]
> **Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](https://docs.cloud.google.com/sdk/gcloud/reference/init); or [gcloud auth login](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) and [gcloud config set project](https://docs.cloud.google.com/sdk/gcloud/reference/config/set.md.txt).

```bash
gcloud alpha storage ftp servers update SERVER_ID --location=LOCATION_ID `
    --allowed-cidr-blocks=CIDR_BLOCK
```

#### Windows (cmd.exe)

> [!NOTE]
> **Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](https://docs.cloud.google.com/sdk/gcloud/reference/init); or [gcloud auth login](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) and [gcloud config set project](https://docs.cloud.google.com/sdk/gcloud/reference/config/set.md.txt).

```bash
gcloud alpha storage ftp servers update SERVER_ID --location=LOCATION_ID ^
    --allowed-cidr-blocks=CIDR_BLOCK
```
It takes a few seconds for the server to be updated.

<br />

### REST

To update the access configuration for an external server, use the
[`servers.patch` method](https://docs.cloud.google.com/cloud-ftp/reference/rest/v1/projects.locations.servers/patch).
In the `updateMask` query parameter, provide the `externalConfig` field.

> [!CAUTION]
> **Caution:** The CIDR blocks that you provide in the request overwrite all existing values.


Before using any of the request data,
make the following replacements:

- <var translate="no">PROJECT_ID</var>: the Google Cloud project ID of the server.
- <var translate="no">LOCATION_ID</var>: the [location](https://docs.cloud.google.com/cloud-ftp/locations.md.txt) of the server, such as `us-west1`.
- <var translate="no">SERVER_ID</var>: the server ID.
- <var translate="no">CIDR_BLOCK</var>: a CIDR block that is allowed to access the server. For example, `192.0.2.0/24`. You must provide at least one value, and can provide a maximum of 500 CIDR blocks . To allow connections from all IP addresses, use `0.0.0.0/0`.


HTTP method and URL:

```
PATCH https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID?updateMask=externalConfig
```


Request JSON body:

```
{
  "externalConfig": {
    "allowedCidrBlocks": [
      "CIDR_BLOCK"
    ]
  }
}
```

To send your request, expand one of these options:

#### curl (Linux, macOS, or Cloud Shell)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) , or by using [Cloud Shell](https://docs.cloud.google.com/shell/docs.md.txt), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list.md.txt).


Save the request body in a file named `request.json`,
and execute the following command:

```
curl -X PATCH \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "Content-Type: application/json; charset=utf-8" \
     -d @request.json \
     "https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID?updateMask=externalConfig"
```

#### PowerShell (Windows)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list.md.txt).


Save the request body in a file named `request.json`,
and execute the following command:

```
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
    -Method PATCH `
    -Headers $headers `
    -ContentType: "application/json; charset=utf-8" `
    -InFile request.json `
    -Uri "https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID?updateMask=externalConfig" | Select-Object -Expand Content
```
The response identifies a [long-running operation](https://docs.cloud.google.com/cloud-ftp/reference/rest/v1/projects.locations.operations.md.txt). It takes a few seconds for the server to be updated.

<br />

### Client libraries


### C#


To learn how to install and use the client library for Cloud FTP, see
[Cloud FTP client libraries](https://docs.cloud.google.com/cloud-ftp/reference/libraries.md.txt).


For more information, see the
[Cloud FTP C# API
reference documentation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Ftp.V1/latest).


To authenticate to Cloud FTP, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

```c#
using Google.Cloud.Ftp.V1;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;
using System.Threading.Tasks;

public sealed partial class GeneratedCloudFtpClientSnippets
{
    /// <summary>Snippet for UpdateServerAsync</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public async Task UpdateServerAsync()
    {
        // Create client
        CloudFtpClient cloudFtpClient = await CloudFtpClient.CreateAsync();
        // Initialize request argument(s)
        Server server = new Server();
        FieldMask updateMask = new FieldMask();
        // Make the request
        Operation<Server, OperationMetadata> response = await cloudFtpClient.UpdateServerAsync(server, updateMask);

        // Poll until the returned long-running operation is complete
        Operation<Server, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
        // Retrieve the operation result
        Server result = completedResponse.Result;

        // Or get the name of the operation
        string operationName = response.Name;
        // This name can be stored, then the long-running operation retrieved later by name
        Operation<Server, OperationMetadata> retrievedResponse = await cloudFtpClient.PollOnceUpdateServerAsync(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            Server retrievedResult = retrievedResponse.Result;
        }
    }
}
```

### Go


To learn how to install and use the client library for Cloud FTP, see
[Cloud FTP client libraries](https://docs.cloud.google.com/cloud-ftp/reference/libraries.md.txt).


For more information, see the
[Cloud FTP Go API
reference documentation](https://docs.cloud.google.com/go/docs/reference/cloud.google.com/go/ftp/latest/apiv1).


To authenticate to Cloud FTP, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

```go

//go:build examples

package main

import (
	"context"

	ftp "cloud.google.com/go/ftp/apiv1"
	ftppb "cloud.google.com/go/ftp/apiv1/ftppb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := ftp.NewCloudFtpRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &ftppb.UpdateServerRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/ftp/apiv1/ftppb#UpdateServerRequest.
	}
	op, err := c.UpdateServer(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
```

### Java


To learn how to install and use the client library for Cloud FTP, see
[Cloud FTP client libraries](https://docs.cloud.google.com/cloud-ftp/reference/libraries.md.txt).


For more information, see the
[Cloud FTP Java API
reference documentation](https://docs.cloud.google.com/java/docs/reference/google-cloud-ftp/latest/overview).


To authenticate to Cloud FTP, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

```java
import com.google.api.core.ApiFuture;
import com.google.cloud.ftp.v1.CloudFtpClient;
import com.google.cloud.ftp.v1.Server;
import com.google.cloud.ftp.v1.UpdateServerRequest;
import com.google.longrunning.Operation;
import com.google.protobuf.FieldMask;

public class AsyncUpdateServer {

  public static void main(String[] args) throws Exception {
    asyncUpdateServer();
  }

  public static void asyncUpdateServer() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
      UpdateServerRequest request =
          UpdateServerRequest.newBuilder()
              .setUpdateMask(FieldMask.newBuilder().build())
              .setServer(Server.newBuilder().build())
              .setRequestId("requestId693933066")
              .build();
      ApiFuture<Operation> future = cloudFtpClient.updateServerCallable().futureCall(request);
      // Do something.
      Operation response = future.get();
    }
  }
}
```

### Node.js


To learn how to install and use the client library for Cloud FTP, see
[Cloud FTP client libraries](https://docs.cloud.google.com/cloud-ftp/reference/libraries.md.txt).


For more information, see the
[Cloud FTP Node.js API
reference documentation](https://docs.cloud.google.com/nodejs/docs/reference/ftp/latest).


To authenticate to Cloud FTP, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

```javascript
/**
 * This snippet has been automatically generated and should be regarded as a code template only.
 * It will require modifications to work.
 * It may require correct/in-range values for request initialization.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  Optional. Field mask is used to specify the fields to be overwritten in the
 *  Server resource by the update.
 *  The fields specified in the update_mask are relative to the resource, not
 *  the full request. A field will be overwritten if it is in the mask. If the
 *  user does not provide a mask then all fields present in the request will be
 *  overwritten.
 */
// const updateMask = {}
/**
 *  Required. The resource being updated
 */
// const server = {}
/**
 *  Optional. An optional request ID to identify requests. Specify a unique
 *  request ID so that if you must retry your request, the server will know to
 *  ignore the request if it has already been completed. The server will
 *  guarantee that for at least 60 minutes since the first request.
 *  For example, consider a situation where you make an initial request and the
 *  request times out. If you make the request again with the same request
 *  ID, the server can check if original operation with the same request ID
 *  was received, and if so, will ignore the second request. This prevents
 *  clients from accidentally creating duplicate commitments.
 *  The request ID must be a valid UUID with the exception that zero UUID is
 *  not supported (00000000-0000-0000-0000-000000000000).
 */
// const requestId = 'abc123'

// Imports the Ftp library
const {CloudFtpClient} = require('@google-cloud/ftp').v1;

// Instantiates a client
const ftpClient = new CloudFtpClient();

async function callUpdateServer() {
  // Construct request
  const request = {
    server,
  };

  // Run request
  const [operation] = await ftpClient.updateServer(request);
  const [response] = await operation.promise();
  console.log(response);
}

callUpdateServer();
```

### PHP


To learn how to install and use the client library for Cloud FTP, see
[Cloud FTP client libraries](https://docs.cloud.google.com/cloud-ftp/reference/libraries.md.txt).


For more information, see the
[Cloud FTP PHP API
reference documentation](https://docs.cloud.google.com/php/docs/reference/cloud-ftp/latest).


To authenticate to Cloud FTP, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

```php
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Ftp\V1\Client\CloudFtpClient;
use Google\Cloud\Ftp\V1\Server;
use Google\Cloud\Ftp\V1\Server\AccessType;
use Google\Cloud\Ftp\V1\UpdateServerRequest;
use Google\Rpc\Status;

/**
 * Updates the parameters of a single Server.
 *
 * @param int $serverAccessType The access type of the Server.
 */
function update_server_sample(int $serverAccessType): void
{
    // Create a client.
    $cloudFtpClient = new CloudFtpClient();

    // Prepare the request message.
    $server = (new Server())
        ->setAccessType($serverAccessType);
    $request = (new UpdateServerRequest())
        ->setServer($server);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudFtpClient->updateServer($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Server $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $serverAccessType = AccessType::ACCESS_TYPE_UNSPECIFIED;

    update_server_sample($serverAccessType);
}
```

### Python


To learn how to install and use the client library for Cloud FTP, see
[Cloud FTP client libraries](https://docs.cloud.google.com/cloud-ftp/reference/libraries.md.txt).


For more information, see the
[Cloud FTP Python API
reference documentation](https://docs.cloud.google.com/python/docs/reference/google-cloud-ftp/latest).


To authenticate to Cloud FTP, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import ftp_v1


def sample_update_server():
    # Create a client
    client = ftp_v1.CloudFtpClient()

    # Initialize request argument(s)
    server = ftp_v1.Server()
    server.access_type = "INTERNAL"

    request = ftp_v1.UpdateServerRequest(
        server=server,
    )

    # Make the request
    operation = client.update_server(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)

```

### Ruby


To learn how to install and use the client library for Cloud FTP, see
[Cloud FTP client libraries](https://docs.cloud.google.com/cloud-ftp/reference/libraries.md.txt).


For more information, see the
[Cloud FTP Ruby API
reference documentation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ftp/latest).


To authenticate to Cloud FTP, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

```ruby
require "google/cloud/ftp/v1"

##
# Snippet for the update_server call in the CloudFtp service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Ftp::V1::CloudFtp::Rest::Client#update_server.
#
def update_server
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Ftp::V1::CloudFtp::Rest::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Ftp::V1::UpdateServerRequest.new

  # Call the update_server method.
  result = client.update_server request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end
```

<br />

## Update access for an internal server

### Console

1. In the Google Cloud console, go to the **Cloud FTP** page.

   [Go to Cloud FTP](https://console.cloud.google.com/transfer/ftp-servers)
2. Click the server ID.

3. In the **Internal config** section, click
   **Edit internal configuration**.

4. In the **Accepted projects** section, specify the consumer projects
   that are allowed to connect to the server by using
   Private Service Connect:

   - To allow a project, do the following:

     1. Click **Add accepted project**.

     2. In the **Project ID or number** field, enter the project ID or
        number of a project that is allowed to connect. For example,
        `example-allowed-project`.

     3. In the **Connection limit** field, enter the maximum number of
        Private Service Connect endpoints that can be
        created in the consumer project. The value must be from 1 to
        250
        endpoints.

   - To remove an allowed project, click
     **Delete accepted project**.

5. (Optional) In the **Rejected projects** section, specify the projects that
   are prohibited from connecting to the server:

   - To prohibit a project, click **Add rejected project**. Enter
     the project ID or number of a consumer project that is prohibited from
     connecting to the server.

     Projects in this list are rejected from accessing the server even if
     they are included in the list of allowed projects.
   - To remove a prohibited project, click
     **Delete rejected project**.

6. Click **Save**.

### gcloud

To update the access configuration for an internal server, run the
[`gcloud alpha storage ftp servers update` command](https://docs.cloud.google.com/sdk/gcloud/reference/alpha/storage/ftp/servers/update.md.txt).
Provide the `--consumer-accept-list` flag, and optionally provide the
`--consumer-reject-list` flag.

> [!CAUTION]
> **Caution:** The lists of allowed consumer projects and rejected consumer projects that you provide in the request overwrite all existing values.


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

- <var translate="no">SERVER_ID</var>: the server ID.
- <var translate="no">LOCATION_ID</var>: the [location](https://docs.cloud.google.com/cloud-ftp/locations.md.txt) of the server, such as `us-west1`.
- <var translate="no">PROJECT_TO_ALLOW</var>: the project ID or number of a consumer project that is allowed
  to connect to the server by using Private Service Connect. For example,
  `example-allowed-project`. You must specify at least one project.

  You can allow a maximum of 500 projects.
  Provide multiple projects and their respective
  connection limits in a comma-separated list. For example,
  `--consumer-accept-list=projectA=20,projectB=15`.
- <var translate="no">CONNECTION_LIMIT</var>: the maximum number of Private Service Connect endpoints that can be created in the consumer project. The value must be from 1 to 250 endpoints.
- (Optional) <var translate="no">PROJECT_TO_REJECT</var>: the project ID or number of a consumer project that is
  prohibited from connecting to the server. For example, `example-rejected-project`.
  Projects in this list are rejected from accessing the server even if they are included in the
  list of allowed projects.

  You can reject a maximum of 64 projects.
  Provide multiple projects in a comma-separated list.
  If you don't want to explicitly reject any projects, then omit the `--consumer-reject-list` flag.

  <br />


Execute the

following

command:

#### Linux, macOS, or Cloud Shell

> [!NOTE]
> **Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](https://docs.cloud.google.com/sdk/gcloud/reference/init); or [gcloud auth login](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) and [gcloud config set project](https://docs.cloud.google.com/sdk/gcloud/reference/config/set.md.txt).

```bash
gcloud alpha storage ftp servers update SERVER_ID --location=LOCATION_ID \
    --consumer-accept-list=PROJECT_TO_ALLOW=CONNECTION_LIMIT \
    --consumer-reject-list=PROJECT_TO_REJECT
```

#### Windows (PowerShell)

> [!NOTE]
> **Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](https://docs.cloud.google.com/sdk/gcloud/reference/init); or [gcloud auth login](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) and [gcloud config set project](https://docs.cloud.google.com/sdk/gcloud/reference/config/set.md.txt).

```bash
gcloud alpha storage ftp servers update SERVER_ID --location=LOCATION_ID `
    --consumer-accept-list=PROJECT_TO_ALLOW=CONNECTION_LIMIT `
    --consumer-reject-list=PROJECT_TO_REJECT
```

#### Windows (cmd.exe)

> [!NOTE]
> **Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](https://docs.cloud.google.com/sdk/gcloud/reference/init); or [gcloud auth login](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) and [gcloud config set project](https://docs.cloud.google.com/sdk/gcloud/reference/config/set.md.txt).

```bash
gcloud alpha storage ftp servers update SERVER_ID --location=LOCATION_ID ^
    --consumer-accept-list=PROJECT_TO_ALLOW=CONNECTION_LIMIT ^
    --consumer-reject-list=PROJECT_TO_REJECT
```
It takes a few seconds for the server to be updated.

<br />

### REST

To update the access configuration for an internal server, use the
[`servers.patch` method](https://docs.cloud.google.com/cloud-ftp/reference/rest/v1/projects.locations.servers/patch).
In the `updateMask` query parameter, provide the `internalConfig` field.

> [!CAUTION]
> **Caution:** The lists of allowed consumer projects and rejected consumer projects that you provide in the request overwrite all existing values.


Before using any of the request data,
make the following replacements:

- <var translate="no">PROJECT_ID</var>: the Google Cloud project ID of the server.
- <var translate="no">LOCATION_ID</var>: the [location](https://docs.cloud.google.com/cloud-ftp/locations.md.txt) of the server, such as `us-west1`.
- <var translate="no">SERVER_ID</var>: the server ID.
- <var translate="no">PROJECT_TO_ALLOW</var>: the project ID or number of a consumer project that is allowed
  to connect to the server by using Private Service Connect. For example,
  `example-allowed-project`. You must specify at least one project.

  You can allow a maximum of 500 projects.
- <var translate="no">CONNECTION_LIMIT</var>: the maximum number of Private Service Connect endpoints that can be created in the consumer project. The value must be from 1 to 250 endpoints.
- (Optional) <var translate="no">PROJECT_TO_REJECT</var>: the project ID or number of a consumer project that is
  prohibited from connecting to the server. For example, `example-rejected-project`.
  Projects in this list are rejected from accessing the server even if they are included in the
  list of allowed projects.

  You can reject a maximum of 64 projects.

  If you don't want to explicitly reject any projects, then omit the
  `consumerRejectList` object.


HTTP method and URL:

```
PATCH https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID?updateMask=internalConfig
```


Request JSON body:

```
{
  "internalConfig": {
    "consumerAcceptList": [
      {
        "project": "projects/PROJECT_TO_ALLOW",
        "connectionLimit": CONNECTION_LIMIT
      }
    ],
    "consumerRejectList": [
      {
        "project": "projects/PROJECT_TO_REJECT"
      }
    ]
  }
}
```

To send your request, expand one of these options:

#### curl (Linux, macOS, or Cloud Shell)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) , or by using [Cloud Shell](https://docs.cloud.google.com/shell/docs.md.txt), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list.md.txt).


Save the request body in a file named `request.json`,
and execute the following command:

```
curl -X PATCH \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "Content-Type: application/json; charset=utf-8" \
     -d @request.json \
     "https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID?updateMask=internalConfig"
```

#### PowerShell (Windows)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list.md.txt).


Save the request body in a file named `request.json`,
and execute the following command:

```
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
    -Method PATCH `
    -Headers $headers `
    -ContentType: "application/json; charset=utf-8" `
    -InFile request.json `
    -Uri "https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID?updateMask=internalConfig" | Select-Object -Expand Content
```
The response identifies a [long-running operation](https://docs.cloud.google.com/cloud-ftp/reference/rest/v1/projects.locations.operations.md.txt). It takes a few seconds for the server to be updated.

<br />

### Client libraries


### C#


To learn how to install and use the client library for Cloud FTP, see
[Cloud FTP client libraries](https://docs.cloud.google.com/cloud-ftp/reference/libraries.md.txt).


For more information, see the
[Cloud FTP C# API
reference documentation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Ftp.V1/latest).


To authenticate to Cloud FTP, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

```c#
using Google.Cloud.Ftp.V1;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;
using System.Threading.Tasks;

public sealed partial class GeneratedCloudFtpClientSnippets
{
    /// <summary>Snippet for UpdateServerAsync</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public async Task UpdateServerAsync()
    {
        // Create client
        CloudFtpClient cloudFtpClient = await CloudFtpClient.CreateAsync();
        // Initialize request argument(s)
        Server server = new Server();
        FieldMask updateMask = new FieldMask();
        // Make the request
        Operation<Server, OperationMetadata> response = await cloudFtpClient.UpdateServerAsync(server, updateMask);

        // Poll until the returned long-running operation is complete
        Operation<Server, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
        // Retrieve the operation result
        Server result = completedResponse.Result;

        // Or get the name of the operation
        string operationName = response.Name;
        // This name can be stored, then the long-running operation retrieved later by name
        Operation<Server, OperationMetadata> retrievedResponse = await cloudFtpClient.PollOnceUpdateServerAsync(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            Server retrievedResult = retrievedResponse.Result;
        }
    }
}
```

### Go


To learn how to install and use the client library for Cloud FTP, see
[Cloud FTP client libraries](https://docs.cloud.google.com/cloud-ftp/reference/libraries.md.txt).


For more information, see the
[Cloud FTP Go API
reference documentation](https://docs.cloud.google.com/go/docs/reference/cloud.google.com/go/ftp/latest/apiv1).


To authenticate to Cloud FTP, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

```go

//go:build examples

package main

import (
	"context"

	ftp "cloud.google.com/go/ftp/apiv1"
	ftppb "cloud.google.com/go/ftp/apiv1/ftppb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := ftp.NewCloudFtpRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &ftppb.UpdateServerRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/ftp/apiv1/ftppb#UpdateServerRequest.
	}
	op, err := c.UpdateServer(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
```

### Java


To learn how to install and use the client library for Cloud FTP, see
[Cloud FTP client libraries](https://docs.cloud.google.com/cloud-ftp/reference/libraries.md.txt).


For more information, see the
[Cloud FTP Java API
reference documentation](https://docs.cloud.google.com/java/docs/reference/google-cloud-ftp/latest/overview).


To authenticate to Cloud FTP, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

```java
import com.google.api.core.ApiFuture;
import com.google.cloud.ftp.v1.CloudFtpClient;
import com.google.cloud.ftp.v1.Server;
import com.google.cloud.ftp.v1.UpdateServerRequest;
import com.google.longrunning.Operation;
import com.google.protobuf.FieldMask;

public class AsyncUpdateServer {

  public static void main(String[] args) throws Exception {
    asyncUpdateServer();
  }

  public static void asyncUpdateServer() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
      UpdateServerRequest request =
          UpdateServerRequest.newBuilder()
              .setUpdateMask(FieldMask.newBuilder().build())
              .setServer(Server.newBuilder().build())
              .setRequestId("requestId693933066")
              .build();
      ApiFuture<Operation> future = cloudFtpClient.updateServerCallable().futureCall(request);
      // Do something.
      Operation response = future.get();
    }
  }
}
```

### Node.js


To learn how to install and use the client library for Cloud FTP, see
[Cloud FTP client libraries](https://docs.cloud.google.com/cloud-ftp/reference/libraries.md.txt).


For more information, see the
[Cloud FTP Node.js API
reference documentation](https://docs.cloud.google.com/nodejs/docs/reference/ftp/latest).


To authenticate to Cloud FTP, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

```javascript
/**
 * This snippet has been automatically generated and should be regarded as a code template only.
 * It will require modifications to work.
 * It may require correct/in-range values for request initialization.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  Optional. Field mask is used to specify the fields to be overwritten in the
 *  Server resource by the update.
 *  The fields specified in the update_mask are relative to the resource, not
 *  the full request. A field will be overwritten if it is in the mask. If the
 *  user does not provide a mask then all fields present in the request will be
 *  overwritten.
 */
// const updateMask = {}
/**
 *  Required. The resource being updated
 */
// const server = {}
/**
 *  Optional. An optional request ID to identify requests. Specify a unique
 *  request ID so that if you must retry your request, the server will know to
 *  ignore the request if it has already been completed. The server will
 *  guarantee that for at least 60 minutes since the first request.
 *  For example, consider a situation where you make an initial request and the
 *  request times out. If you make the request again with the same request
 *  ID, the server can check if original operation with the same request ID
 *  was received, and if so, will ignore the second request. This prevents
 *  clients from accidentally creating duplicate commitments.
 *  The request ID must be a valid UUID with the exception that zero UUID is
 *  not supported (00000000-0000-0000-0000-000000000000).
 */
// const requestId = 'abc123'

// Imports the Ftp library
const {CloudFtpClient} = require('@google-cloud/ftp').v1;

// Instantiates a client
const ftpClient = new CloudFtpClient();

async function callUpdateServer() {
  // Construct request
  const request = {
    server,
  };

  // Run request
  const [operation] = await ftpClient.updateServer(request);
  const [response] = await operation.promise();
  console.log(response);
}

callUpdateServer();
```

### PHP


To learn how to install and use the client library for Cloud FTP, see
[Cloud FTP client libraries](https://docs.cloud.google.com/cloud-ftp/reference/libraries.md.txt).


For more information, see the
[Cloud FTP PHP API
reference documentation](https://docs.cloud.google.com/php/docs/reference/cloud-ftp/latest).


To authenticate to Cloud FTP, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

```php
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Ftp\V1\Client\CloudFtpClient;
use Google\Cloud\Ftp\V1\Server;
use Google\Cloud\Ftp\V1\Server\AccessType;
use Google\Cloud\Ftp\V1\UpdateServerRequest;
use Google\Rpc\Status;

/**
 * Updates the parameters of a single Server.
 *
 * @param int $serverAccessType The access type of the Server.
 */
function update_server_sample(int $serverAccessType): void
{
    // Create a client.
    $cloudFtpClient = new CloudFtpClient();

    // Prepare the request message.
    $server = (new Server())
        ->setAccessType($serverAccessType);
    $request = (new UpdateServerRequest())
        ->setServer($server);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudFtpClient->updateServer($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Server $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $serverAccessType = AccessType::ACCESS_TYPE_UNSPECIFIED;

    update_server_sample($serverAccessType);
}
```

### Python


To learn how to install and use the client library for Cloud FTP, see
[Cloud FTP client libraries](https://docs.cloud.google.com/cloud-ftp/reference/libraries.md.txt).


For more information, see the
[Cloud FTP Python API
reference documentation](https://docs.cloud.google.com/python/docs/reference/google-cloud-ftp/latest).


To authenticate to Cloud FTP, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

```python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import ftp_v1


def sample_update_server():
    # Create a client
    client = ftp_v1.CloudFtpClient()

    # Initialize request argument(s)
    server = ftp_v1.Server()
    server.access_type = "INTERNAL"

    request = ftp_v1.UpdateServerRequest(
        server=server,
    )

    # Make the request
    operation = client.update_server(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)

```

### Ruby


To learn how to install and use the client library for Cloud FTP, see
[Cloud FTP client libraries](https://docs.cloud.google.com/cloud-ftp/reference/libraries.md.txt).


For more information, see the
[Cloud FTP Ruby API
reference documentation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ftp/latest).


To authenticate to Cloud FTP, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

```ruby
require "google/cloud/ftp/v1"

##
# Snippet for the update_server call in the CloudFtp service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Ftp::V1::CloudFtp::Rest::Client#update_server.
#
def update_server
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Ftp::V1::CloudFtp::Rest::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Ftp::V1::UpdateServerRequest.new

  # Call the update_server method.
  result = client.update_server request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end
```

<br />

## Update a server's display name

### Console

1. In the Google Cloud console, go to the **Cloud FTP** page.

   [Go to Cloud FTP](https://console.cloud.google.com/transfer/ftp-servers)
2. Click the server ID.

3. Click **Edit display name**.

4. Enter a display name, and then click **Save**.

### gcloud

To update metadata such as the display name of an SFTP server, run the
[`gcloud alpha storage ftp servers update` command](https://docs.cloud.google.com/sdk/gcloud/reference/alpha/storage/ftp/servers/update.md.txt).


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

- <var translate="no">SERVER_ID</var>: the server ID.
- <var translate="no">LOCATION_ID</var>: the [location](https://docs.cloud.google.com/cloud-ftp/locations.md.txt) of the server, such as `us-west1`.
- <var translate="no">DISPLAY_NAME</var>: a display name for the server.


Execute the

following

command:

#### Linux, macOS, or Cloud Shell

> [!NOTE]
> **Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](https://docs.cloud.google.com/sdk/gcloud/reference/init); or [gcloud auth login](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) and [gcloud config set project](https://docs.cloud.google.com/sdk/gcloud/reference/config/set.md.txt).

```bash
gcloud alpha storage ftp servers update SERVER_ID --location=LOCATION_ID \
    --display-name="DISPLAY_NAME"
```

#### Windows (PowerShell)

> [!NOTE]
> **Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](https://docs.cloud.google.com/sdk/gcloud/reference/init); or [gcloud auth login](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) and [gcloud config set project](https://docs.cloud.google.com/sdk/gcloud/reference/config/set.md.txt).

```bash
gcloud alpha storage ftp servers update SERVER_ID --location=LOCATION_ID `
    --display-name="DISPLAY_NAME"
```

#### Windows (cmd.exe)

> [!NOTE]
> **Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](https://docs.cloud.google.com/sdk/gcloud/reference/init); or [gcloud auth login](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) and [gcloud config set project](https://docs.cloud.google.com/sdk/gcloud/reference/config/set.md.txt).

```bash
gcloud alpha storage ftp servers update SERVER_ID --location=LOCATION_ID ^
    --display-name="DISPLAY_NAME"
```
It takes a few seconds for the server to be updated.

<br />

### REST

To update metadata such as the display name of an SFTP server, use the
[`servers.patch` method](https://docs.cloud.google.com/cloud-ftp/reference/rest/v1/projects.locations.servers/patch).
In the `updateMask` query parameter, provide a comma-separated list of fields
to update. In the request body, provide a JSON object with the values to set.


Before using any of the request data,
make the following replacements:

- <var translate="no">PROJECT_ID</var>: the Google Cloud project ID of the server.
- <var translate="no">LOCATION_ID</var>: the [location](https://docs.cloud.google.com/cloud-ftp/locations.md.txt) of the server, such as `us-west1`.
- <var translate="no">SERVER_ID</var>: the server ID.
- <var translate="no">FIELDS_TO_UPDATE</var>: a comma-separated list of fields to update, relative to the server resource. For example, to update the display name, provide the query parameter `updateMask=displayName`.
- <var translate="no">DISPLAY_NAME</var>: a display name for the server.


HTTP method and URL:

```
PATCH https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID?updateMask=FIELDS_TO_UPDATE
```


Request JSON body:

```
{
  "displayName": "DISPLAY_NAME"
}
```

To send your request, expand one of these options:

#### curl (Linux, macOS, or Cloud Shell)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) , or by using [Cloud Shell](https://docs.cloud.google.com/shell/docs.md.txt), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list.md.txt).


Save the request body in a file named `request.json`,
and execute the following command:

```
curl -X PATCH \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "Content-Type: application/json; charset=utf-8" \
     -d @request.json \
     "https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID?updateMask=FIELDS_TO_UPDATE"
```

#### PowerShell (Windows)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list.md.txt).


Save the request body in a file named `request.json`,
and execute the following command:

```
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
    -Method PATCH `
    -Headers $headers `
    -ContentType: "application/json; charset=utf-8" `
    -InFile request.json `
    -Uri "https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID?updateMask=FIELDS_TO_UPDATE" | Select-Object -Expand Content
```
The response identifies a [long-running operation](https://docs.cloud.google.com/cloud-ftp/reference/rest/v1/projects.locations.operations.md.txt). It takes a few seconds for the server to be updated.

<br />