Avviare o interrompere un server SFTP

Puoi arrestare o avviare un server SFTP per gestirne lo stato, controllare l'accesso e ottimizzare i costi.

L'arresto di un server disabilita l'accesso e riduce l'utilizzo delle risorse. Ad esempio, se sospetti un accesso non autorizzato a un server, puoi interrompere tutti i trasferimenti attivi e bloccare le nuove connessioni arrestando il server. Un altro esempio è la riduzione dei costi di uptime del server mettendo in pausa un server durante i periodi in cui non sono previsti trasferimenti di dati.

Quando avvii un server, l'accesso viene ripristinato e gli utenti possono connettersi al server.

Ruoli obbligatori

Per ottenere l'autorizzazione necessaria per avviare o arrestare un server SFTP, chiedi all'amministratore di concederti il ruolo IAM Cloud FTP Admin (roles/ftp.admin) nel progetto. Per saperne di più sulla concessione dei ruoli, consulta Gestisci l'accesso a progetti, cartelle e organizzazioni.

Questo ruolo predefinito contiene l'autorizzazione ftp.servers.update necessaria per avviare o arrestare un server SFTP.

Potresti anche ottenere questa autorizzazione con ruoli personalizzati o altri ruoli predefiniti.

Arresta un server

Quando arresti un server, si verifica quanto segue:

  • L'accesso viene negato e le connessioni attive vengono interrotte. Gli utenti con una connessione attiva potrebbero visualizzare un messaggio di errore simile al seguente:

    Connection is terminated: Connection closed by remote host
    client_loop: send disconnect: Broken pipe
    Connection closed
    
  • Non è possibile stabilire nuove connessioni.

Per arrestare un server, segui questi passaggi.

REST

Per arrestare un server, utilizza il metodo servers.stop.

Prima di utilizzare i dati della richiesta, apporta le sostituzioni seguenti:

  • PROJECT_ID: l' Google Cloud ID progetto del server.
  • LOCATION_ID: la Google Cloud località del server, ad esempio us-west1.
  • SERVER_ID: l'ID server.

Metodo HTTP e URL:

POST https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID:stop

Per inviare la richiesta, espandi una di queste opzioni:

La risposta identifica un'operazione a lunga esecuzione.

Librerie client

C#

Per scoprire come installare e utilizzare la libreria client per Cloud FTP, consulta Librerie client di Cloud FTP. Per saperne di più, consulta la documentazione di riferimento dell'API Cloud FTP C#.

Per eseguire l'autenticazione in Cloud FTP, configura le Credenziali predefinite dell'applicazione. Per saperne di più, consulta Configura l'autenticazione per un ambiente di sviluppo locale.

using Google.Cloud.Ftp.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedCloudFtpClientSnippets
{
    /// <summary>Snippet for StopServerAsync</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 StopServerAsync()
    {
        // Create client
        CloudFtpClient cloudFtpClient = await CloudFtpClient.CreateAsync();
        // Initialize request argument(s)
        string name = "projects/[PROJECT]/locations/[LOCATION]/servers/[SERVER]";
        // Make the request
        Operation<Server, OperationMetadata> response = await cloudFtpClient.StopServerAsync(name);

        // 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.PollOnceStopServerAsync(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

Per scoprire come installare e utilizzare la libreria client per Cloud FTP, consulta Librerie client di Cloud FTP. Per saperne di più, consulta la documentazione di riferimento dell'API Cloud FTP Go.

Per eseguire l'autenticazione in Cloud FTP, configura le Credenziali predefinite dell'applicazione. Per saperne di più, consulta Configura l'autenticazione per un ambiente di sviluppo locale.


//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.StopServerRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/ftp/apiv1/ftppb#StopServerRequest.
	}
	op, err := c.StopServer(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

Java

Per scoprire come installare e utilizzare la libreria client per Cloud FTP, consulta la sezione Librerie client di Cloud FTP. Per saperne di più, consulta la documentazione di riferimento dell'API Cloud FTP Java.

Per eseguire l'autenticazione in Cloud FTP, configura le Credenziali predefinite dell'applicazione. Per saperne di più, consulta Configura l'autenticazione per un ambiente di sviluppo locale.

import com.google.api.core.ApiFuture;
import com.google.cloud.ftp.v1.CloudFtpClient;
import com.google.cloud.ftp.v1.ServerName;
import com.google.cloud.ftp.v1.StopServerRequest;
import com.google.longrunning.Operation;

public class AsyncStopServer {

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

  public static void asyncStopServer() 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()) {
      StopServerRequest request =
          StopServerRequest.newBuilder()
              .setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
              .build();
      ApiFuture<Operation> future = cloudFtpClient.stopServerCallable().futureCall(request);
      // Do something.
      Operation response = future.get();
    }
  }
}

