8 API Implementation Lifecycle
After you have an API implementation in a Draft state that’s configured and tested, you’re ready to publish it. API implementations go through the same lifecycle phases as APIs, in addition to being published, new versions can be created, existing versions can be updated, and obsolete implementations can be moved to the trash.
Remember that after an API implementation is published, it can’t be changed. If you’re still configuring and testing the implementation, keep it in a Draft state until it’s ready for the next phase of the lifecycle.
If you want a general introduction to how artifacts interrelate in the overall lifecycle before exploring the lifecycle of API implementations, see Understanding Lifecycles.
Publishing an API Implementation
Creating a New Version or Updating the Version of an API Implementation
Implementations can be published independently of APIs and can have separate versions as well. This lets you make changes to a published implementation, such as minor modifications or bug fixes, without requiring the API itself to be updated. You can create a new version of an API Implementation that is in a Draft or Published state. If you want to make changes to a published implementation, you must create a new version of it.
If you have previously uploaded an implementation with a given version specified and that implementation is still in a Draft state, you can replace that version without incrementing the version number. This might be desirable if you’ve uploaded the implementation and find, after testing the implementation, that there are further changes that you need to make before you can publish the changes. After you’ve published a version, that version is final.
You can also update the version number of an implementation in a Draft state. The process for both is the same. You set the version
attribute in the implementation’s package.json
file.
- Open the
package.json
file and change theversion
attribute. For example, change“version”:”1.0”
to“version”:”1.1”
. - Upload a zip file of the modified implementation to the associated API version.
-
Implementation versions are maintained independently of API versions. When you publish an API, the implementation isn’t published automatically.
-
When you upload a new version of an implementation, it becomes the default version (active implementation) for that API. You can change the default version in the API’s Implementations page.
-
The custom API’s
Routing_BindApiToImpl
policy defines the association between an API version and the implementation version.
Moving an API Implementation to the Trash
Remove an API implementation by moving it to the trash. If the implementation is needed later, you can restore it from the trash.
To find out how dependencies can affect moving an artifact to the trash, see Moving an Artifact to the Trash. To restore an API implementation that’s in the trash, see Restoring an API Implementation.
Restoring an API Implementation
- Click and select Mobile Apps > APIs from the side menu.
- Select the API associated with the implementation.
- Click Trash ().
- Select Implementations in the trash drawer.
- In the list of items in the trash, click by the implementation you want and select Restore from Trash.
- Click Restore in the confirmation dialog if there are no conflicts.
Restoring an artifact can cause conflicts if a duplicate artifact already exists. To restore an artifact when a duplicate artifact exists, see Restoring an Artifact.