oci-cli
oci-cli copied to clipboard
Error in command log-analytics storage purge-storage-data
I am purging logs using OCI CLI
oci log-analytics storage purge-storage-data --compartment-id "$MONITORING_COMPARTMENT_OCID" \
--namespace-name "$TENANCY_NAME" --purge-query-string "\"log group\"=\"${STACK_NAME}\"" \
--time-data-ended "$(date +%Y-%m-%d -d '+1 day')" --wait-for-state SUCCEEDED --wait-for-state FAILED \
--wait-interval-seconds 10
This is purging logs, I can confirm it from web console, but however this command return error as,
Action completed. Waiting until the work request has entered state: ('SUCCEEDED', 'FAILED')
Encountered error while waiting for work request to enter the specified state. Outputting last known resource state
{
"opc-work-request-id": "ocid1.loganalyticsstorageworkrequest.oc1.phx.amaaaaaaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwzndq"
}
TypeError: get_storage_work_request() missing 1 required positional argument: 'namespace_name'
due to this error, seems command is not waiting until mentioned logs are purged. And early exiting with error. However purge is happening.
I have verified namespace is provided correctly --namespace-name "$TENANCY_NAME"
& this variable will not be blank, it is holding tenancy name, which is also same as object storage namespace.
This is web console, where purge requests are showing success.. and logs are purged also as per the query submitted.