Using the twig commands
You can use the twig commands to enable, disable, and check the state of twig debugging on a specific site on your Developer Portal service.
Note: Twig debugging should not be left enabled on production sites, as it causes performance
issues, and can affect the caching on the site.
- 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 platform_api_endpoint_url --fields title,realm
Theapic identity-providers:list --scope provider --server platform_api_endpoint_url --fields title,realm total_results: 2 results: - title: API 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. - Enable twig debugging for a portal
site.
apic --mode portaladmin twig:debug-enable --server management_server --org orgid/name --catalog catalogid/name
management_server
is the endpoint URL of the management server (required).orgid/name
is the ID or name of the provider organization that the catalog belongs to (required).catalogid/name
is the ID or name of the catalog that the site belongs to (required).
apic --mode portaladmin twig:debug-enable --server my.management.server.com --org ibm --catalog portal-test Setting twig debug to true for site my.management.server.com/ibm/portal-test. Rebuilding cache for my.management.server.com/ibm/portal-test so twig debug changes can take affect.
- Disable twig debugging for a portal
site.
For example:apic --mode portaladmin twig:debug-disable --server management_server --org orgid/name --catalog catalogid/name
apic --mode portaladmin twig:debug-disable --server my.management.server.com --org ibm --catalog portal-test Setting twig debug to false for site my.management.server.com/ibm/portal-test. Rebuilding cache for my.management.server.com/ibm/portal-test so twig debug changes can take affect.
- Get the current state of twig debugging for a specific
site.
For example:apic --mode portaladmin twig:debug-status --server management_server --org orgid/name --catalog catalogid/name
apic --mode portaladmin twig:debug-status --server my.management.server.com --org ibm --catalog portal-test The current state of twig debugging is true for my.management.server.com/ibm/portal-test.