copyright | lastupdated | keywords | subcollection | ||
---|---|---|---|---|---|
|
2021-06-14 |
deprecate software, restore software, catalog, catalogs, software, private catalog |
account |
{:shortdesc: .shortdesc} {:codeblock: .codeblock} {:screen: .screen} {:tip: .tip} {:note: .note} {:go: .ph data-hd-programlang='go'} {:javascript: .ph data-hd-programlang='javascript'} {:java: .ph data-hd-programlang='java'} {:python: .ph data-hd-programlang='python'} {:important: .important} {:external: target="_blank" .external} {:ui: .ph data-hd-interface='ui'} {:cli: .ph data-hd-interface='cli'} {:api: .ph data-hd-interface='api'}
{: #dep-restore}
In this tutorial, you deprecate a version of the apache-two-instances software instance. Then, you restore the version to the {{site.data.keyword.cloud}} catalog. {: shortdesc}
{: #prereq-restore}
To complete this tutorial, you need to be assigned the editor role on the catalog management service. For more information, see Assigning users access.
If you don't see what you're expecting in the console based on your permissions, try refreshing your session by going to https://cloud.ibm.com/login. {: tip}
{: #deprecate-editor} {: ui}
When you deprecate a version, it is not displayed in the catalog for any user that hasn't installed it. All users who previously installed the software can still access it.
- Go Manage > Catalogs > Private catalogs, and select My first catalog from the list of private catalogs.
- Click apache-two-instances.
- From the Version list, select 2.4.39.
- Click the Actions icon , and select Deprecate.
{: #deprecate-validate-editor}
- Click Catalog in the console menu bar.
- Select My first catalog from the list of catalogs.
- Click the Private tab > apache-two-instances.
- Verify that only version 2.4.41 is listed in the Version list.
{: #restore-editor} {: ui}
When you restore a deprecated version, you are required to validate and publish the software again.
- Go to Manage > Catalogs > Private catalogs, and select My first catalog.
- Click apache-two-instances.
- Click the Version list, and select 2.4.39.
- Click the Actions icon , and select Restore.
- Confirm that you want to restore the deprecated version.
- Click the Validate offering tab.
- Select a cluster from the Cluster list, and select apache-test-deployment from the Namespace list.
- Click Validate.
- When the software is validated, click the Actions icon , and select Merge changes.
{: #restore-validate-editor}
- Click Catalog from the console menu bar.
- Select My first catalog from the list of catalogs.
- Click the Private tab > apache-two-instances.
- Verify that both version 2.4.39 and version 2.4.41 are listed in the Version list.
{: #deprecate-cicd-editor} {: cli}
You need the version locator for your software version. To find it, run the ibmcloud catalog offering list --catalog "My first catalog"
command, and search for version 2.4.39.
{: important}
-
Deprecate the existing software version.
ibmcloud catalog offering deprecate --version-locator <VERSION_LOCATOR>
{: codeblock}
-
Search the catalog and verify that apache 2.4.39 is deprecated:
ibmcloud catalog offering search --catalog "My first catalog"
{: codeblock}
{: #restore-cicd-editor} {: cli}
When you restore a deprecated version, you are required to validate and publish the software again.
-
Restore the deprecated version. This action creates a draft version.
ibmcloud catalog offering restore --version-locator <VERSION_LOCATOR>
{: codeblock}
-
Validate the software:
ibmcloud catalog offering validate --version-locator **<VERSION_LOCATOR_OF_DRAFT_VERSION>** --cluster <CLUSTER> --namespace "apache-test-deployment"
{: codeblock}
-
Merge the draft version. This action automatically makes version 2.4.39 available in the catalog.
ibmcloud catalog offering merge-draft --version-locator **<VERSION_LOCATOR_OF_DRAFT_VERSION>**
{: codeblock}
-
Search the catalog and verify that apache 2.4.39 is listed.
ibmcloud catalog offering get --catalog "My first catalog" --offering "apache"
{: codeblock}
{: #deprecate-version-api} {: api}
You can programmatically deprecate a version by calling the Catalog Management API as shown in the following sample request. For detailed information about the API, see Catalog Management API{: external}.
String versionLocator = "{versionLocator}";
DeprecateVersionOptions depOptions = new DeprecateVersionOptions.Builder().versionLocId(versionLocator).build();
Response<Void> response = service.deprecateVersion(depOptions).execute();
System.out.println(response.getResult());
{: codeblock} {: java}
versionLocator = "{versionLocator}";
response = await service.deprecateVersion({ 'versionLocId': versionLocator});
console.log(response);
}).catch(err => {});
{: codeblock} {: javascript}
versionLocator = "{versionLocator}"
response = self.service.deprecate_version(version_loc_id=versionLocator)
print(response)
{: codeblock} {: python}
versionLocator := "{versionLocator}"
depOptions := service.NewDeprecateVersionOptions(versionLocator)
response, _ := service.DeprecateVersion(depOptions)
fmt.Println(response)
{: codeblock} {: go}
{: #restore-version-api} {: api} This action can be done only through the UI or CLI. To see the steps, switch to the UI or CLI instructions.