Node.js

Per scoprire come installare e utilizzare la libreria client per Cloud FTP, consulta Librerie client di Cloud FTP. Per saperne di più, consulta la documentazione di riferimento dell'API Cloud FTP Node.js.

Per eseguire l'autenticazione in Cloud FTP, configura le Credenziali predefinite dell'applicazione. Per saperne di più, consulta Configura l'autenticazione per un ambiente di sviluppo locale.

/**
 * 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.
 */
/**
 *  Required. Name of the resource.
 *  Format: `projects/{project}/locations/{location}/servers/{server}`
 */
// const name = 'abc123'

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

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

async function callStopServer() {
  // Construct request
  const request = {
    name,
  };

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

callStopServer();

PHP

Per scoprire come installare e utilizzare la libreria client per Cloud FTP, consulta la sezione Librerie client di Cloud FTP. Per saperne di più, consulta la documentazione di riferimento dell'API Cloud FTP PHP.

Per eseguire l'autenticazione in Cloud FTP, configura le Credenziali predefinite dell'applicazione. Per saperne di più, consulta Configura l'autenticazione per un ambiente di sviluppo locale.

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\StopServerRequest;
use Google\Rpc\Status;

/**
 * Stops an active Server.
 *
 * @param string $formattedName Name of the resource.
 *                              Format: `projects/{project}/locations/{location}/servers/{server}`
 *                              Please see {@see CloudFtpClient::serverName()} for help formatting this field.
 */
function stop_server_sample(string $formattedName): void
{
    // Create a client.
    $cloudFtpClient = new CloudFtpClient();

    // Prepare the request message.
    $request = (new StopServerRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudFtpClient->stopServer($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
{
    $formattedName = CloudFtpClient::serverName('[PROJECT]', '[LOCATION]', '[SERVER]');

    stop_server_sample($formattedName);
}

Python

Per scoprire come installare e utilizzare la libreria client per Cloud FTP, consulta Librerie client di Cloud FTP. Per saperne di più, consulta la documentazione di riferimento dell'API Cloud FTP Python.

Per eseguire l'autenticazione in Cloud FTP, configura le Credenziali predefinite dell'applicazione. Per saperne di più, consulta Configura l'autenticazione per un ambiente di sviluppo locale.

# 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_stop_server():
    # Create a client
    client = ftp_v1.CloudFtpClient()

    # Initialize request argument(s)
    request = ftp_v1.StopServerRequest(
        name="name_value",
    )

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

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

    response = operation.result()

    # Handle the response
    print(response)

Ruby

Per scoprire come installare e utilizzare la libreria client per Cloud FTP, consulta la sezione Librerie client di Cloud FTP. Per saperne di più, consulta la documentazione di riferimento dell'API Cloud FTP Ruby.

Per eseguire l'autenticazione in Cloud FTP, configura le Credenziali predefinite dell'applicazione. Per saperne di più, consulta Configura l'autenticazione per un ambiente di sviluppo locale.

require "google/cloud/ftp/v1"

##
# Snippet for the stop_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#stop_server.
#
def stop_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::StopServerRequest.new

  # Call the stop_server method.
  result = client.stop_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

Avvia un server

REST

Per avviare un server, utilizza il metodo servers.start.

Prima di utilizzare i dati della richiesta, apporta le sostituzioni seguenti:

  • PROJECT_ID: l'ID progetto Google Cloud del server.
  • LOCATION_ID: la Google Cloud posizione del server, ad esempio us-west1.
  • SERVER_ID: l'ID server.

Metodo HTTP e URL:

POST https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID:start

Per inviare la richiesta, espandi una di queste opzioni:

La risposta identifica un'operazione a lunga esecuzione. L'avvio del server richiede alcuni minuti.

Librerie client

C#

Per scoprire come installare e utilizzare la libreria client per Cloud FTP, consulta Librerie client di Cloud FTP. Per saperne di più, consulta la documentazione di riferimento dell'API Cloud FTP C#.

Per eseguire l'autenticazione in Cloud FTP, configura le Credenziali predefinite dell'applicazione. Per saperne di più, consulta Configura l'autenticazione per un ambiente di sviluppo locale.

using Google.Cloud.Ftp.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedCloudFtpClientSnippets
{
    /// <summary>Snippet for StartServerAsync</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 StartServerAsync()
    {
        // Create client
        CloudFtpClient cloudFtpClient = await CloudFtpClient.CreateAsync();
        // Initialize request argument(s)
        string name = "projects/[PROJECT]/locations/[LOCATION]/servers/[SERVER]";
        // Make the request
        Operation<Server, OperationMetadata> response = await cloudFtpClient.StartServerAsync(name);

        // 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.PollOnceStartServerAsync(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

Per scoprire come installare e utilizzare la libreria client per Cloud FTP, consulta Librerie client di Cloud FTP. Per saperne di più, consulta la documentazione di riferimento dell'API Cloud FTP Go.

Per eseguire l'autenticazione in Cloud FTP, configura le Credenziali predefinite dell'applicazione. Per saperne di più, consulta Configura l'autenticazione per un ambiente di sviluppo locale.


//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.StartServerRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/ftp/apiv1/ftppb#StartServerRequest.
	}
	op, err := c.StartServer(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

Java

Per scoprire come installare e utilizzare la libreria client per Cloud FTP, consulta la sezione Librerie client di Cloud FTP. Per saperne di più, consulta la documentazione di riferimento dell'API Cloud FTP Java.

Per eseguire l'autenticazione in Cloud FTP, configura le Credenziali predefinite dell'applicazione. Per saperne di più, consulta Configura l'autenticazione per un ambiente di sviluppo locale.

import com.google.api.core.ApiFuture;
import com.google.cloud.ftp.v1.CloudFtpClient;
import com.google.cloud.ftp.v1.ServerName;
import com.google.cloud.ftp.v1.StartServerRequest;
import com.google.longrunning.Operation;

public class AsyncStartServer {

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

  public static void asyncStartServer() 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()) {
      StartServerRequest request =
          StartServerRequest.newBuilder()
              .setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
              .build();
      ApiFuture<Operation> future = cloudFtpClient.startServerCallable().futureCall(request);
      // Do something.
      Operation response = future.get();
    }
  }
}

Node.js

Per scoprire come installare e utilizzare la libreria client per Cloud FTP, consulta la sezione Librerie client di Cloud FTP. Per saperne di più, consulta la documentazione di riferimento dell'API Cloud FTP Node.js.

Per eseguire l'autenticazione in Cloud FTP, configura le Credenziali predefinite dell'applicazione. Per saperne di più, consulta Configura l'autenticazione per un ambiente di sviluppo locale.

/**
 * 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.
 */
/**
 *  Required. Name of the resource
 *  Format: `projects/{project}/locations/{location}/servers/{server}`
 */
// const name = 'abc123'

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

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

async function callStartServer() {
  // Construct request
  const request = {
    name,
  };

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

callStartServer();

PHP

Per scoprire come installare e utilizzare la libreria client per Cloud FTP, consulta la sezione Librerie client di Cloud FTP. Per saperne di più, consulta la documentazione di riferimento dell'API Cloud FTP PHP.

Per eseguire l'autenticazione in Cloud FTP, configura le Credenziali predefinite dell'applicazione. Per saperne di più, consulta Configura l'autenticazione per un ambiente di sviluppo locale.

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\StartServerRequest;
use Google\Rpc\Status;

/**
 * Starts a stopping/stopped Server.
 *
 * @param string $formattedName Name of the resource
 *                              Format: `projects/{project}/locations/{location}/servers/{server}`
 *                              Please see {@see CloudFtpClient::serverName()} for help formatting this field.
 */
function start_server_sample(string $formattedName): void
{
    // Create a client.
    $cloudFtpClient = new CloudFtpClient();

    // Prepare the request message.
    $request = (new StartServerRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudFtpClient->startServer($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
{
    $formattedName = CloudFtpClient::serverName('[PROJECT]', '[LOCATION]', '[SERVER]');

    start_server_sample($formattedName);
}

Python

Per scoprire come installare e utilizzare la libreria client per Cloud FTP, consulta Librerie client di Cloud FTP. Per saperne di più, consulta la documentazione di riferimento dell'API Cloud FTP Python.

Per eseguire l'autenticazione in Cloud FTP, configura le Credenziali predefinite dell'applicazione. Per saperne di più, consulta Configura l'autenticazione per un ambiente di sviluppo locale.

# 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_start_server():
    # Create a client
    client = ftp_v1.CloudFtpClient()

    # Initialize request argument(s)
    request = ftp_v1.StartServerRequest(
        name="name_value",
    )

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

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

    response = operation.result()

    # Handle the response
    print(response)

Ruby

Per scoprire come installare e utilizzare la libreria client per Cloud FTP, consulta Librerie client di Cloud FTP. Per saperne di più, consulta la documentazione di riferimento dell'API Cloud FTP Ruby.

Per eseguire l'autenticazione in Cloud FTP, configura le Credenziali predefinite dell'applicazione. Per saperne di più, consulta Configura l'autenticazione per un ambiente di sviluppo locale.

require "google/cloud/ftp/v1"

##
# Snippet for the start_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#start_server.
#
def start_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::StartServerRequest.new

  # Call the start_server method.
  result = client.start_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

Passaggi successivi