---
schema_version: "1"
id: 3bc540a6fc5104b308a33c7c8f8fd3a421d3e8669763660c98f9832b114650c8
title: "API ゲートウェイの移行: Autodiscovery"
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/mule-runtime/4.6/migration-api-gateways-autodiscovery.md
canonical_url: https://docs.mulesoft.com/jp/mule-runtime/4.6/migration-api-gateways-autodiscovery
source_site: docs.mulesoft.com
content_type: documentation
content_hash: cf2f472c03d9f778952fae7698a5fc5235a01ae5b1e49d347204900b3158360b
description: MuleSoft Documentation Site
release: "4.6"
latest: false
---
# API ゲートウェイの移行: Autodiscovery

Autodiscovery 要素は Mule 4 のリリース後に更新されています。

- API は、名前とバージョンではなく、ID で参照されます。
- API をランタイムから作成できなくなりました。

HTTP リスナーと Autodiscovery 要素を備えたシンプルな Mule アプリケーションは次のように定義されます。

Mule 3 の例: すべての設定可能な属性

```xml
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:api-platform-gw="http://www.mulesoft.org/schema/mule/api-platform-gw"
      xmlns:http="http://www.mulesoft.org/schema/mule/http"
      xsi:schemaLocation="
       http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
       http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
       http://www.mulesoft.org/schema/mule/api-platform-gw http://www.mulesoft.org/schema/mule/api-platform-gw/current/mule-api-platform-gw.xsd">

    <api-platform-gw:api id="apiId" create="true" apiName="name" version="1.0.0" flowRef="flow_api">
        <api-platform-gw:description>This is a test API</api-platform-gw:description>
        <api-platform-gw:tag>tag1</api-platform-gw:tag>
        <api-platform-gw:tag>tag2</api-platform-gw:tag>
    </api-platform-gw:api>

    <http:listener-config name="httpConfig" host="localhost" port="${port}" />

    <flow name="flow_api">
        <http:listener config-ref="httpConfig" path="api" />
        <logger message="Executing empty" level="INFO"/>
    </flow>

</mule>
```

Mule 4 の例: すべての設定可能な属性

```xml
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:http="http://www.mulesoft.org/schema/mule/http"
      xmlns:api-gateway="http://www.mulesoft.org/schema/mule/api-gateway"
      xsi:schemaLocation="
       http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
       http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
       http://www.mulesoft.org/schema/mule/api-gateway http://www.mulesoft.org/schema/mule/api-gateway/current/mule-api-gateway.xsd">

    <api-gateway:autodiscovery apiId="1" flowRef="flow_api" />

    <http:listener-config name="httpConfig" basePath="api">
        <http:listener-connection host="localhost" port="${port}"/>
    </http:listener-config>

    <flow name="flow_api">
        <http:listener config-ref="httpConfig" path="api" />
        <logger message="Executing empty" level="INFO"/>
    </flow>

</mule>
```

## [](#関連情報)関連情報

[API ゲートウェイの移行](https://docs.mulesoft.com/jp/mule-runtime/4.6/migration-api-gateways)

[API ゲートウェイの移行: ポリシー](https://docs.mulesoft.com/jp/mule-runtime/4.6/migration-api-gateways-policies)

[API ゲートウェイの移行: Mule Runtime の設定](https://docs.mulesoft.com/jp/mule-runtime/4.6/migration-api-gateways-runtime-config)