11.2 Access OML User Management from Command Line

You can obtain the Oracle Machine Learning User Management URL for a specific tenancy from the Oracle Cloud Infrastructure (OCI) command line.

Prerequisite: Tenancy ID
To obtain the Oracle Machine Learning User Management URL for a specific tenancy from the OCI command line, you must first obtain the tenancy ID.
  1. To obtain the tenancy ID, go to your OCI Profile on the top right corner of the Oracle Cloud page and click Tenancy.

    Figure 11-3 Tenancy information in PCI Profile



  2. On the Tenancy details page, click Copy to obtain the tenancy URL.
  3. Type the following command in your OCI command line interface:
    oci db database list  --compartment-id  <tenancy OCID>
    Here,
    • compartment-id: This is the unique ID assigned to your compartment.
    • OCID: This is the Oracle Cloud Identifier (OCID) for your tenancy.
    This command returns the following:
    "connection-urls": {
            "apex-url": https://<tenancy ID>-<database name>.<region>.oraclecloudapps.com/ords/apex,
            "graph-studio-url": https://<tenancy ID>-<database name>.<region>.oraclecloudapps.com/graphstudio/,
            "machine-learning-user-management-url": https://<tenancy ID>-<database name>.<region>-1.oraclecloudapps.com/omlusers/,
            "sql-dev-web-url": https://<tenancy ID>-<database name>.<region>-1.oraclecloudapps.com/ords/sql-developer
          },
This completes the task of obtaining the Oracle Machine Learning User Management URL from OCI command line interface.

11.2.1 Obtain URLs for OML User Management, REST API for OML Services, REST API for OML4Py and OML4R embedded execution from Command Line or the Autonomous AI Database

You can obtain the URLs for OML User Management, REST API for OML Services, REST API for OML4Py and OML4R embedded execution using a query. This approach is useful for automation or when you need programmatic access to the URLs.

To obtain the URLs:

  1. Use the v$pdbs view to run the query.

    Note:

    Non-admin users must have the SELECT privilege on v$pdbs to run this query. A DBA can grant this privilege using:
    GRANT SELECT ON v$pdbs TO <username>;
  2. Run this query URLs from the database using the v$pdbs:
    SELECT 'https://' || 
            LOWER(REPLACE(p.name, '_', '-')) ||
            '.' ||
            REGEXP_REPLACE(j.PUBLIC_DOMAIN_NAME, '[^.]+', 'oraclecloudapps', 1, 3) ||
            '/omlusers/' AS auth_token_url,
           'https://' || 
            LOWER(REPLACE(p.name, '_', '-')) ||
            '.' ||
            REGEXP_REPLACE(j.PUBLIC_DOMAIN_NAME, '[^.]+', 'oraclecloudapps', 1, 3) ||
            '/oml/' AS embed_python_r_url,
           'https://' || 
            LOWER(REPLACE(p.name, '_', '-')) ||
            '.' ||
            REGEXP_REPLACE(j.PUBLIC_DOMAIN_NAME, '[^.]+', 'oraclecloudapps', 1, 3) ||
            '/omlmod/' AS rest_services_url
    FROM v$pdbs p,
         JSON_TABLE(p.cloud_identity, '$' COLUMNS (
            PUBLIC_DOMAIN_NAME PATH '$.PUBLIC_DOMAIN_NAME'                                      
         )) j;
    
    This query returns three URLs:
    • OML User Management URL (same as returned by OCI CLI)
    • URL for OML4Py and OML4R embedded execution
    • URL for OML Services REST APIs