Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9617599

Browse files
committed
morning updates
1 parent 785f689 commit 9617599

File tree

11 files changed

+232
-301
lines changed

11 files changed

+232
-301
lines changed

‎oci-adb-client-runsql-python/README.md

Lines changed: 31 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -5,67 +5,45 @@ As you make your way through this tutorial, look out for this icon ![user input
55
Whenever you see it, it's time for you to perform an action.
66

77

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)
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
1013

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)
1214

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-
![user input icon](./images/userinput.png)
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
17+
application in the list of applications.
2518
```
26-
* Matching a specific function by its OCID:
27-
```
28-
resource.id = 'ocid1.fnfunc.oc1.iad.aaaaaaaaacq______dnya'
29-
```
30-
* Matching functions with a defined tag (free-form tags are not supported):
31-
```
32-
ALL {resource.type = 'fnfunc', tag.department.operations.value = '45'}
19+
fn ls apps
3320
```
3421

3522

36-
## Create an Application to run your function
37-
You can use an application already created or create a new one as follow:
38-
39-
![user input icon](./images/userinput.png)
40-
```
41-
fn create app <app-name> --annotation oracle.com/oci/subnetIds='["<subnet-ocid>"]'
42-
```
43-
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).
4725

48-
e.g.
26+
When specifying the *Matching Rules*, we suggest matching all functions in a compartment with:
4927
```
50-
fn create app myapp --annotation oracle.com/oci/subnetIds='["ocid1.subnet.oc1.phx.aaaaaaaacnh..."]'
28+
ALL {resource.type = 'fnfunc', resource.compartment.id = 'ocid1.compartment.oc1..aaaaaxxxxx'}
5129
```
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.
5231

5332

54-
## Review and customize your function
33+
## Review and customize the function
5534
Review the following files in the current folder:
5635
* the code of the function, [func.py](./func.py)
5736
* its dependencies, [requirements.txt](./requirements.txt)
5837
* the function metadata, [func.yaml](./func.yaml)
5938

6039

6140
## 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+
6244
![user input icon](./images/userinput.png)
6345
```
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>
6947
```
7048

7149

@@ -103,44 +81,36 @@ Create an IAM policy that allows the dynamic group to read objects in the bucket
10381

10482
Your policy should look something like this:
10583
```
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>'
11185
```
11286

11387
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'.
11488
```
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'
12090
```
12191

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).
12393

12494

12595
## Set the function configuration values
12696
The function requires several config value to be set.
12797

12898
![user input icon](../images/userinput.png)
12999

130-
Use the *fn* CLI to set the config value:
100+
Use the *fn CLI* to set the config value:
131101
```
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>
135105
```
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:
137107
```
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>
140110
```
141111
or:
142112
```
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>
144114
```
145115
e.g. with a DB wallet in a bucket:
146116
```
@@ -156,7 +126,7 @@ fn config function myapp oci-adb-client-runsql-python DBWALLET_OBJECT "Wallet_gr
156126
![user input icon](./images/userinput.png)
157127
```
158128
159-
echo '{"sql_statement":"<sql statement>"}' | fn invoke <your appname> oci-adb-client-runsql-python
129+
echo '{"sql_statement":"<sql statement>"}' | fn invoke <app-name> oci-adb-client-runsql-python
160130
```
161131
e.g.:
162132
```

‎oci-adb-ords-runsql-python/README.md

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,52 @@ This function connects to an Autonomous Database using ORDS and executes a SQL s
55
As you make your way through this tutorial, look out for this icon ![user input icon](./images/userinput.png).
66
Whenever you see it, it's time for you to perform an action.
77

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)
108

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
1214

13-
## Create an Application to run your function
14-
You can use an application already created or create a new one as follow:
1515

16-
![user input icon](./images/userinput.png)
16+
## List Applications
17+
Assuming your have successfully completed the prerequisites, you should see your
18+
application in the list of applications.
1719
```
18-
fn create app <app-name> --annotation oracle.com/oci/subnetIds='["<subnet-ocid>"]'
20+
fn ls apps
1921
```
20-
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.
2422

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:
2628
```
27-
fn create app myapp --annotation oracle.com/oci/subnetIds='["ocid1.subnet.oc1.phx.aaaaaaaacnh..."]'
29+
ALL {resource.type = 'fnfunc', resource.compartment.id = 'ocid1.compartment.oc1..aaaaaxxxxx'}
2830
```
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.
2932

30-
## Review and customize your function
33+
34+
35+
## Review and customize the function
3136
Review the following files in the current folder:
3237
* the code of the function, [func.py](./func.py)
3338
* its dependencies, [requirements.txt](./requirements.txt)
3439
* the function metadata, [func.yaml](./func.yaml)
3540

3641
In the code, we assume the schema and the database username are the same. Feel free to change this.
3742

43+
3844
## 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+
3948
![user input icon](./images/userinput.png)
4049
```
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>
4651
```
4752

53+
4854
## Create an Autonomous Database
4955
Use an existing Autonomous Database (either Transaction Processing or Datawarehouse) or create a new one as follows.
5056

@@ -67,15 +73,16 @@ On the Service Console, navigate to Development and copy the ORDS Base URL, we w
6773

6874
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.
6975

76+
7077
## Set the function configuration values
7178
The function requires the config value *ords-base-url*, *db-schema* and *db-pwd-cypher* to be set.
7279
![user input icon](../images/userinput.png)
7380

74-
Use the *fn* CLI to set the config value:
81+
Use the *fn CLI* to set the config value:
7582
```
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>
7986
```
8087
e.g.
8188
```
@@ -84,11 +91,12 @@ fn config function myapp oci-adb-ords-runsql-python db-schema "admin"
8491
fn config function myapp oci-adb-ords-runsql-python db-pwd-cypher "xxxxxxxxx"
8592
```
8693

94+
8795
## Invoke the function
8896
![user input icon](./images/userinput.png)
8997
```
9098
91-
echo '{"sql":"<sql statement>"}' | fn invoke <your appname> oci-adb-ords-runsql-python
99+
echo '{"sql":"<sql statement>"}' | fn invoke <app-name> oci-adb-ords-runsql-python
92100
```
93101
e.g.:
94102
```

