> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Devin Connect gatewayの宛先を置換

> 設定ページと同様に、gateway の宛先リスト全体を置き換えます。

新しい宛先を利用するには、お客様の gateway の config.yaml にも
その宛先を設定する必要があります。宛先がすでに別の gateway 経由で
ルーティングされている場合は 409 を返します。

[Devin Connect](https://docs.devin.ai/ja/enterprise/deployment/devin-connect.md) の gateway の宛先をすべて**置き換え**ます。コードで管理しているリストと gateway の状態を一致させる場合に利用します。リスト全体を送信せずに 1 つの宛先だけを変更する場合は、[gateway の宛先を追加](https://docs.devin.ai/ja/api-reference/v3/devin-connect/post-enterprise-devin-connect-gateway-destinations.md)または [gateway の宛先を削除](https://docs.devin.ai/ja/api-reference/v3/devin-connect/delete-enterprise-devin-connect-gateway-destinations.md)を利用してください。

## 権限

エンタープライズレベルで `ManageEnterpriseSettings` 権限を持つ [サービスユーザー](https://docs.devin.ai/ja/api-reference/v3/service-users/members-service-users.md) または [個人用アクセストークン](https://docs.devin.ai/ja/api-reference/personal-access-tokens.md) が必要です。また、エンタープライズで Devin Connect が有効になっている必要があります。有効になっていない場合、このエンドポイントは `403` を返します。

## 動作

* `destinations` の内容が、その gateway の宛先リスト全体になります。空のリストを指定すると、gateway を経由してルーティングされる宛先はなくなります。
* 宛先の形式と正規化は、[gateway の宛先を追加](https://docs.devin.ai/ja/api-reference/v3/devin-connect/post-enterprise-devin-connect-gateway-destinations.md) と同じです。重複は除外され、1 つの gateway に登録できる宛先は最大 256 件です。
* 1 つの宛先は 1 つの gateway にのみ所属できます。別の gateway がすでにルーティングしている宛先を送信すると、`409` が返されます。
* 宛先をルーティングしただけでは、セッションはその宛先にアクセスできません。セッションの [セキュリティプロファイル](https://docs.devin.ai/ja/product-guides/security-profiles.md) でも許可されている必要があります。
* gateway は独自の `config.yaml` も強制適用するため、新しい宛先はそのファイルでも許可されて初めて機能します。
* 変更は `update_gateway_hostnames` として [監査ログ](https://docs.devin.ai/ja/api-reference/v3/audit-logs/enterprise-audit-logs.md) に記録されます。


## OpenAPI

````yaml ja/v3-openapi.yaml PUT /v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations
openapi: 3.1.0
info:
  description: Service User 認証および RBAC に対応した Devin v3 API
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3beta1/enterprise/devin-connect/gateways/{gateway_id}/destinations:
    put:
      tags:
        - devin-connect
      summary: Devin Connect gatewayの宛先を置換
      description: |-
        設定ページと同様に、gateway の宛先リスト全体を置き換えます。

        新しい宛先を利用するには、お客様の gateway の config.yaml にも
        その宛先を設定する必要があります。宛先がすでに別の gateway 経由で
        ルーティングされている場合は 409 を返します。
      operationId: >-
        handle_replace_devin_connect_gateway_destinations_v3beta1_enterprise_devin_connect_gateways__gateway_id__destinations_put
      parameters:
        - in: path
          name: gateway_id
          required: true
          schema:
            title: Gateway Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DevinConnectDestinationsUpdateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DevinConnectGateway'
          description: 成功レスポンス
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 認証されていません
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: アクセスが禁止されています
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 見つかりません
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 競合
        '410':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 削除済み
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 処理できないコンテンツ
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: リクエスト過多
components:
  schemas:
    DevinConnectDestinationsUpdateRequest:
      description: 1つのgatewayのすべての宛先を置き換えます。
      properties:
        destinations:
          description: >-
            gatewayに登録する宛先の全リスト（最大256件、重複は除外）。リストが空の場合、このgateway経由では何もルーティングされません。各宛先を登録できるgatewayは1つのみです。
          items:
            $ref: '#/components/schemas/DevinConnectDestination'
          title: Destinations
          type: array
      required:
        - destinations
      title: DevinConnectDestinationsUpdateRequest
      type: object
    DevinConnectGateway:
      description: Devin Connect gatewayと、それを経由してルーティングされる宛先。
      properties:
        connected:
          anyOf:
            - type: boolean
            - type: 'null'
          description: トンネルgatewayが現在接続されているかどうか。directの場合はnull
          title: Connected
        destinations:
          description: このgateway経由でルーティングされる宛先
          items:
            $ref: '#/components/schemas/DevinConnectDestination'
          title: Destinations
          type: array
        gateway_id:
          description: gatewayのID
          title: Gateway Id
          type: string
        kind:
          description: >-
            tunnel：顧客側のgatewayから接続します。direct：Devinからgatewayに接続します（例：AWS
            PrivateLink経由）
          enum:
            - tunnel
            - direct
          title: Kind
          type: string
        last_connected_at:
          anyOf:
            - type: integer
            - type: 'null'
          description: トンネルgatewayから最後に通信があった日時
          title: Last Connected At
        name:
          description: gateway名
          title: Name
          type: string
      required:
        - gateway_id
        - name
        - kind
        - destinations
      title: DevinConnectGateway
      type: object
    ProblemDetail:
      description: >-
        v3 API 用の RFC 9457 application/problem+json エラーボディ。


        detail は後方互換性のため、レガシーな {"detail": ...}
        ボディから引き継がれます。その他のメンバーは追加式です。errors にはフィールドレベルのバリデーションエラーが含まれます（422
        の場合のみ）。
      properties:
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: この事象に固有の、人が読める説明。
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          description: ブロックされた操作の拒否理由を示す機械可読コード（例："user_frozen"、"migrated_session"）。
          title: Error Code
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          description: フィールド単位のバリデーションエラー（422 レスポンスのみ）。
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          description: この発生箇所の URI 参照（リクエストパス）。
          title: Instance
        status:
          description: HTTP ステータスコード。
          title: Status
          type: integer
        title:
          description: 問題タイプを人が読める短い要約。
          title: Title
          type: string
        type:
          default: about:blank
          description: 問題タイプを識別する URI 参照。
          title: Type
          type: string
      required:
        - title
        - status
      title: ProblemDetail
      type: object
    DevinConnectDestination:
      description: 1つの宛先：``hostname``または``ipv4``のいずれか一方のみ。
      properties:
        hostname:
          anyOf:
            - type: string
            - type: 'null'
          description: 完全一致のDNS名（ワイルドカード不可）。例：git.corp.example
          title: Hostname
        ipv4:
          anyOf:
            - type: string
            - type: 'null'
          description: IPv4アドレスまたはCIDR。例：10.20.0.0/16。アドレスのみの場合は/32として扱われます
          title: Ipv4
      title: DevinConnectDestination
      type: object
  securitySchemes:
    bearerAuth:
      description: 'サービスユーザーの認証情報（接頭辞: cog_）'
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.