内部 SFTP サーバーを作成する

このドキュメントでは、Cloud FTP を使用して内部 SFTP サーバーを作成する方法について説明します。内部 SFTP サーバーには、Private Service Connect を使用して Virtual Private Cloud(VPC)ネットワーク内からのみアクセスできます。ネットワーク内の従業員と内部関係者は、サーバーを使用して Cloud Storage との間でファイルを安全に転送できます。

サーバーへの接続を許可するプロジェクトを指定します。必要に応じて、接続が拒否されるプロジェクトを指定できます。

VPC の背景情報については、VPC の概要をご覧ください。

インターネット経由でアクセスできる外部サーバーを作成する手順については、外部 SFTP サーバーを作成するをご覧ください。サーバーの作成後に、サーバーが外部か内部かを変更することはできません。

始める前に

コンソール

  1. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  2. If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Cloud FTP API, if it is not already enabled.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the API

  5. サーバーのユーザーに関する次の情報を収集します。

    • サーバーへのアクセスが許可されているプロジェクト ID またはプロジェクト番号のリスト。
    • (省略可)サーバーへのアクセスが拒否されたプロジェクト ID またはプロジェクト番号のリスト。

gcloud

  1. Google Cloud CLI をインストールします。

  2. フェデレーション ID(連携 ID)を使用するように gcloud CLI を構成します。

    詳細については、 フェデレーション ID を使用して gcloud CLI にログインするをご覧ください。

  3. gcloud CLI を初期化するには、次のコマンドを実行します。

    gcloud init
  4. Google Cloud プロジェクトを作成または選択します。

    プロジェクトの選択または作成に必要なロール

    • プロジェクトを選択する: プロジェクトを選択する際に、特定の IAM ロールは必要ありません。ロールが付与されているプロジェクトを選択できます。
    • プロジェクトを作成する: プロジェクトを作成するには、resourcemanager.projects.create 権限を含むプロジェクト作成者のロール(roles/resourcemanager.projectCreator)が必要です。詳しくは、ロールを付与する方法をご覧ください。
    • Google Cloud プロジェクトを作成します。

      gcloud projects create PROJECT_ID

      PROJECT_ID は、作成する Google Cloud プロジェクトの名前に置き換えます。

    • 作成した Google Cloud プロジェクトを選択します。

      gcloud config set project PROJECT_ID

      PROJECT_ID は、 Google Cloud プロジェクト名に置き換えます。

  5. このガイドで既存のプロジェクトを使用する場合は、このガイドを完了するために必要な権限があることを確認します。新しいプロジェクトを作成した場合は、必要な権限がすでに付与されています。

  6. Google Cloud プロジェクトに対して課金が有効になっていることを確認します。

  7. Cloud FTP API が有効になっていない場合は、有効にします。

    API を有効にするために必要なロール

    API を有効にするには、serviceusage.services.enable 権限が必要です。プロジェクトを作成した場合は、オーナーロール(roles/owner)を介してこの権限がすでに付与されている可能性があります。それ以外の場合は、Service Usage 管理者ロール(roles/serviceusage.serviceUsageAdmin)を介してこの権限を取得できます。ロールを付与する方法を学習する。

    gcloud services enable ftp.googleapis.com
  8. サーバーのユーザーに関する次の情報を収集します。

    • サーバーへのアクセスが許可されているプロジェクト ID またはプロジェクト番号のリスト。
    • (省略可)サーバーへのアクセスが拒否されたプロジェクト ID またはプロジェクト番号のリスト。

必要なロール

SFTP サーバーの作成に必要な権限を取得するには、プロジェクトに対する Cloud FTP 管理者 (roles/ftp.admin)IAM ロールを付与するよう管理者に依頼してください。ロールの付与については、プロジェクト、フォルダ、組織に対するアクセス権の管理をご覧ください。

この事前定義ロールには、SFTP サーバーの作成に必要な ftp.servers.create 権限が含まれています。

カスタムロールや他の事前定義ロールを使用して、この権限を取得することもできます。

内部サーバーを作成する

