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
Copy file name to clipboardExpand all lines: oci-adb-client-runsql-python/README.md
+31-61Lines changed: 31 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,67 +5,45 @@ As you make your way through this tutorial, look out for this icon 
8
+
## Prerequisites
9
+
Before you deploy this sample function, make sure you have run step A, B 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)
10
+
* A - Set up your tenancy
11
+
* B - Create application
12
+
* C - Set up your Cloud Shell dev environment
10
13
11
-
2. Have [Fn CLI setup with Oracle Functions](https://docs.cloud.oracle.com/iaas/Content/Functions/Tasks/functionsconfiguringclient.htm?tocpath=Services%7CFunctions%7CPreparing%20for%20Oracle%20Functions%7CConfiguring%20Your%20Client%20Environment%20for%20Function%20Development%7C_____0)
12
14
13
-
14
-
## Create or Update your Dynamic Group
15
-
In order to use other OCI Services, your function
16
-
must be part of a dynamic group. For information on how to create a dynamic group,
17
-
go [here](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingdynamicgroups.htm#To).
18
-
19
-

20
-
21
-
When specifying the *Matching Rules*, consider the following examples:
22
-
* Matching all functions in a compartment:
23
-
```
24
-
ALL {resource.type = 'fnfunc', resource.compartment.id = 'ocid1.compartment.oc1..aaaaaaaa23______smwa'}
15
+
## List Applications
16
+
Assuming your have successfully completed the prerequisites, you should see your
You can find the subnet-ocid by logging on to [cloud.oracle.com](https://cloud.oracle.com/en_US/sign-in),
44
-
navigating to Core Infrastructure > Networking > Virtual Cloud Networks. Make
45
-
sure you are in the correct Region and Compartment, click on your VCN and
46
-
select the subnet you wish to use.
23
+
## Create or Update your Dynamic Group
24
+
In order to use other OCI Services, your function must be part of a dynamic group. For information on how to create a dynamic group, refer to the [documentation](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingdynamicgroups.htm#To).
47
25
48
-
e.g.
26
+
When specifying the *Matching Rules*, we suggest matching all functions in a compartment with:
ALL {resource.type = 'fnfunc', resource.compartment.id = 'ocid1.compartment.oc1..aaaaaxxxxx'}
51
29
```
30
+
Please check the [Accessing Other Oracle Cloud Infrastructure Resources from Running Functions](https://docs.cloud.oracle.com/en-us/iaas/Content/Functions/Tasks/functionsaccessingociresources.htm) for other *Matching Rules* options.
52
31
53
32
54
-
## Review and customize your function
33
+
## Review and customize the function
55
34
Review the following files in the current folder:
56
35
* the code of the function, [func.py](./func.py)
57
36
* its dependencies, [requirements.txt](./requirements.txt)
58
37
* the function metadata, [func.yaml](./func.yaml)
59
38
60
39
61
40
## Deploy the function
41
+
In Cloud Shell, run the *fn deploy* command to build the function and its dependencies as a Docker image,
42
+
push the image to OCIR, and deploy the function to Oracle Functions in your application.
43
+
62
44

63
45
```
64
-
fn -v deploy --app <your app name>
65
-
```
66
-
e.g.
67
-
```
68
-
fn -v deploy --app myapp
46
+
fn -v deploy --app <app-name>
69
47
```
70
48
71
49
@@ -103,44 +81,36 @@ Create an IAM policy that allows the dynamic group to read objects in the bucket
103
81
104
82
Your policy should look something like this:
105
83
```
106
-
Allow dynamic-group <your dynamic group name> to read objects in compartment <your compartment name> where target.bucket.name='<bucket-name>'
107
-
```
108
-
e.g.
109
-
```
110
-
Allow dynamic-group dg-greg to read objects in compartment greg-verstraeten where target.bucket.name='db-wallets'
84
+
Allow dynamic-group <dynamic-group-name> to read objects in compartment <compartment-name> where target.bucket.name='<bucket-name>'
111
85
```
112
86
113
87
If you choose to retrieve the wallet from Autonomous Database directly during the execution of the function, note the OCID of the Autonomous Database and create an IAM policy that allows the dynamic group to use the autonomous Database with the specific permission 'AUTONOMOUS_DATABASE_CONTENT_READ'.
114
88
```
115
-
Allow dynamic-group <your dynamic group name> to use autonomous-databases in compartment <your compartment name> where request.permission='AUTONOMOUS_DATABASE_CONTENT_READ'
116
-
```
117
-
e.g.
118
-
```
119
-
Allow dynamic-group mydg to use autonomous-databases in compartment mycompartment where request.permission='AUTONOMOUS_DATABASE_CONTENT_READ'
89
+
Allow dynamic-group <dynamic-group-name> to use autonomous-databases in compartment <compartment-name> where request.permission='AUTONOMOUS_DATABASE_CONTENT_READ'
120
90
```
121
91
122
-
For more information on how to create policies, go [here](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/policysyntax.htm).
92
+
For more information on how to create policies, check the [documentation](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/policysyntax.htm).
123
93
124
94
125
95
## Set the function configuration values
126
96
The function requires several config value to be set.
127
97
128
98

129
99
130
-
Use the *fn* CLI to set the config value:
100
+
Use the *fn CLI* to set the config value:
131
101
```
132
-
fn config function <your appname> <functionname> DBSVC <DBservicename>
133
-
fn config function <your appname> <functionname> DBUSR <DBusername>
134
-
fn config function <your appname> <functionname> DBPWD_CYPHER <DBencryptedpassword>
102
+
fn config function <app-name> <function-name> DBSVC <DB-service-name>
103
+
fn config function <app-name> <function-name> DBUSR <DB-username>
104
+
fn config function <app-name> <function-name> DBPWD_CYPHER <DB-encrypted-password>
135
105
```
136
-
Depending on where the DB wallet should be downloaded, specify either the bucket and object name, or the Autonomouns Database OCID:
106
+
Additionally, depending on where the DB wallet should be downloaded, specify either the bucket and object name, or the Autonomouns Database OCID:
137
107
```
138
-
fn config function <your appname> <function name> DBWALLET_BUCKET <DBservicename>
139
-
fn config function <your appname> <function name> DBWALLET_OBJECT <DBusername>
108
+
fn config function <app-name> <function name> DBWALLET_BUCKET <DB-service-name>
109
+
fn config function <app-name> <function name> DBWALLET_OBJECT <DB-username>
140
110
```
141
111
or:
142
112
```
143
-
fn config function <your appname> <function name> ADB_OCID <Autonomous DB OCID>
113
+
fn config function <app-name> <function name> ADB_OCID <Autonomous-DB-OCID>
Copy file name to clipboardExpand all lines: oci-adb-ords-runsql-python/README.md
+32-24Lines changed: 32 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,46 +5,52 @@ This function connects to an Autonomous Database using ORDS and executes a SQL s
5
5
As you make your way through this tutorial, look out for this icon .
6
6
Whenever you see it, it's time for you to perform an action.
7
7
8
-
## Pre-requisites
9
-
1. Start by making sure all of your policies are correct from this [guide](https://docs.cloud.oracle.com/iaas/Content/Functions/Tasks/functionscreatingpolicies.htm?tocpath=Services%7CFunctions%7CPreparing%20for%20Oracle%20Functions%7CConfiguring%20Your%20Tenancy%20for%20Function%20Development%7C_____4)
10
8
11
-
2. Have [Fn CLI setup with Oracle Functions](https://docs.cloud.oracle.com/iaas/Content/Functions/Tasks/functionsconfiguringclient.htm?tocpath=Services%7CFunctions%7CPreparing%20for%20Oracle%20Functions%7CConfiguring%20Your%20Client%20Environment%20for%20Function%20Development%7C_____0)
9
+
## Prerequisites
10
+
Before you deploy this sample function, make sure you have run step A, B 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)
11
+
* A - Set up your tenancy
12
+
* B - Create application
13
+
* C - Set up your Cloud Shell dev environment
12
14
13
-
## Create an Application to run your function
14
-
You can use an application already created or create a new one as follow:
15
15
16
-

16
+
## List Applications
17
+
Assuming your have successfully completed the prerequisites, you should see your
You can find the subnet-ocid by logging on to [cloud.oracle.com](https://cloud.oracle.com/en_US/sign-in),
21
-
navigating to Core Infrastructure > Networking > Virtual Cloud Networks. Make
22
-
sure you are in the correct Region and Compartment, click on your VCN and
23
-
select the subnet you wish to use.
24
22
25
-
e.g.
23
+
24
+
## Create or Update your Dynamic Group
25
+
In order to use other OCI Services, your function must be part of a dynamic group. For information on how to create a dynamic group, refer to the [documentation](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingdynamicgroups.htm#To).
26
+
27
+
When specifying the *Matching Rules*, we suggest matching all functions in a compartment with:
ALL {resource.type = 'fnfunc', resource.compartment.id = 'ocid1.compartment.oc1..aaaaaxxxxx'}
28
30
```
31
+
Please check the [Accessing Other Oracle Cloud Infrastructure Resources from Running Functions](https://docs.cloud.oracle.com/en-us/iaas/Content/Functions/Tasks/functionsaccessingociresources.htm) for other *Matching Rules* options.
29
32
30
-
## Review and customize your function
33
+
34
+
35
+
## Review and customize the function
31
36
Review the following files in the current folder:
32
37
* the code of the function, [func.py](./func.py)
33
38
* its dependencies, [requirements.txt](./requirements.txt)
34
39
* the function metadata, [func.yaml](./func.yaml)
35
40
36
41
In the code, we assume the schema and the database username are the same. Feel free to change this.
37
42
43
+
38
44
## Deploy the function
45
+
In Cloud Shell, run the *fn deploy* command to build the function and its dependencies as a Docker image,
46
+
push the image to OCIR, and deploy the function to Oracle Functions in your application.
47
+
39
48

40
49
```
41
-
fn -v deploy --app <your app name>
42
-
```
43
-
e.g.
44
-
```
45
-
fn -v deploy --app myapp
50
+
fn -v deploy --app <app-name>
46
51
```
47
52
53
+
48
54
## Create an Autonomous Database
49
55
Use an existing Autonomous Database (either Transaction Processing or Datawarehouse) or create a new one as follows.
50
56
@@ -67,15 +73,16 @@ On the Service Console, navigate to Development and copy the ORDS Base URL, we w
67
73
68
74
The *admin* schema is enabled for REST access by default, so you can test the function using the *admin* schema. For Production, it is recommended to create a separate schema and enable REST Service. For more information on how to do this, check the documentation at https://docs.oracle.com/en/database/oracle/oracle-rest-data-services/19.1/index.html.
69
75
76
+
70
77
## Set the function configuration values
71
78
The function requires the config value *ords-base-url*, *db-schema* and *db-pwd-cypher* to be set.
72
79

73
80
74
-
Use the *fn* CLI to set the config value:
81
+
Use the *fn CLI* to set the config value:
75
82
```
76
-
fn config function <your appname> <functionname> ords-base-url <ORDSBaseURL>
77
-
fn config function <your appname> <functionname> db-schema <DBschema>
78
-
fn config function <your appname> <functionname> db-pwd-cypher <DBencryptedpassword>
83
+
fn config function <app-name> <function-name> ords-base-url <ORDS-Base-URL>
84
+
fn config function <app-name> <function-name> db-schema <DB-schema>
85
+
fn config function <app-name> <function-name> db-pwd-cypher <DB-encrypted-password>
Copy file name to clipboardExpand all lines: oci-email-send-python/README.md
+21-27Lines changed: 21 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,41 +5,35 @@ As you make your way through this tutorial, look out for this icon 
8
+
## Prerequisites
9
+
Before you deploy this sample function, make sure you have run step A, B 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)
10
+
* A - Set up your tenancy
11
+
* B - Create application
12
+
* C - Set up your Cloud Shell dev environment
10
13
11
-
2. Have [Fn CLI setup with Oracle Functions](https://docs.cloud.oracle.com/iaas/Content/Functions/Tasks/functionsconfiguringclient.htm?tocpath=Services%7CFunctions%7CPreparing%20for%20Oracle%20Functions%7CConfiguring%20Your%20Client%20Environment%20for%20Function%20Development%7C_____0)
12
14
13
-
14
-
## Create an Application to run your function
15
-
You can use an application already created or create a new one as follow:
0 commit comments