Personalization Options for OCI Console

The table below shows the preferences that leverages the capability offered by Oracle Cloud Infrastructure to manage the default preferences for the tenancy:

Topics:

Where What Namespace Schema Type Key Description

Service Details page and default Homepage

Homepage

homepage

string

default_dashboard

Your selection of the homepage is saved for future use.

Log Explorer and Dashboards

Timezone

explorer

string

last_timezone

Your last used timezone setting in the time selector is saved in the Log Explorer and Dashboards.

Log Explorer

Pinned field

explorer

json

pinned_fields

After you add fields to the Pinned section, you can access them at a later point when you return to the Log Explorer.

Log Explorer

Other fields ordering

explorer

string

other_field_ordering

The sorting order that you set on the fields in the Other section is saved for future reference.

Log Explorer

Table and Records display fields

explorer

json

table_display_fields

If you select Remember display fields, the selected display fields (including the primary display field in records visualization) are saved for future use in the Table or Records visualizations.

Scope Filter

Log group compartment

explorer

string

default_loggroup_compartment

Your last used log group compartment in the scope filter is saved for multiple visits and uses.

Scope Filter

Log Set

explorer

string

last_logset

If you use the log partitioning feature and specify a log set in the scope filter, then your last used log set is remembered. This does not apply to using wildcard * log set value.

Scope Filter

Log fields

explorer

json

scope_field_filters

The list of fields included in the scope filter for Log Explorer and dashboard widgets is saved for future use.

The fields can be added or removed from scope filters in the Log Explorer by using the Actions menu next to each field.

Example json for table_display_fields key:

{
  "savePreferences":true,
  "primary":"Original Log Content”,
  "fields":[
        "Entity","Entity Type","Log Source","Host Name (Server)","Problem Priority","Label"]}

In the above example:

  • primary: (String) The display name of the field to be shown as the primary display field (applies to Records only)
  • fields: (Array<String>) An array of display field names that should be shown as the display fields

Example json for scope_field_filters key:

{
  "fields":[
    {"fieldDName":"Severity"},
    {"fieldDName":"Log Source"},
    {"fieldDName":"Label"},
    {"fieldDName":"Action"},
    {"fieldDName":"Entity","visible":false}]}

In the above example:

  • fields: (Array<FieldId>) A fieldId object
  • fieldDName: (String) The display name of the field to be included as a scope filter field
  • visible: (Boolean) If the identified field should be shown as a scope filter or not.

    The visible property of the fieldId object should typically only be used for the Entity field and set to false. The Entity field is included as a scope filter by default. If it should be removed and not used a scope filter, then an entry for it is required with the visible property set to false.

Allow Users to Manage OCI Console Personalization in the Tenancy

The following permissions must be provided to the user group for performing all operations on the default preferences in the tenancy such as read, create, update, and delete:

The following policy statement can be used by the administrators to set the tenancy-wide defaults for the users:

allow group <user_group_name> to manage tenancy-preferences in tenancy

Configure OCI Console Personalization Using REST API

The above personalization is stored for users automatically. If you want to configure it using REST API for tenant global defaults or user defaults, then see below:

Note

If you perform a PUT or POST operation on default preferences using REST API, then limit the size of the JSON payload to less than 10 KB.

Create Preferences

Set up OCI CURL to use the personalization REST APIs. For setting tenancy-level preferences, make sure the user has the tenancy-preferences permission in OCI CURL.

Format of the curl command:

sh ~/oci-curl.sh --oci-config-file ~/.oci/config --oci-profile <your_profile> --data-binary @/<my_preference.json> -X POST 'https://personalization.<region>.oci.oraclecloud.com/20200715/preferences' -i

Create the JSON file in the same directory as oci-curl.sh. Format of the JSON payload my_preference.json:

{
    "serviceName" : "logginganalytics",
    "namespace" : "<your_namespace>",
    "key" : "<preference_key>",
    "value": "<preference_value>",
    "type": "<preference_value_type>",
    "compartmentId" : "<compartment_OCID>",
    "level" : "<preference_level>"
}

In the above formats of CURL command and JSON payload:

  • your_profile: Get the value of your profile by clicking on the Profile icon at the top right corner of OCI console.

  • my_preference.json: Replace this with the name of your JSON payload file.

  • region: Specify the region, for example, us-phoenix-1.

  • your_namespace: Your personalization namespace. Refer to the values from the table above.

  • preference_key: The key for the preference that you want to specify. Refer to the values from the table above.

  • preference_value: The value of the preference.

  • preference_value_type: The schema type of the preference value provided. Refer to the values from the table above.

  • compartment_OCID: OCID of the compartment where the preference must be stored.

  • preference_level: Specify TENANCY or USER.