コンソール

  1. Google Cloud コンソールで、[Cloud FTP] ページに移動します。

    [Cloud FTP] に移動

  2. [サーバーを作成] をクリックします。

  3. [サーバー構成] タブで、サーバーの基本情報を入力します。

    1. [サーバー ID] フィールドに、サーバーの一意の ID を入力します。

    2. [リージョン] リストで、サーバーの Google Cloud ロケーションを選択します。

      データ転送速度を最速にするには、データを保存する Cloud Storage バケットと同じロケーションにサーバーを作成します。バケットのロケーションが Cloud FTP でサポートされていない場合は、最も近い利用可能なロケーションを選択します。

    3. (省略可)サーバーの表示名を入力します。

    4. [続行] をクリックします。

  4. [ネットワーキングとセキュリティ] タブで、サーバーの接続を構成します。

    1. [内部(VPC のみ)] を選択します。

    2. [承認済みプロジェクト] セクションで、Private Service Connect を使用してサーバーに接続できるコンシューマー プロジェクトを指定します。手順は次のとおりです。

      1. [プロジェクト] フィールドに、接続が許可されているプロジェクトのプロジェクト ID または番号を入力します。例: example-allowed-project

      2. [接続上限] フィールドに、コンシューマー プロジェクトで作成できる Private Service Connect エンドポイントの最大数を入力します。値は 1 ~ 250 のエンドポイントにする必要があります。

      3. プロジェクトをさらに追加するには、[承認済みプロジェクトを追加] をクリックして、前の手順を繰り返します。

    3. (省略可)プロジェクトがサーバーに接続できないようにするには、[不承認となったプロジェクト] セクションで [不承認となったプロジェクトを追加] をクリックします。サーバーへの接続が禁止されているコンシューマー プロジェクトのプロジェクト ID または番号を入力します。

      このリストに含まれるプロジェクトは、許可されたプロジェクトのリストに含まれていても、サーバーへのアクセスが拒否されます。

  5. [作成] をクリックします。

    サーバーの作成には約 10 分かかります。

gcloud

内部サーバーを作成するには、gcloud alpha storage ftp servers create コマンドを実行して --access-type=INTERNAL フラグを指定します。

後述のコマンドデータを使用する前に、次のように置き換えます。

  • SERVER_ID: サーバーの一意の ID。先頭は英小文字に、末尾は英小文字または数字にする必要があります。使用できるのは英小文字、数字、ハイフンのみです。接頭辞 goog で始めることはできません。また、google という文字列(g00gle などの類似する表記を含む)を含めることはできません。最大文字数は 30 文字です。
  • LOCATION_ID: サーバーの Google Cloud ロケーション(us-west1 など)。

    データ転送速度を最速にするには、データを保存する Cloud Storage バケットと同じロケーションにサーバーを作成します。バケットのロケーションが Cloud FTP でサポートされていない場合は、最も近い利用可能なロケーションを選択します。

  • PROJECT_TO_ALLOW: Private Service Connect を使用してサーバーに接続できるコンシューマー プロジェクトのプロジェクト ID または番号。例: example-allowed-project少なくとも 1 つのプロジェクトを指定する必要があります。

    最大 500 個のプロジェクトを許可できます。複数のプロジェクトとその接続上限をカンマ区切りのリストで指定します。例: --consumer-accept-list=projectA=20,projectB=15

  • CONNECTION_LIMIT: コンシューマー プロジェクトで作成できる Private Service Connect エンドポイントの最大数。値は 1 ~ 250 のエンドポイントにする必要があります。
  • (省略可)PROJECT_TO_REJECT: サーバーへの接続が禁止されているコンシューマ プロジェクトのプロジェクト ID またはプロジェクト番号。例: example-rejected-project。このリストに含まれるプロジェクトは、許可されたプロジェクトのリストに含まれていても、サーバーへのアクセスが拒否されます。

    拒否できるプロジェクトは最大 64 個です。複数のプロジェクトをカンマ区切りのリストで指定します。

    プロジェクトを明示的に拒否しない場合は、--consumer-reject-list フラグを省略します。

次のコマンドを実行します。

