Using the site commands

You can use the site commands to check the site on your Developer Portal service.

  1. 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):
    apic identity-providers:list --scope provider --server mgmt_endpoint_url --fields title,realm
    For example:
    apic 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
    The title value should enable you to determine which identity provider to use; you can then copy the corresponding --realm parameter directly from the displayed realm 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 is default-idp-2.

    For full details of the apic login command, see Logging in to a management server.

  2. Check the site on your portal service. This command checks the file system, database, and API Manager on your portal site, which might identify platform-related problems on your portal site.
    apic --mode portaladmin site:check  --server management_server --catalog catalogid/name --org orgid/name --format format_type
    • management_server is the endpoint URL of the management server (required).
    • catalogid/name is the ID or name of the catalog that the site belongs to (required).
    • orgid/name is the ID or name of the provider organization that the catalog belongs to (required).
    • format_type is the output format. Can be json, yaml, go-template=..., go-template-file=.... Defaults to yaml.
  3. Rebuild the cache of a specific portal site.
    apic --mode portaladmin site:cache-rebuild  --server management_server --catalog catalogid/name --org orgid/name
    For example:
    apic --mode portaladmin site:cache-rebuild --server my.management.server.com --org ibm --catalog portal-test
    [success] Cache rebuild complete.
  4. Display the state of a portal site associated with a particular organization and catalog. This command is useful as a general health check of the site.
    apic --mode portaladmin site:state --server management_server --catalog catalogid/name --org orgid/name --format format_type
    apic --mode portaladmin site:state --server my.management.server.com --org ibm --catalog portal-test --format json
    {
        "alias": "ibm.portal-test.my.management.server.com",
        "check_state": "OK: 200",
        "content_refresh_required": false,
        "known_to_apim": 1,
        "platform": "platform_devportal_9_x_10_99_99_99_20210922_2000",
        "snapshot_first_requested": "0000-00-00 00:00:00",
        "snapshots_failed_processing_since_last_success": 0,
        "snapshots_requested_since_last_received": 0,
        "state": "INSTALLED",
        "subscribed_to_webhooks": true,
        "url": "my.management.server.com/ibm/portal-test",
        "uuid": "cc0ad766-e372-4988-9d45-744eb8d381de.1cd9dc41-b08d-xyz"
    }