Toggling the site in and out of maintenance mode

You can put the Developer Portal site into maintenance mode for short periods of time. During maintenance mode, only an administrator is able to access the site, and all other users who enter the site URL get a maintenance message set by the administrator.

Before you begin

You must have administrator access to the Developer Portal to complete this task.

Important:
  • Maintenance mode is designed for short-term site maintenance; it is not meant for long-term usage. While a site is in maintenance mode, the database is not updated with new content from API Manager. As soon as the maintenance tasks are finished, you must take the site out of maintenance mode.
  • Do not log out of the Developer Portal while the site is in maintenance mode, as you will not be able to log back in to the UI. In this case, maintenance mode can be turned off only by using the toolkit CLI; see the following instructions for details.

Procedure

To put the site into maintenance mode, complete the following steps.

  1. Click Configuration in the administrator dashboard.
  2. Under the DEVELOPMENT heading, click Maintenance mode.
  3. Select the Put site into maintenance mode checkbox.
  4. Enter a site message, or leave the default site maintenance text.
    This message is what will be seen by users who visit the site while it is in maintenance mode.
  5. Click Save configuration.
    Your site is now in maintenance mode.

To take the site out of maintenance mode, complete one of the following steps.

  1. If you remained logged in to the site as the admin user during the maintenance period, you can use the Developer Portal UI to disable maintenance mode:
    1. Click Configuration in the administrator dashboard.
    2. Under the DEVELOPMENT heading, click Maintenance mode.
    3. Clear the Put site into maintenance mode checkbox .
      Your site is now available to users, and out of maintenance mode.
  2. If you're no longer logged in to the site, you can use the toolkit CLI to disable maintenance mode:
    1. Log in to the toolkit CLI as a 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 platform_api_host_name --fields title,realm
      For example,
      apic identity-providers:list --scope provider --server platform_api_host_name --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
      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. Run the following command to disable maintenance mode on your Developer Portal:
      apic --mode portaladmin drupal-state:set --server management_server --org orgid/name --catalog catalogid/name --state_key system.maintenance_mode  --input_format integer --state_value 0
      Where:
      • management_server is the endpoint URL of your management server (required).
      • catalogid/name is the ID or name of the catalog that your site belongs to (required).
      • orgid/name is the ID or name of the provider organization that the catalog belongs to (required).
      • --state_key is the name of the state key (required). Must be set to system.maintenance_mode.
      • --input_format is the input format of the value of the state key. Must be set to integer for configuring the maintenance mode.
      • --state_value is the value to assign to the state key (required). Set to 0 to disable maintenance mode.
      For example, to disable maintenance mode for a Developer Portal in the myOrg organization, and in the dev catalog:
      apic --mode portaladmin drupal-state:set --server my.management.server.com --org myOrg --catalog dev --state_key system.maintenance_mode  --input_format integer --state_value 0
      Successfully set state system.maintenance_mode to the value of 0.
      Your site is now available to users, and out of maintenance mode.

What to do next

You can use the toolkit CLI to enable, and disable, maintenance mode. For more information, see the scenario How to enable and disable maintenance mode on your Developer Portal.