Your Personalization Preferences
To be able to perform all operations on the default preferences in the tenancy, ensure to provide permissions to the user groups and users with the recommended IAM policy statements. See Allow Users to Manage Default Preferences in the Tenancy.
Preferences That are Saved for Future Access
Where | What | Namespace | Schema Type | Key | Description |
---|---|---|---|---|---|
Service Details page and default Homepage |
Homepage |
|
|
|
Your selection of the homepage is saved for future use. |
Log Explorer and Dashboards |
Timezone |
|
|
|
Your last used timezone setting in the time selector is saved in the Log Explorer and Dashboards. |
Log Explorer |
Pinned field |
|
|
|
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 |
|
|
|
The sorting order that you set on the fields in the Other section is saved for future reference. |
Scope Filter |
Log group compartment |
|
|
|
Your last used log group compartment in the scope filter is saved for multiple visits and uses. |
Scope Filter |
Log Set |
|
|
|
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
|
Configure Preferences Using REST API
The above preferences are stored for users automatically. If you want to configure them using REST API for tenant global defaults or user defaults, then see below:
-
CURL Command and JSON Payload Example: Create Log Set Preference
-
CURL Command and JSON Payload Example: Create Pinned Fields Preference
-
CURL Command and JSON Payload Example: Update Pinned Fields Preference
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
orUSER
.
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
orUSER
.
The other details of the preference is recovered using the preference OCID that you specify in the PUT call.
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"
}
Allow Users to Manage Default Preferences in the Tenancy
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