> For the complete documentation index, see [llms.txt](https://docs.keeper.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeper.io/keeperpam/jp/commander-sdk/keeper-commander-sdks/sdk-command-reference/keeperpam-commands/pam-gateway-commands.md).

# PAM Gatewayコマンド

Keeperゲートウェイは、管理対象環境でローテーション、検出、接続、トンネル接続を実行します。Docker、Linux、Windows上のホスト、VM、 クラスターにデプロイでき、1つのゲートウェイでオンプレミスとクラウドの両方に対応できます。

### Gateway Listコマンド <a href="#gateway-list-command" id="gateway-list-command"></a>

コマンダーユーザーがアクセス可能なすべてのゲートウェイを一覧表示します。対象は、ユーザーが自身のボルトから直接アクセスできるゲートウェイ、およびユーザーのロールに含まれる管理ノードのいずれかに登録されているゲートウェイです。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `pam-gateway list`

**別名**: `pam-gw list` / `pam-gw l`

**パラメーター**:

<table><thead><tr><th width="258">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>--online</code>, <code>-o</code></td><td>オンラインのゲートウェイのみ表示</td></tr><tr><td><code>--ignore-router</code></td><td>ルーターが利用できない場合に登録済みゲートウェイを一覧表示</td></tr><tr><td><code>--verbose</code>, <code>-v</code></td><td>詳細出力 (デバイス、ノード、OS情報、ルーターホスト)</td></tr><tr><td><code>--format {table,json}</code></td><td>出力形式。デフォルト: <code>table</code></td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```csharp
My Vault>  pam-gateway list
KSM Application Name (UID)                                Gateway Name                                                  Gateway UID             Status   Gateway Version
--------------------------------------------------------  ------------------------------------------------------------  ----------------------  -------  ---------------
New-G1 Application (B17aoEfDlasq23U369OIvpbvw)               New-G1 Gateway                                            Y-2M-dszTK6Eu3oiCmF50g  OFFLINE                 
[APP NOT ACCESSIBLE OR DELETED] (vHARyY3cQnaxdfr45O0FcxRtA)  snowPAM Gateway                                           qsww2tPDSriaR1kJnl6TIA  OFFLINE                 
```

{% endcode %}

</details>

<details>

<summary>DotNet SDK</summary>

**関数:**

```csharp
 public static async Task<IList<PamProto.PAMController>> GetAllGatewaysAsync(IAuthentication auth)
    {
      var response = (PamProto.PAMControllersResponse)await auth.ExecuteAuthRest(
        GetControllersEndpoint,
        null,
        typeof(PamProto.PAMControllersResponse));
      return response?.Controllers?.ToList() ?? new List<PamProto.PAMController>();
    }
```

</details>

<details>

<summary>Power Commander</summary>

**コマンド**: `Get-KeeperPamGatewayList`

**別名**: `pam-gateway-list` / `pam-gw-list`

**パラメーター**:

<table><thead><tr><th width="287">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>-Force</code>, <code>-f</code></td><td>ルーターが利用できない場合に登録済みゲートウェイを一覧表示</td></tr><tr><td><code>-VerboseOutput</code></td><td>ゲートウェイおよびルーターの詳細情報を出力</td></tr><tr><td><code>-Format {table,json}</code></td><td>出力形式。デフォルト: <code>table</code></td></tr><tr><td><code>-Online</code>, <code>-o</code></td><td>オンラインのゲートウェイのみ表示</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```powershell
PS > Get-KeeperPamGatewayList
Syncing PAM data...

KSM Application Name (UID)                               Gateway Name                                                                           Gateway UID
--------------------------                               ------------                                                                           -----------
New-G1 Application (B17aoEfDlasq23U369OIvpbvw)              New-G1 Gateway                                                                     AN1Y-2MzTK6E…
[APP NOT ACCESSIBLE OR DELETED] (vHRyY3cQnaxdfr45O0FcxRtA) snowPAM Gateway                                                                    AThw2tPDSria…
```

{% endcode %}

</details>

<details>

<summary>Python CLI</summary>

**コマンド: 近日公開**

</details>

<details>

<summary>Python SDK</summary>

**コマンド: 近日公開**

</details>

### Gateway Createコマンド <a href="#gateway-create-command" id="gateway-create-command"></a>

新しいゲートウェイを作成するコマンドです。

<details>

<summary>DotNet CLI</summary>

**コマンド**: `pam-gateway new`

**別名**: `pam-gw new` / `pam-gw n`

**パラメーター**:

<table><thead><tr><th width="285">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>--name</code>, <code>-n</code></td><td>ゲートウェイの名前</td></tr><tr><td><code>--application</code>, <code>-a</code></td><td>KSMアプリケーションの名前またはUID</td></tr><tr><td><code>--token-expires-in-min</code>, <code>-e</code></td><td>ワンタイムトークンの有効期限 (分)。デフォルト: <code>60</code>。最大: <code>1440</code></td></tr><tr><td><code>--return-value</code>, <code>-r</code></td><td>トークン/構成のみを返す (自動化向け)</td></tr><tr><td><code>--config-init</code>, <code>-c</code> <code>{json,b64}</code></td><td>クライアント構成を初期化し、生のトークンではなく構成文字列を返す</td></tr></tbody></table>

**例**:

{% code overflow="wrap" %}

```csharp
My Vault> pam-gateway new --name "Prod Gateway" --application "<application-uid>"
The one time token has been created in application "<application-uid>".

The new Gateway named Prod Gateway will show up in the gateway list once it is initialized.

Following one time token will expire in 60 minutes:
-----------------------------------------------
US:<one-time-token>
-----------------------------------------------                                                    
```

{% endcode %}

</details>

<details>

<summary>DotNet SDK</summary>

**関数:**

```csharp
public static async Task<string> CreateGatewayAsync(
      VaultOnline vault,
      string gatewayName,
      string ksmAppUid,
      int ottExpireInMinutes = DefaultOttExpireMinutes,
      string configInit = null)
    {
      if (vault == null)
      {
        throw new ArgumentNullException(nameof(vault));
      }

      if (string.IsNullOrWhiteSpace(gatewayName))
      {
        throw new ArgumentException("Gateway name is required", nameof(gatewayName));
      }

      if (string.IsNullOrWhiteSpace(ksmAppUid))
      {
        throw new ArgumentException("KSM application UID is required", nameof(ksmAppUid));
      }

      var result = await vault.AddSecretManagerClient(
        ksmAppUid,
        unlockIp: true,
        firstAccessExpireInMinutes: ottExpireInMinutes,
        name: gatewayName,
        appClientType: AppClientType.DiscoveryAndRotationController);

      var oneTimeToken = result?.Item2 ?? throw new InvalidOperationException("Gateway one-time token was not returned");
      if (string.IsNullOrWhiteSpace(configInit))
      {
        return oneTimeToken;
      }

      return await FormatGatewayConfigAsync(vault, oneTimeToken, configInit);
    }
```

</details>

<details>

<summary>Power Commander</summary>

**コマンド**: `New-KeeperPamGateway`

**別名**: `pam-gateway-new` / `pam-gw-new`

**パラメーター**:

<table><thead><tr><th width="264">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>-Name</code>, <code>-n</code></td><td>ゲートウェイ名</td></tr><tr><td><code>-Application</code>, <code>-a</code></td><td>KSMアプリケーションのUIDまたはタイトル</td></tr><tr><td><code>-TokenExpiresInMinutes</code>, <code>-e</code></td><td>ワンタイムトークンの有効期限 (分)。デフォルト: <code>60</code>。最大: <code>1440</code></td></tr><tr><td><code>-ConfigInit</code>, <code>-c</code> <code>{json,b64}</code></td><td>クライアント構成を初期化し、構成文字列を返す</td></tr><tr><td><code>-ReturnValue</code>, <code>-r</code></td><td>トークン/構成文字列のみを返す</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```powershell
PS > New-KeeperPamGateway -Name "Prod Gateway" -Application "<application-uid>"
The one time token has been created in application "<application-uid>".

The new Gateway named Prod Gateway will show up in the gateway list once it is initialized.

Following one time token will expire in 60 minutes:
-----------------------------------------------
US:<one-time-token>
-----------------------------------------------
```

{% endcode %}

</details>

<details>

<summary>Python CLI</summary>

**コマンド: 近日公開**

</details>

<details>

<summary>Python SDK</summary>

**コマンド: 近日公開**

</details>

### Gateway Editコマンド <a href="#gateway-edit-command" id="gateway-edit-command"></a>

ゲートウェイの名前や登録ノードを更新できます。同等の操作は、管理コンソールの \[シークレットマネージャー] → \[ゲートウェイ] からも実行できます。

<details>

<summary>DotNet CLI</summary>

**コマンド**: `pam-gateway edit`

**別名**: `pam-gw edit` / `pam-gw e`

**パラメーター**:

<table><thead><tr><th width="268">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>--gateway</code>, <code>-g</code></td><td>ゲートウェイのUIDまたは名前</td></tr><tr><td><code>--name</code>, <code>-n</code></td><td>新しいゲートウェイ名</td></tr><tr><td><code>--node-id</code>, <code>-i</code></td><td>エンタープライズノードのIDまたは名前</td></tr></tbody></table>

\* `--name` または `--node-id` のいずれか一方が必須です。

**例**:

{% code overflow="wrap" %}

```csharp
My Vault> pam-gateway edit --gateway "Prod Gateway" --name "Production Gateway"
Gateway Production Gateway has been edited.
```

{% endcode %}

</details>

<details>

<summary>DotNet SDK</summary>

**関数:**

```csharp
public static async Task EditGatewayAsync(
      IAuthentication auth,
      string gatewayUid,
      string gatewayName,
      long nodeId)
    {
      if (string.IsNullOrWhiteSpace(gatewayName))
      {
        throw new ArgumentException("Gateway name is required", nameof(gatewayName));
      }

      var request = new PamProto.PAMController
      {
        ControllerUid = ByteString.CopyFrom(DecodeGatewayUid(gatewayUid)),
        ControllerName = gatewayName,
        NodeId = nodeId,
      };

      await auth.ExecuteAuthRest(ModifyControllerEndpoint, request, null);
    }
```

</details>

<details>

<summary>Power Commander</summary>

**コマンド**: `Set-KeeperPamGateway`

**別名**: `pam-gateway-edit` / `pam-gw-edit`

**パラメーター**:

<table><thead><tr><th width="231">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>-Gateway</code>, <code>-g</code></td><td>ゲートウェイのUIDまたは名前</td></tr><tr><td><code>-Name</code>, <code>-n</code></td><td>新しいゲートウェイ名</td></tr><tr><td><code>-NodeId</code>, <code>-i</code></td><td>エンタープライズノードのIDまたは名前</td></tr></tbody></table>

\* `-Name` または `-NodeId` のいずれか一方が必須です。

**例**:

{% code expandable="true" %}

```powershell
PS > Set-KeeperPamGateway -Gateway "YZIMw2wQQashetyRmb_vj-4Ku_IA" -Name "Production Gateway"
Gateway Production Gateway has been edited.
```

{% endcode %}

</details>

<details>

<summary>Python CLI</summary>

**コマンド: 近日公開**

</details>

<details>

<summary>Python SDK</summary>

**コマンド: 近日公開**

</details>

### Gateway Removeコマンド <a href="#gateway-remove-command" id="gateway-remove-command"></a>

ゲートウェイを削除します。この操作を実行するユーザーは、ゲートウェイの親アプリケーションに対する管理者権限を持っている必要があります。

<details>

<summary>DotNet CLI</summary>

**コマンド**: `pam-gateway remove`

**別名**: `pam-gw remove` / `pam-gw rm` / `pam-gateway delete`

**パラメーター**:

<table><thead><tr><th width="254">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>--gateway</code>, <code>-g</code></td><td>ゲートウェイのUIDまたは名前</td></tr></tbody></table>

**例**:

{% code overflow="wrap" %}

```csharp
My Vault> pam-gateway remove --gateway "YZIMw2wQQnhautwr1-Rmb_vj-4Ku_IA"
Gateway Prod Gateway has been removed.
```

{% endcode %}

</details>

<details>

<summary>DotNet SDK</summary>

**関数:**

```csharp
public static async Task RemoveGatewayAsync(IAuthentication auth, string gatewayUid)
    {
      var uidBytes = DecodeGatewayUid(gatewayUid);
      var request = new PamProto.PAMGenericUidRequest
      {
        Uid = ByteString.CopyFrom(uidBytes),
      };

      var response = (PamProto.PAMRemoveControllerResponse)await auth.ExecuteAuthRest(
        RemoveControllerEndpoint,
        request,
        typeof(PamProto.PAMRemoveControllerResponse));

      var controller = response?.Controllers?.FirstOrDefault(x =>
        x.ControllerUid != null && x.ControllerUid.ToByteArray().SequenceEqual(uidBytes));
      if (controller != null)
      {
        throw new KeeperApiException("remove_controller", controller.Message);
      }
}
```

</details>

<details>

<summary>Power Commander</summary>

**コマンド**: `Remove-KeeperPamGateway`

**別名**: `pam-gateway-remove` / `pam-gw-remove` / `pam-gateway-rm`

**パラメーター**:

<table><thead><tr><th width="282">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>-Gateway</code>, <code>-g</code></td><td>ゲートウェイのUIDまたは名前</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```powershell
PS > Remove-KeeperPamGateway -Gateway "ssPtYpO4TmnjauetA4-iKLEsqPnVDEA"
Gateway Production Gateway has been removed.
```

{% endcode %}

</details>

<details>

<summary>Python CLI</summary>

**コマンド: 近日公開**

</details>

<details>

<summary>Python SDK</summary>

**コマンド: 近日公開**

</details>

### Gateway set-max-instancesコマンド <a href="#gateway-set-max-instances-command" id="gateway-set-max-instances-command"></a>

ゲートウェイプールの最大インスタンス数を定義します。[高可用性](/keeperpam/jp/privileged-access-manager/getting-started/gateways/scaling-and-high-availability.md)構成で使用します。

<details>

<summary>DotNet CLI</summary>

**コマンド**: `pam-gateway set-max-instances`

**別名**: `pam-gw set-max-instances` / `pam-gw smi`

**パラメーター**:

<table><thead><tr><th width="257">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>--gateway</code>, <code>-g</code></td><td>ゲートウェイのUIDまたは名前</td></tr><tr><td><code>--max-instances</code>, <code>-m</code></td><td>ゲートウェイインスタンスの上限数 (1以上)</td></tr></tbody></table>

**例**:

{% code overflow="wrap" %}

```csharp
My Vault>  pam-gateway set-max-instances --gateway "ygE7xsutS0haunet460-qZEIGZ-33qfQ" --max-instances 3
NG1 Gateway: max instance count set to 3
```

{% endcode %}

</details>

<details>

<summary>DotNet SDK</summary>

**関数:**

```csharp
public static async Task SetGatewayMaxInstancesAsync(IAuthentication auth, string gatewayUid, int maxInstanceCount)
    {
      if (maxInstanceCount < 1)
      {
        throw new ArgumentOutOfRangeException(nameof(maxInstanceCount), "Max instances must be at least 1");
      }

      var request = new PamProto.PAMSetMaxInstanceCountRequest
      {
        ControllerUid = ByteString.CopyFrom(DecodeGatewayUid(gatewayUid)),
        MaxInstanceCount = maxInstanceCount,
      };

      await auth.ExecuteAuthRest(SetMaxInstanceCountEndpoint, request, null);
}
```

</details>

<details>

<summary>Power Commander</summary>

**コマンド**: `Set-KeeperPamGatewayMaxInstances`

**別名**: `pam-gateway-set-max-instances` / `pam-gw-set-max-instances`

**パラメーター**:

<table><thead><tr><th width="249">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>-Gateway</code>, <code>-g</code></td><td>ゲートウェイのUIDまたは名前</td></tr><tr><td><code>-MaxInstances</code>, <code>-m</code></td><td>ゲートウェイインスタンスの上限数 (1以上)</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```powershell
PS > Set-KeeperPamGatewayMaxInstances -Gateway "ygE7xsutnahuyete-S0qZEIGZ-33qfQ" -MaxInstances 3
NG1 Gateway: max instance count set to 3
```

{% endcode %}

</details>

<details>

<summary>Python CLI</summary>

**コマンド: 近日公開**

</details>

<details>

<summary>Python SDK</summary>

**コマンド: 近日公開**

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.keeper.io/keeperpam/jp/commander-sdk/keeper-commander-sdks/sdk-command-reference/keeperpam-commands/pam-gateway-commands.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