Update Preferences

Use the PUT method to send the preference OCID in the REST API to update an existing preference.

Format of the curl command:

sh ~/oci-curl.sh --oci-config-file ~/.oci/config --oci-profile <your_profile> --data-binary @/<my_preference.json> -X POST 'https://personalization.<region>.oci.oraclecloud.com/20200715/preferences/<preference_OCID>/<tenancy_OCID>' -i

Create the JSON file in the same directory as oci-curl.sh. Format of the JSON payload my_preference.json:

{
    "value": "<preference_value>",
    "level" : "<preference_level>"
}

In the above formats of CURL command and JSON payload:

  • your_profile: Get the value of your profile by clicking on the Profile icon at the top right corner of OCI console.

  • my_preference.json: Replace this with the name of your JSON payload file.

  • region: Specify the region, for example, us-phoenix-1.

  • preference_value: The value of the preference.

  • preference_OCID: OCID of the preference that must be updated.

  • compartment_OCID: OCID of the compartment where the preference must be stored.

  • preference_level: Specify TENANCY or USER.

The other details of the preference is recovered using the preference OCID that you specify in the PUT call.

Note

To remove a field from default pinned fields, set the pin value to false instead of true.

CURL Command and JSON Payload Example: Create Log Set Preference

Example CURL command:

sh ~/oci-curl.sh --oci-config-file ~/.oci/config --oci-profile logan_profile --data-binary @/logset.json -X POST 'https://personalization.us-phoenix-1.oci.oraclecloud.com/20200715/preferences' -i

Example JSON payload logset.json:

{
   "serviceName": "logginganalytics",
   "namespace": "explorer",
   "key": "last_logset",  
   "value": "testlogset1",
   "type": "STRING",
   "compartmentId": "ocid1.compartment.oc1..aaa...",  
   "level": "TENANCY"
}

CURL Command and JSON Payload Example: Create Pinned Fields Preference

Example CURL command:

sh ~/oci-curl.sh --oci-config-file ~/.oci/config --oci-profile logan_profile --data-binary @/pinned_field_value.json -X POST 'https://personalization.us-ashburn-1.oci.oraclecloud.com/20200715/preferences' -i

Example JSON payload pinned_field_value.json:

{
  "serviceName": "logginganalytics",
  "namespace": "explorer", 
  "key": "pinned_fields",
  "value": "{\"fields\":[{\"pin\":true,\"iname\":\"acclvl\",\"dname\":\"Access Level\",\"dataType\":\"STRING\",\"tableEl\":true,\"facetEl\":true,\"summ\":true,\"group\":true},{\"pin\":true,\"iname\":\"zone\",\"dname\":\"Zone\",\"dataType\":\"STRING\",\"tableEl\":true,\"facetEl\":true,\"summ\":true,\"group\":true},{\"pin\":true,\"iname\":\"usrname\",\"dname\":\"User Name\",\"dataType\":\"STRING\",\"tableEl\":true,\"facetEl\":true,\"summ\":true,\"group\":true}]}", 
  "type": "JSON",
  "compartmentId": "ocid1.compartment.oc1..ccc...", 
  "level": "USER"
}

CURL Command and JSON Payload Example: Update Pinned Fields Preference

Example CURL command:

sh ~/oci-curl.sh --oci-config-file ~/.oci/config --oci-profile logan_profile --data-binary @/pinned_field_value.json -X PUT 'https://personalization.us-phoenix-1.oci.oraclecloud.com/20200715/preferences/ocid1.personalizationpreference.oc1.phx.amaaaaaa...?compartmentId=ocid1.tenancy.oc1..aaaaaaaa...' -i

Example JSON payload pinned_field_value.json:

{
    "value":"{\"fields\":[{\"pin\":true,\"iname\":\"cipher\",\"dname\":\"Cipher\",\"dataType\":\"STRING\",\"tableEl\":true,\"facetEl\":true,\"summ\":true,\"group\":true},{\"pin\":true,\"iname\":\"actn\",\"dname\":\"Action\",\"dataType\":\"STRING\",\"tableEl\":true,\"facetEl\":true,\"summ\":true,\"group\":true}]}",
    "level":"USER"
}