oracle / oracle/oci-cli

OCI CLI script fails for filter clause to get the user who did not logged in since last 6 months

Open
#851 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

IAM
Dominant language
Python
Stars
669
Forks
236
Avg merge
1m
Merged PRs (30d)
4

Description

six_months_ago=$(date -u -d "-6 months" +"%Y-%m-%dT%H:%M:%SZ")

oci identity-domains users list --endpoint $DOMAIN_NAME --attribute-sets 'all' --query 'data.resources[].{UserName:"user-name", IsActive: active, DisplayName: "display-name", LoginDates: "urn-ietf-params-scim-schemas-oracle-idcs-extension-user-state-user"."last-successful-login-date",Created: "meta"."created"}' --filter '"urn-ietf-params-scim-schemas-oracle-idcs-extension-user-state-user"."last-successful-login-date" lt "'"$six_months_ago"'"'

"client_version": "Oracle-PythonSDK/2.134.0, Oracle-PythonCLI/3.48.0",
"code": null,
"detail": "Invalid filter, Syntax error at position 0",
"logging_tips": "Please run the OCI CLI command using --debug flag to find more debug information.",
"message": "The service returned error code 400",
"opc-request-id": "39B2CF00A8964ED289C177CC4167F850/FWlc002pAE0000000",
"operation_name": "list_users",
"request_endpoint": "GET https://idcs-72b8b71d662841b581d9d786e5ab9c2e.identity.oraclecloud.com/admin/v1/Users",
"schemas": [
    "urn:ietf:params:scim:api:messages:2.0:Error",
    "urn:ietf:params:scim:api:oracle:idcs:extension:messages:Error"
],
"status": 400,
"target_service": "identity_domains",
"timestamp": "2024-10-03T08:47:56.173872+00:00",
"troubleshooting_tips": "See [https://docs.oracle.com/iaas/Content/API/References/apierrors.htm] for more information about resolving this error. If you are unable to resolve this issue, run this CLI command with --debug option and contact Oracle support and provide them the full error message.",
"urn:ietf:params:scim:api:oracle:idcs:extension:messages:_error": {
    "messageId": "Invalid filter, Syntax error at position 0"
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the shown oci identity-domains users list command with --debug, using the reported OCI CLI and Python SDK versions. Trace the filter expression and syntax error; done means the command lists users whose last successful login was more than six months ago while preserving the requested output fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, shell
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.