Oracle Cloud Infrastructure — OCI Functions F(n)
OCI Functions are used as the integration back-end for the demo app. As previously mentioned, the application doesn't implement authentication or authorization on a per-user level as is typical for a production app. A single integration user will authenticate to OCI F(n) API calls, and OCI F(n) will perform integrations as needed. In a production instance, you would need a layer of authentication and authorization in between OCI F(n) and the AR application to ensure that each user is authenticated and has access according to your implementation policies.
As of this writing, OCI API Gateway, which requires direct integration with OCI functions, has not been released. When API Gateway is released, it's recommended that the application be configured to connect to the API gateway to call functions, as opposed to the direct connection currently used.
There are 9 total functions used as part of the AR demo. These functions are included in a single OCI F(n) application. See the OCI Functions documentation online to prepare your OCI tenancy and local machine for use with OCI functions. The following instructions assume that your OCI tenancy and local machine are configured for OCI F(n) application deployment.
ar-configs: Serves application-level config items such as the Service app used and the Contact id used when creating service requests.
ar-deviceactionmapping: Maps events in the AR application to events that will be sent back to IoTCS.
ar-nodecontexts: Gives the contextual details for each AR model node in the experience, such as sensors shown, node specifications, procedures, and so on.
ar-recognitioncontexts: Gives the contextual detail for images or objects that can trigger an AR experience.
ar-recognitionmapping: Maps IoTCS device UUIDs to the minor and major recognition pairs that are determined in the AR application.
ec-proxy: The service that proxies request to Engagement Cloud APIs.
iot-proxy: The service that proxies request to IoT CS APIs.
ka-proxy: The service that proxies request to Knowledge Advanced APIs.
osvc-proxy: The service that proxies request to Service Cloud APIs.
There are no OCI F(n) application-level configurations. All configurations are performed at the function level.
fn create app --annotation oracle.com/oci/subnetIds='["ocid1.subnet.oc1.iad.aaaaaaaa5mmpimactrq2tcar6giy74ylgkskgawufsdgsdfsdefsefcvs"]' ar-accelerator
The functions that we will deploy in the following sections don't require code changes. But, each requires that you set configuration parameters that are unique to your deployment.
There are a few repetitive steps for each of the following functions. You must perform the following for each function as you deploy the functions to OCI. You can complete this process for all functions, except ar-nodecontexts, before moving to the configuration steps which follow.
Using the terminal, cd into the directory for each function:
cd ar-configs
Run npr install:
npm install
Deploy the function to OCI F(n):
fn deploy --app ar-accelerator –no-bump
Once all functions are deployed, confirm the applications are deployed:
fn list f ar-accelerator
- If it's successful, the request returns a list of names and images:
NAME IMAGE ID ar-configs image path function ocid ar-deviceactionmapping image path function ocid ar-recognitioncontexts image path function ocid ar-recognitionmapping image path function ocid ec-proxy image path function ocid iot-proxy image path function ocid ka-proxy image path function ocid osvc-proxy image path function ocid