Using the custom-theme commands
You can use the custom-theme commands to create export and import tasks, delete export and import tasks, get the status of an export or import task, and get an export artifact, on your Developer Portal service.
- Log in as Provider org:
apic login --server management_server --realm provider/identity_provider --username provider_username --password provider_password
You can determine which identity provider to use in the--realm
parameter by entering the following command to see a list of all available identity providers (you do not need to be logged in to use this command):
For example:apic identity-providers:list --scope provider --server mgmt_endpoint_url --fields title,realm
Theapic identity-providers:list --scope provider --server myserver.com --fields title,realm total_results: 2 results: - title: Cloud Manager User Registry realm: provider/default-idp-2 - title: Corporate LDAP user registry realm: provider/corporate-ldap
title
value should enable you to determine which identity provider to use; you can then copy the corresponding--realm
parameter directly from the displayedrealm
value. For any identity providers that were created by your administrator after API Connect was installed, the names will have been determined at creation time. The default API Manager Local User Registry for login as a member of a provider organization isdefault-idp-2
.For full details of the
apic login
command, see Logging in to a management server. - Export your custom themes. The custom-theme:create-export command creates an export task against the portal of the specified
catalog
andorg
. The command then polls the status of the task until it hasFINISHED
and the artifacts are streamed back.Note: The command continues to poll until the maximum polling time of 15 minutes is reached. At which point you can use the commands custom-theme:get-export-status and custom-theme:get-export to get the status and potentially an artifact.apic --mode portaladmin custom-theme:create-export --catalog name/id --org orgid/name --server management_server
- The theme .tgz is saved to the directory in which you ran the command.
- The saved .tgz has the format
custom_theme_createExport-20200217134637.tgz
. - You can save your exports into your change control management system.
For example,apic --mode portaladmin custom-theme:create-export --catalog dev --org ibm --server api.stagingexample.com
- Import your custom themes. The custom-theme:create-import command uses the supplied .tgz file to import the custom themes into the portal of the specified
catalog
andorg
. The command then polls the status of the task until the task has eitherFINISHED
successfully, or failed because of an error.Note:- The higher level folders of the archive can contain only these characters, a-z and 0-9.
- The command continues to poll until the maximum polling time of 15 minutes is reached. At which point you can use the command custom-theme:get-import-status to get the status of the import.
- If you import a custom theme that already exists you overwrite the existing custom theme.
apic --mode portaladmin custom-theme:create-import --catalog name/id --org orgid/name --server management_server /PATH/TO/theme/TGZ
For example,apic --mode portaladmin custom-theme:create-import --catalog prod --org ibm --server api.productionexample.com C:/users/example/desktop/custom_theme_createExport-20200217134637.tgz
- You can run the delete command to cancel any ongoing or recently created import or export tasks.
Any temporarily created artifacts will be deleted from the portal filesystem. No custom themes are
deleted.For example,
apic --mode portaladmin custom-theme:delete-export --catalog name/id --org orgid/name --server management_server --format json --task_id string
apic --mode portaladmin custom-theme:delete-import --catalog name/id --org orgid/name --server management_server --format json --task_id string