You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a sample to convert JSON to CSV using Service Connector Hub Functions as a Task.
4
+
5
+
As you make your way through this tutorial, look out for this icon .
6
+
Whenever you see it, it's time for you to perform an action.
7
+
8
+
9
+
## Prerequisites
10
+
11
+
Before you deploy this sample function, make sure you have run steps A, B
12
+
and C of the [Oracle Functions Quick Start Guide for Cloud Shell](https://www.oracle.com/webfolder/technetwork/tutorials/infographics/oci_functions_cloudshell_quickview/functions_quickview_top/functions_quickview/index.html)
13
+
* A - Set up your tenancy
14
+
* B - Create application
15
+
* C - Set up your Cloud Shell dev environment
16
+
17
+
18
+
## List Applications
19
+
20
+
Assuming you have successfully completed the prerequisites, you should see your
21
+
application in the list of applications.
22
+
23
+
```
24
+
fn ls apps
25
+
```
26
+
27
+
28
+
## Review and customize the function
29
+
30
+
Review the following files in the current folder:
31
+
* the code of the function, [func.py](./func.py)
32
+
* its dependencies, [requirements.txt](./requirements.txt)
33
+
* the function metadata, [func.yaml](./func.yaml)
34
+
35
+
36
+
## Deploy the function
37
+
38
+
In Cloud Shell, run the `fn deploy` command to build *this* function and its dependencies as a Docker image,
39
+
push the image to the specified Docker registry, and deploy *this* function to Oracle Functions
40
+
in the application created earlier:
41
+
42
+

43
+
```
44
+
fn -v deploy --app <app-name>
45
+
```
46
+
e.g.,
47
+
```
48
+
fn -v deploy --app myapp
49
+
```
50
+
51
+
### Test
52
+
53
+
In Cloud Shell, run the `fn invoke` ccommand to unit test this function:
You should see the the converted CSV output returned by the function.
65
+
66
+
67
+
## Create a Service Connector for reading from Stream 1, convert JSON to CSV and send to Stream 2
68
+
69
+
1. From the navigation menu, select **Logging**, and then select **Service Connectors**.
70
+
71
+
2. Click Create Connector, add a Name, Description, select the compartment, select the Source as **Streaming** and Target as **Streaming** and **Functions** as a Task.
72
+
73
+
3. On Configure Source connection, select the compartment, select the your Stream 1.
74
+
75
+
4. On Configure Target connection, select the compartment, select the your Stream 2. If prompted to create a policy for writing to Streaming, click Create.
76
+
77
+
5. On Configure Task connection, select the compartment and select the Function. If prompted to create a policy for writing to Functions, click Create.
78
+
79
+
80
+
## Monitoring Functions and Service Connector
81
+
82
+
Make sure you configure basic observability for your function and connector using metrics, alarms and email alerts:
83
+
*[Basic Guidance for Monitoring your Functions](../basic-observability/functions.md)
84
+
*[Basic Guidance for Monitoring your Service Connector](../basic-observability/service-connector-hub.md)
0 commit comments