Linux、macOS、Cloud Shell

gcloud alpha storage ftp servers create SERVER_ID --access-type=INTERNAL \
    --location=LOCATION_ID \
    --consumer-accept-list=PROJECT_TO_ALLOW=CONNECTION_LIMIT \
    --consumer-reject-list=PROJECT_TO_REJECT

Windows(PowerShell)

gcloud alpha storage ftp servers create SERVER_ID --access-type=INTERNAL `
    --location=LOCATION_ID `
    --consumer-accept-list=PROJECT_TO_ALLOW=CONNECTION_LIMIT `
    --consumer-reject-list=PROJECT_TO_REJECT

Windows(cmd.exe)

gcloud alpha storage ftp servers create SERVER_ID --access-type=INTERNAL ^
    --location=LOCATION_ID ^
    --consumer-accept-list=PROJECT_TO_ALLOW=CONNECTION_LIMIT ^
    --consumer-reject-list=PROJECT_TO_REJECT

サーバーの作成には約 10 分かかります。

REST

内部サーバーを作成するには、servers.create メソッドを使用し、internalConfig アクセス構成を指定します。

リクエストのデータを使用する前に、次のように置き換えます。

  • PROJECT_ID: サーバーの Google Cloud プロジェクト ID。
  • LOCATION_ID: サーバーの Google Cloud ロケーション(us-west1 など)。

    データ転送速度を最速にするには、データを保存する Cloud Storage バケットと同じロケーションにサーバーを作成します。バケットのロケーションが Cloud FTP でサポートされていない場合は、最も近い利用可能なロケーションを選択します。

  • SERVER_ID: サーバーの一意の ID。先頭は英小文字に、末尾は英小文字または数字にする必要があります。使用できるのは英小文字、数字、ハイフンのみです。接頭辞 goog で始めることはできません。また、google という文字列(g00gle などの類似する表記を含む)を含めることはできません。最大文字数は 30 文字です。
  • PROJECT_TO_ALLOW: Private Service Connect を使用してサーバーに接続できるコンシューマー プロジェクトのプロジェクト ID または番号。例: example-allowed-project少なくとも 1 つのプロジェクトを指定する必要があります。

    最大 500 個のプロジェクトを許可できます。

  • CONNECTION_LIMIT: コンシューマー プロジェクトで作成できる Private Service Connect エンドポイントの最大数。値は 1 ~ 250 のエンドポイントにする必要があります。
  • (省略可)PROJECT_TO_REJECT: サーバーへの接続が禁止されているコンシューマ プロジェクトのプロジェクト ID またはプロジェクト番号。例: example-rejected-project。このリストに含まれるプロジェクトは、許可されたプロジェクトのリストに含まれていても、サーバーへのアクセスが拒否されます。

    拒否できるプロジェクトは最大 64 個です。

    プロジェクトを明示的に拒否しない場合は、consumerRejectList オブジェクトを省略します。

HTTP メソッドと URL:

POST https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers?serverId=SERVER_ID

リクエストの本文(JSON):

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

リクエストを送信するには、次のいずれかのオプションを展開します。

レスポンスで長時間実行オペレーションを識別できます。

サーバーの作成には約 10 分かかります。

クライアント ライブラリ

内部サーバーを作成するには、アクセスタイプを内部に設定し、内部アクセス構成を指定します。

C#

Cloud FTP 用のクライアント ライブラリをインストールして使用する方法については、Cloud FTP クライアント ライブラリをご覧ください。 詳細については、Cloud FTP C# API のリファレンス ドキュメントをご覧ください。

Cloud FTP に対する認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

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

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

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

Cloud FTP 用のクライアント ライブラリをインストールして使用する方法については、Cloud FTP クライアント ライブラリをご覧ください。 詳細については、Cloud FTP Go API のリファレンス ドキュメントをご覧ください。

Cloud FTP に対する認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。


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

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

Java

Cloud FTP 用のクライアント ライブラリをインストールして使用する方法については、Cloud FTP クライアント ライブラリをご覧ください。 詳細については、Cloud FTP Java API のリファレンス ドキュメントをご覧ください。

Cloud FTP に対する認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

import com.google.api.core.ApiFuture;
import com.google.cloud.ftp.v1.CloudFtpClient;
import com.google.cloud.ftp.v1.CreateServerRequest;
import com.google.cloud.ftp.v1.LocationName;
import com.google.cloud.ftp.v1.Server;
import com.google.longrunning.Operation;

public class AsyncCreateServer {

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

  public static void asyncCreateServer() 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()) {
      CreateServerRequest request =
          CreateServerRequest.newBuilder()
              .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
              .setServerId("serverId1379103678")
              .setServer(Server.newBuilder().build())
              .setRequestId("requestId693933066")
              .build();
      ApiFuture<Operation> future = cloudFtpClient.createServerCallable().futureCall(request);
      // Do something.
      Operation response = future.get();
    }
  }
}

Node.js

Cloud FTP 用のクライアント ライブラリをインストールして使用する方法については、Cloud FTP クライアント ライブラリをご覧ください。 詳細については、Cloud FTP Node.js API のリファレンス ドキュメントをご覧ください。

Cloud FTP に対する認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

/**
 * 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. Value for parent.
 */
// const parent = 'abc123'
/**
 *  Required. A unique ID for the server. Must start with a lowercase letter,
 *  and end with a lowercase letter or number. Can contain lowercase letters,
 *  numbers, and hyphens. Maximum length is 30 characters.
 */
// const serverId = 'abc123'
/**
 *  Required. The resource being created
 */
// 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 callCreateServer() {
  // Construct request
  const request = {
    parent,
    serverId,
    server,
  };

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

callCreateServer();

PHP

Cloud FTP 用のクライアント ライブラリをインストールして使用する方法については、Cloud FTP クライアント ライブラリをご覧ください。 詳細については、Cloud FTP PHP API のリファレンス ドキュメントをご覧ください。

Cloud FTP に対する認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

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

/**
 * Creates a new Server in a given project and location.
 *
 * @param string $formattedParent  Value for parent. Please see
 *                                 {@see CloudFtpClient::locationName()} for help formatting this field.
 * @param string $serverId         A unique ID for the server. Must start with a lowercase letter,
 *                                 and end with a lowercase letter or number. Can contain lowercase letters,
 *                                 numbers, and hyphens. Maximum length is 30 characters.
 * @param int    $serverAccessType The access type of the Server.
 */
function create_server_sample(
    string $formattedParent,
    string $serverId,
    int $serverAccessType
): void {
    // Create a client.
    $cloudFtpClient = new CloudFtpClient();

    // Prepare the request message.
    $server = (new Server())
        ->setAccessType($serverAccessType);
    $request = (new CreateServerRequest())
        ->setParent($formattedParent)
        ->setServerId($serverId)
        ->setServer($server);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudFtpClient->createServer($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
{
    $formattedParent = CloudFtpClient::locationName('[PROJECT]', '[LOCATION]');
    $serverId = '[SERVER_ID]';
    $serverAccessType = AccessType::ACCESS_TYPE_UNSPECIFIED;

    create_server_sample($formattedParent, $serverId, $serverAccessType);
}

Python

Cloud FTP 用のクライアント ライブラリをインストールして使用する方法については、Cloud FTP クライアント ライブラリをご覧ください。 詳細については、Cloud FTP Python API のリファレンス ドキュメントをご覧ください。

Cloud FTP に対する認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

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

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

    request = ftp_v1.CreateServerRequest(
        parent="parent_value",
        server_id="server_id_value",
        server=server,
    )

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

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

    response = operation.result()

    # Handle the response
    print(response)

Ruby

Cloud FTP 用のクライアント ライブラリをインストールして使用する方法については、Cloud FTP クライアント ライブラリをご覧ください。 詳細については、Cloud FTP Ruby API のリファレンス ドキュメントをご覧ください。

Cloud FTP に対する認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

require "google/cloud/ftp/v1"

##
# Snippet for the create_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#create_server.
#
def create_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::CreateServerRequest.new

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

次のステップ