Using the CLI to modify cloud settings

Use the toolkit CLI to edit the cloud settings.

About this task

Some cloud settings can be modified in the Cloud Manager UI, but all settings can be modified with the toolkit CLI. You can modify the cloud settings configuration file and upload the changes, or issue commands to modify individual settings directly. If multiple people modify the cloud settings, any newer settings overwrite older settings regardless of the method used to update the settings.

For more information about working with the toolkit CLI, see the toolkit CLI reference documentation.

Procedure

  1. Run the following command to log in to a management server as a member of the cloud administration organization:
    apic login --server mgmt_endpoint_url --username user_id --password password --realm admin/identity_provider

    Cloud settings are stored on a management server and you must log in to the server before you can access the settings with the CLI.

    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 admin --server mgmt_endpoint_url --fields title,realm
    For example:
    apic identity-providers:list --scope admin --server myserver.com --fields title,realm
    total_results: 2
    results:
      - title: Cloud Manager User Registry
        realm: admin/default-idp-1
      - title: Corporate LDAP user registry
        realm: admin/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 Cloud Manager Local User Registry for login as a member of the cloud administration organization is default-idp-1.

    For more information on logging in, see Logging in to a management server.

  2. Optionally retrieve the current list of cloud settings with the following command:
    apic cloud-settings:get --server mgmt_endpoint_url --output -

    where mgmt_endpoint_url is the URL of the server where the cloud settings are stored.

  3. Add or modify settings using one of the following methods:
    • Issue each setting from the command line.

      For simple changes, you can issue commands to modify settings without editing the configuration file.

      1. Issue the following command to start the update process:
        apic cloud-settings:update --server mgmt_endpoint_url -
        

        where mgmt_endpoint_url is the URL of the server where the cloud settings are stored. Include the hyphen at the end of the command to indicate that input follows on the next command line.

      2. Type the information for a single setting on one line, and press ENTER to submit it.

        Specify each setting on a single line and use the following format to specify the setting's name and value:

        setting_name: setting_value
        For example, the following command updates a single setting:
        apic cloud-settings:update --server mgmt_endpoint_url -
        refresh_expires_in: expiration time
        Ctrl+D
      3. Type Ctrl+D to indicate that the data entry is complete, as shown in the example.
    • Upload a file containing the settings.

      If you have multiple settings or lengthy values to add or modify, you might prefer to make all of the changes at once by creating or modifying the configuration file and then uploading it.

      1. Create a .yaml file with your settings.

        You can choose the file name but must use YAML format. The file can contain as few or as many settings as needed.

        Settings use the following format; notice that the setting's name must be enclosed in quotation marks as shown in the example. The last setting in the file does not end with a comma.
        "setting_name": setting_value,
      2. Upload the file with the following command:
        apic cloud-settings:update --server mgmt_endpoint_url my_cloud_settings.yaml

      For information on using input files with the toolkit CLI, see ../com.ibm.apic.toolkit.doc/rapic_cli_command_line_input.html.

  4. When you are ready to log out of the management server, use the following command:
    apic logout --server mgmt_endpoint_url

Results

The settings are cached for a maximum of five minutes, so you might experience a delay before your changes take effect.