{"id":51116405,"url":"https://github.com/oracle-devrel/oci-fn-nosql","last_synced_at":"2026-06-24T22:30:30.564Z","repository":{"id":182340857,"uuid":"668342535","full_name":"oracle-devrel/oci-fn-nosql","owner":"oracle-devrel","description":"oci-fn-nosql","archived":false,"fork":false,"pushed_at":"2024-07-23T21:02:49.000Z","size":245,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-04-21T22:49:00.094Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"upl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oracle-devrel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-19T15:20:09.000Z","updated_at":"2025-05-22T15:05:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"f4cc4b5a-7325-4273-b252-e5b787e19bf5","html_url":"https://github.com/oracle-devrel/oci-fn-nosql","commit_stats":null,"previous_names":["oracle-devrel/oci-fn-nosql"],"tags_count":0,"template":false,"template_full_name":"oracle-devrel/repo-template","purl":"pkg:github/oracle-devrel/oci-fn-nosql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-devrel%2Foci-fn-nosql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-devrel%2Foci-fn-nosql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-devrel%2Foci-fn-nosql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-devrel%2Foci-fn-nosql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oracle-devrel","download_url":"https://codeload.github.com/oracle-devrel/oci-fn-nosql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-devrel%2Foci-fn-nosql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34752465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-24T22:30:26.568Z","updated_at":"2026-06-24T22:30:30.552Z","avatar_url":"https://github.com/oracle-devrel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oci-fn-nosql - OCI Function for updating NoSQL table upon Object Upload\n\n[![License: UPL](https://img.shields.io/badge/license-UPL-green)](https://img.shields.io/badge/license-UPL-green) [![Quality gate](https://sonarcloud.io/api/project_badges/quality_gate?project=oracle-devrel_oci-fn-nosql)](https://sonarcloud.io/dashboard?id=oracle-devrel_oci-fn-nosql)\n\n## Introduction\nThis function leverages Resource Principals for secure authorization, allowing the function to utilize the [OCI Python SDK](https://docs.oracle.com/en-us/iaas/tools/python/2.105.0/) for making API calls to OCI services. It retrieves the content of an uploaded object from an Object Storage bucket and reads the data and updates the NoSQL table. Please note that additional processing logic can be added as needed to process the data and update the target table.\n\nThe function calls the following OCI Python SDK classes:\n* [Resource Principals Signer](https://docs.oracle.com/en-us/iaas/tools/python/2.105.0/) to authenticate\n* [Object Storage Client](https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/api/object_storage/client/oci.object_storage.ObjectStorageClient.html) to interact with Object Storage\n* [OCI Nosql Client](https://docs.oracle.com/en-us/iaas/tools/python/2.104.3/api/nosql/client/oci.nosql.NosqlClient.html) to publish message to stream endpoint\n\n### Prerequisites\n1.  Setup your Functions application and create the NoSQL table(person)\n\n2. Please gather the following information. These values are required to configure the environment variables for function application\n    * User ID  – The OCID of the user to authenticate with.\n    * Tenancy ID  – Tenancy OCID. Can be found in user profile.\n    * Fingerprint  – Will be used to authenticate to the OCI API.\n    * Region – Identifier of the region to create the requests in.    \n    * API private key  - API private key file location \n      Please ensure that the API key file (oci_api_key.pem) is included in the function package, following the function configuration example provided.\n    * Compartment OCID - Compartment OCID where NoSQL table is created\n    * NoSQL table - Create the sample table **person** with the following attributes. \n      | Primary Key  |  Column name | Type | \n      |---|---|---|      \n      | Yes | id| INTEGER|\n      | No | name| STRING|\n      | No | age| INTEGER|\n      | No | gender| STRING|\n\n## Configuration\n\n1.  Event Rule configuration\n    \n    ![Event Rule](./images/event_rule.png)\n\n1.  Function configuration\n    \n    ![Function Configuration](./images/fn_configuration.png)\n\n\n## List Applications \n\nAssuming you have successfully completed the prerequisites, you should see your \napplication in the list of applications.\n\n```\nfn ls apps\n```\n\n\n## Create or Update Dynamic Group for OCI function\n\nIn order to use other OCI Services, your function must be part of a dynamic \ngroup. For information on how to create a dynamic group, refer to the \n[documentation](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingdynamicgroups.htm#To).\n\nWhen specifying the *Matching Rules*, we suggest matching all functions in a compartment with:\n\n```\nALL {resource.type = 'fnfunc', resource.compartment.id = 'ocid1.compartment.oc1..aaaaaxxxxx'}\n```\n\n\n## Required IAM Policies\n\nCreate a new policy that allows the dynamic group to `read objects` in\nthe functions related compartment.\n\n\nYour policy should look something like this:\n```\nAllow dynamic-group \u003cdynamic-group name\u003e to read objects in compartment \u003ccompartment-name\u003e\n```\ne.g.\n```\nAllow dynamic-group oci-streaming-fn-dyn-group to read objects in compartment ocilabs-fn-compartment\n```\n\nFor more information on how to create policies, go [here](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/policysyntax.htm).\n\n\n## Required files to build and deploy OCI function\n\nReview the following files in the current folder:\n\n- [requirements.txt](./requirements.txt) specifies all the dependencies for your function\n- [func.yaml](./func.yaml) that contains metadata about your function and declares properties\n- [func.py](./func.py) which is your actual Python function\n\nThe name of your function *file-upload* is specified in [func.yaml](./func.yaml).\n\n\n## Deploy the function\n\nIn Cloud Shell, run the *fn deploy* command to build the function and its dependencies as a Docker image, \npush the image to the specified Docker registry, and deploy the function to Oracle Functions \nin the application created earlier:\n\n```\nfn -v deploy --app \u003capp-name\u003e\n```\ne.g.\n```\nfn -v deploy --app myapp\n```\n## Test\nTo test this function, please follow the provided steps below.\n  - Please make sure to enable the Function Invocation and event Rule execution logs.\n\n  - Upload **person.json** to the object storage bucket that is configured in the event rule. \n    This action will trigger the event rule and initiate the execution of the associated function. \n    Please be aware that there may be a delay before the function execution logs become available for viewing.\n  \n  - Navigate to NoSQL table \u003e Explore data screen and execute the select query to view the table data.\n\n## Notes/Issues\n* Customize the function code to meet specific business needs, like incorporating additional logic for data processing and applying conditions before updating the NoSQL table from object storage uploads.\n\n## URLs\n* Nothing at this time\n\n## Contributing\nThis project is open source.  Please submit your contributions by forking this repository and submitting a pull request!  Oracle appreciates any contributions that are made by the open source community.\n\n## License\nCopyright (c) 2024 Oracle and/or its affiliates.\n\nLicensed under the Universal Permissive License (UPL), Version 1.0.\n\nSee [LICENSE](LICENSE) for more details.\n\nORACLE AND ITS AFFILIATES DO NOT PROVIDE ANY WARRANTY WHATSOEVER, EXPRESS OR IMPLIED, FOR ANY SOFTWARE, MATERIAL OR CONTENT OF ANY KIND CONTAINED OR PRODUCED WITHIN THIS REPOSITORY, AND IN PARTICULAR SPECIFICALLY DISCLAIM ANY AND ALL IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.  FURTHERMORE, ORACLE AND ITS AFFILIATES DO NOT REPRESENT THAT ANY CUSTOMARY SECURITY REVIEW HAS BEEN PERFORMED WITH RESPECT TO ANY SOFTWARE, MATERIAL OR CONTENT CONTAINED OR PRODUCED WITHIN THIS REPOSITORY. IN ADDITION, AND WITHOUT LIMITING THE FOREGOING, THIRD PARTIES MAY HAVE POSTED SOFTWARE, MATERIAL OR CONTENT TO THIS REPOSITORY WITHOUT ANY REVIEW. USE AT YOUR OWN RISK. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle-devrel%2Foci-fn-nosql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foracle-devrel%2Foci-fn-nosql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle-devrel%2Foci-fn-nosql/lists"}