API Hub では、すべての API リソースに少なくとも 1 つのバージョンが関連付けられています。バージョンは、ある時点での API の状態と考えることができます。基本的に、バージョンは、基になるオペレーション、デプロイ、仕様、その他の属性の組み合わせに基づいて API を分類・整理するのに役立ちます(図 1 を参照)。
図 1各バージョンには、オペレーション、デプロイメント、その他の属性を設定できます。
API Hub では、バージョンは API の論理的なグループ化を表します。通常、このグループ化は API が実行できるオペレーションを中心に行われますが、必ずしもそうとは限りません。たとえば、Pet Store API という API があり、その最初のバージョンでペット情報の追加、検索、削除といった基本的なタスクを実行できるとすると、これらのタスクがオペレーションの例と言えます。
一緒にデプロイされる一連の API オペレーションをバージョンに含めることをおすすめします。たとえば、Pet Store API の 1 つのバージョンに、同じ環境にデプロイされる追加、検索、削除のオペレーションを含めることができます。
API のバージョンについて考える際は、バージョンが API プロデューサーの視点を表していると考えるとわかりやすいでしょう。つまり、API の作成者が API とともにデプロイされることを想定して含めた機能の集合です。
バージョンの作成
API Hub に追加する API の詳細が OpenAPI 仕様でキャプチャされている場合は、その仕様を API バージョンに追加できます。このとき、API Hub は仕様を解析し、API に含まれるオペレーションなどの情報を取得した後、その情報をバージョンとともに保存します。OpenAPI 仕様がない場合でも、バージョンを作成することはできますが、関連する説明情報を手動で入力する必要があります。このほかに、API Hub が Apigee API プロキシの自動登録を介して API の詳細の解析をサポートする場合もあります。
同じバージョンに複数の API 仕様ファイルをアップロードできます。
新しいバージョンを作成するタイミング
API に新しいオペレーションが追加された際に新しいバージョンを作成できますが、それが不要な場合もあります。
たとえば、API プロデューサーが API に新しいオペレーションを追加し、現在のバージョンが関連付けられているすべてのデプロイにデプロイすることを意図しているとします。その場合、プロデューサーは API の新しいバージョンを作成しなくてもかまいません。一方、プロデューサーが下位互換性のない変更(破壊的変更)を行い、それを新しいデプロイに関連付ける場合は、新しいバージョンを作成することをおすすめします。
API Hub を使用すると、組織のニーズや特定の API プロデューサーのニーズに最適な API バージョンを柔軟に定義して整理できます。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eAPI hub utilizes versions to represent the state of an API at a specific point in time, allowing for the organization of APIs based on operations, deployments, and attributes.\u003c/p\u003e\n"],["\u003cp\u003eA version in API hub is a logical grouping of APIs, usually centered around the operations an API can perform, such as adding, finding, and deleting a pet in a Pet Store API example.\u003c/p\u003e\n"],["\u003cp\u003eAPI hub allows the addition of OpenAPI specifications to an API version, from which it will automatically extract information, although versions can also be created manually and populated with relevant information.\u003c/p\u003e\n"],["\u003cp\u003eNew versions of an API may be created when new operations are added or when there are backwardly incompatible changes, particularly if the changes are associated with new deployments.\u003c/p\u003e\n"],["\u003cp\u003eEach API version has system attributes like Lifecycle, Compliance, Accreditation, and Documentation, which can be customized, and users can also define their own custom attributes for each version.\u003c/p\u003e\n"]]],[],null,["# Versions overview\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\nThis topic\nexplains what you need to know about creating and managing versions in API hub.\n\nWhat is a version?\n------------------\n\n\nEvery API resource in API hub has at least one version associated with it. You can think of a\nversion as the state of an API at a point in time. Fundamentally, versions help you group and\norganize your APIs based on underlying sets of operations, deployments, specifications, and other attributes, as shown\nin Figure 1.\n\n**Figure 1.** Each version can have operations, deployments, and other attributes.\n\n\nIn API hub, a version represents a logical grouping of APIs. Usually, but not necessarily, this\ngrouping revolves around the operations an API can perform. For example, let's say you have\na Pet Store API, and the first version of this API lets you perform basic tasks, like adding\na pet, finding a pet, and deleting a pet from the store. These are examples of operations.\n\nIt's a good practice for a version to include a set of API operations that are deployed\ntogether. For example, a pet store API might have a version that includes add, find, and\ndelete operations, all deployed to the same environments.\n\nAnother good way to think about a version is that it\nrepresents the API producer's view of the API. It's the collection of features and\ncapabilities that the people who built the API put into it and *expect to be deployed\nwith it*.\n\nCreating versions\n-----------------\n\n\nSuppose the details of an API you want to add to API hub are captured in an OpenAPI spec.\nIf so, you can [add the spec\nto an API version](./manage-specifications#addspec). When you do, API hub parses\nthe spec and pulls information out of it, such as which operations the API includes, and stores that\ninformation with the version. If you don't have an OpenAPI spec, you can still [create a version](./manage-versions#addversion), but you'll have\nto populate it manually with relevant descriptive information. One other case where API hub\nsupports parsing of API details through the [auto-registration of Apigee API proxies](./auto-register-apigee-proxies).\n| **Note:**API hub only supports the parsing of OpenAPI specs.\n\n\nYou can upload multiple API specification files to the same version.\n| **Note:**API hub cannot guarantee the stability of an API provided by an API producer. API hub assumes that all operations contained in an API version are intended to be deployed together.\n\n### When to create a new version?\n\n\nIf new operations are added to an API, it may warrant creating a new version, or\nperhaps not.\n\n\nLet's say the API producer adds a new operation to an API and intends it to be deployed to all\nof the deployments currently associated with the version. In that case, the producer may choose\nnot to create a new version of the API. On the other hand, if the producer makes a backwardly\nincompatible change (a breaking change) and chooses to associate it with a new deployment,\nyou may wish to create a new version.\n\n\nYou can see that API hub provides flexibility for you to define and organize your API versions\nto best suit your organization's needs and the needs of specific API producers.\n\nSystem attributes\n-----------------\n\nVersions include the following system attributes by default. You can modify the values associated\nwith these attributes in Settings. For details, see [Manage attributes](./manage-attributes).\n\nUser-defined attributes\n-----------------------\n\nDepending on your team or organizational needs, you can define custom attributes (name/value pairs)\nfor versions. See [Manage attributes](/apigee/docs/apihub/manage-attributes)."]]