‎oci-email-send-python/README.md

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,35 @@ As you make your way through this tutorial, look out for this icon ![user input
55
Whenever you see it, it's time for you to perform an action.
66

77

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)
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
1013

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)
1214

13-
14-
## Create an Application to run your function
15-
You can use an application already created or create a new one as follow:
16-
![user input icon](./images/userinput.png)
17-
```
18-
fn create app <app-name> --annotation oracle.com/oci/subnetIds='["<subnet-ocid>"]'
19-
```
20-
Get the OCID of the subnet in your VCN you wish to use.
21-
22-
e.g.
15+
## List Applications
16+
Assuming your have successfully completed the prerequisites, you should see your
17+
application in the list of applications.
2318
```
24-
fn create app myapp --annotation oracle.com/oci/subnetIds='["ocid1.subnet.oc1.phx.aaaaaaaacnh..."]'
19+
fn ls apps
2520
```
2621

2722

28-
## Review and customize your function
23+
## Review and customize the function
2924
Review the following files in the current folder:
3025
* the code of the function, [func.py](./func.py)
3126
* its dependencies, [requirements.txt](./requirements.txt)
3227
* the function metadata, [func.yaml](./func.yaml)
3328

3429

3530
## Deploy the function
31+
In Cloud Shell, run the *fn deploy* command to build the function and its dependencies as a Docker image,
32+
push the image to OCIR, and deploy the function to Oracle Functions in your application.
33+
3634
![user input icon](./images/userinput.png)
3735
```
38-
fn -v deploy --app <your app name>
39-
```
40-
e.g.
41-
```
42-
fn -v deploy --app myapp
36+
fn -v deploy --app <app-name>
4337
```
4438

4539

@@ -68,12 +62,12 @@ The function requires the following configuration values to be set:
6862

6963
![user input icon](../images/userinput.png)
7064

71-
Use the *fn* CLI to set the config value:
65+
Use the *fn CLI* to set the config value:
7266
```
73-
fn config function <your appname> <functionname> smtp-username <SMTPusername>
74-
fn config function <your appname> <functionname> smtp-password <SMTPpassword>
75-
fn config function <your appname> <functionname> smtp-host <SMTPServername>
76-
fn config function <your appname> <functionname> smtp-port <SMTPPort>
67+
fn config function <app-name> <function-name> smtp-username <SMTP-username>
68+
fn config function <app-name> <function-name> smtp-password <SMTP-password>
69+
fn config function <app-name> <function-name> smtp-host <SMTP-Server-name>
70+
fn config function <app-name> <function-name> smtp-port <SMTP-Port>
7771
```
7872
e.g.
7973
```
@@ -94,8 +88,8 @@ The function requires the following keys in the payload to be invoked:
9488

9589
![user input icon](./images/userinput.png)
9690
```
97-
echo '{ "sender-email":"<approvedsenderemail>", "sender-name":"<sendername>", "recipient":"<recipientemail>",
98-
"subject":"<emailsubject>", "body":"<emailbody>" }' | fn invoke <your appname> oci-email-send-python
91+
echo '{ "sender-email":"<approved-sender-email>", "sender-name":"<sender-name>", "recipient":"<recipient-email>",
92+
"subject":"<email-subject>", "body":"<email-body>" }' | fn invoke <app-name> oci-email-send-python
9993
```
10094
e.g.:
10195
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /