Delete a Connection¶
When you no longer need a connection, you can delete it from the WSO2 Developer Platform Console. To prevent runtime failures, WSO2 Developer Platform does not allow you to delete a connection that is still in use by one or more components.
Delete a connection¶
Follow these steps to delete a connection:
- In the WSO2 Developer Platform Console, go to the top navigation menu and select the organization, project, and (for component connections) the component associated with the connection.
- In the left navigation menu, click Connections. This page lists all the existing connections.
-
In the row of the connection you want to delete, click the delete icon.
When you click the delete icon, WSO2 Developer Platform checks whether the connection has any active usages:
- If no components are using the connection, WSO2 Developer Platform prompts you to confirm the deletion. Follow the instructions in the confirmation dialog to confirm, and WSO2 Developer Platform deletes the connection.
- If one or more components are using the connection, WSO2 Developer Platform displays the list of components that currently depend on it and prevents the deletion. To proceed, follow the steps below.
Delete a connection that is in use¶
When a connection has active usages, you must remove the connection references from each of the components that depend on it before you can delete the connection.
To remove a connection reference from a component, follow these steps:
- In the list of usages displayed in the WSO2 Developer Platform Console, identify each component that uses the connection.
- Go to the source repository of the component and open its
component.yamlfile. -
Under the
dependenciessection, remove theconnectionReferencesentry that refers to the connection you want to delete.For example, to remove the following connection reference, delete the corresponding item under
connectionReferences:Note
If
connectionReferencesno longer contains any items after you remove the entry, you can remove the emptyconnectionReferencessection as well. -
Commit and push the changes to the source repository.
- Build the component with the latest changes and deploy it. This ensures that the component no longer depends on the connection.
- Repeat the above steps for every component listed as a usage of the connection.
Once you have removed the connection references from all the components that use the connection and deployed the latest changes, retry the deletion:
- In the left navigation menu, click Connections.
- In the row of the connection you want to delete, click the delete icon.
- Follow the instructions in the confirmation dialog to confirm the deletion.
Because the connection no longer has any active usages, WSO2 Developer Platform now deletes it.