Skip to main content

functions

Creates, updates, deletes, gets or lists a functions resource.

Overview​

Namefunctions
TypeResource
Idoci.functions.functions

Fields​

The following fields are returned by SELECT queries:

Succesfully retrieved function.

NameDatatypeDescription
idstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the function.
applicationIdstringThe OCID of the application the function belongs to.
compartmentIdstringThe OCID of the compartment that contains the function.
configobjectFunction configuration. Overrides application configuration. Keys must be ASCII strings consisting solely of letters, digits, and the '_' (underscore) character, and must not begin with a digit. Values should be limited to printable unicode characters. Example: {"MY_FUNCTION_CONFIG": "ConfVal"} The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8.
definedTagsobjectDefined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm). Example: {"Operations": {"CostCenter": "42"}}
detachedModeTimeoutInSecondsinteger (int32)Timeout for detached function invocations. Value in seconds. Example: {"detachedModeTimeoutInSeconds": 900}
displayNamestringThe display name of the function. The display name is unique within the application containing the function.
failureDestinationobjectAn object that represents the destination to which Oracle Functions will send an invocation record with the details of the error of the failed detached function invocation. A notification is an example of a failure destination. Example: {"kind": "NOTIFICATION", "topicId": "topic_OCID"}
freeformTagsobjectFree-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"}
imagestringThe qualified name of the Docker image to use in the function, including the image tag. The image should be in the OCI Registry that is in the same region as the function itself. Example: phx.ocir.io/ten/functions/function:0.0.1
imageDigeststringThe image digest for the version of the image that will be pulled when invoking this function. If no value is specified, the digest currently associated with the image in the OCI Registry will be used. Example: sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7
invokeEndpointstringThe base https invoke URL to set on a client in order to invoke a function. This URL will never change over the lifetime of the function and can be cached.
lifecycleStatestringThe current state of the function. (CREATING, ACTIVE, INACTIVE, UPDATING, DELETING, DELETED, FAILED)
memoryInMBsinteger (int64)Maximum usable memory for the function (MiB).
provisionedConcurrencyConfigobjectDefine the strategy for provisioned concurrency for the function.
shapestringThe processor shape (GENERIC_X86/GENERIC_ARM) on which to run functions in the application, extracted from the image manifest. (GENERIC_X86, GENERIC_ARM, GENERIC_X86_ARM)
sourceDetailsobjectThe source details for the Function. The function can be created from various sources.
successDestinationobjectAn object that represents the destination to which Oracle Functions will send an invocation record with the details of the successful detached function invocation. A stream is an example of a success destination. Example: {"kind": "STREAM", "streamId": "stream_OCID"}
timeCreatedstring (date-time)The time the function was created, expressed in [RFC 3339](https:​//tools.ietf.org/html/rfc3339) timestamp format. Example: 2018-09-12T22:47:12.613Z
timeUpdatedstring (date-time)The time the function was updated, expressed in [RFC 3339](https:​//tools.ietf.org/html/rfc3339) timestamp format. Example: 2018-09-12T22:47:12.613Z
timeoutInSecondsinteger (int32)Timeout for executions of the function. Value in seconds.
traceConfigobjectDefine the tracing configuration for a function.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectfunctionId, regionopc-request-idRetrieves a function.
listselectapplicationId, regionlimit, page, opc-request-id, lifecycleState, displayName, id, sortOrder, sortByLists functions for an application.
createinsertregion, displayName, applicationId, memoryInMBsopc-request-idCreates a new function.
updateupdatefunctionId, regionif-match, opc-request-idModifies a function
deletedeletefunctionId, regionif-match, opc-request-idDeletes a function.
invoke_functionexecfunctionId, regionfn-intent, fn-invoke-type, opc-request-id, is-dry-runInvokes a function

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
applicationIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the application to which this function belongs.
functionIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of this function.
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
displayNamestringA filter to return only functions with display names that match the display name string. Matching is exact.
fn-intentstringAn optional intent header that indicates to the FDK the way the event should be interpreted. E.g. 'httprequest', 'cloudevent'.
fn-invoke-typestringIndicates whether Oracle Functions should execute the request and return the result ('sync') of the execution, or whether Oracle Functions should return as soon as processing has begun ('detached') and leave result handling to the function.
idstringA filter to return only functions with the specified OCID.
if-matchstringFor optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.
is-dry-runbooleanIndicates that the request is a dry run, if set to "true". A dry run request does not execute the function.
lifecycleStatestringA filter to return only functions that match the lifecycle state in this parameter. Example: Creating
limitintegerThe maximum number of items to return. 1 is the minimum, 50 is the maximum. Default: 10
opc-request-idstringThe unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
pagestringThe pagination token for a list query returned by a previous operation
sortBystringSpecifies the attribute with which to sort the rules. Default: displayName * timeCreated: Sorts by timeCreated. * displayName: Sorts by displayName. * id: Sorts by id.
sortOrderstringSpecifies sort order. * ASC: Ascending sort order. * DESC: Descending sort order.

SELECT examples​

Retrieves a function.

SELECT
id,
applicationId,
compartmentId,
config,
definedTags,
detachedModeTimeoutInSeconds,
displayName,
failureDestination,
freeformTags,
image,
imageDigest,
invokeEndpoint,
lifecycleState,
memoryInMBs,
provisionedConcurrencyConfig,
shape,
sourceDetails,
successDestination,
timeCreated,
timeUpdated,
timeoutInSeconds,
traceConfig
FROM oci.functions.functions
WHERE functionId = '{{ functionId }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
;

INSERT examples​

Creates a new function.

INSERT INTO oci.functions.functions (
applicationId,
config,
definedTags,
detachedModeTimeoutInSeconds,
displayName,
failureDestination,
freeformTags,
image,
imageDigest,
memoryInMBs,
provisionedConcurrencyConfig,
sourceDetails,
successDestination,
timeoutInSeconds,
traceConfig,
region,
opc-request-id
)
SELECT
'{{ applicationId }}' /* required */,
'{{ config }}',
'{{ definedTags }}',
{{ detachedModeTimeoutInSeconds }},
'{{ displayName }}' /* required */,
'{{ failureDestination }}',
'{{ freeformTags }}',
'{{ image }}',
'{{ imageDigest }}',
{{ memoryInMBs }} /* required */,
'{{ provisionedConcurrencyConfig }}',
'{{ sourceDetails }}',
'{{ successDestination }}',
{{ timeoutInSeconds }},
'{{ traceConfig }}',
'{{ region }}',
'{{ opc-request-id }}'
RETURNING
id,
applicationId,
compartmentId,
config,
definedTags,
detachedModeTimeoutInSeconds,
displayName,
failureDestination,
freeformTags,
image,
imageDigest,
invokeEndpoint,
lifecycleState,
memoryInMBs,
provisionedConcurrencyConfig,
shape,
sourceDetails,
successDestination,
timeCreated,
timeUpdated,
timeoutInSeconds,
traceConfig
;

UPDATE examples​

Modifies a function

UPDATE oci.functions.functions
SET
config = '{{ config }}',
definedTags = '{{ definedTags }}',
detachedModeTimeoutInSeconds = {{ detachedModeTimeoutInSeconds }},
failureDestination = '{{ failureDestination }}',
freeformTags = '{{ freeformTags }}',
image = '{{ image }}',
imageDigest = '{{ imageDigest }}',
memoryInMBs = {{ memoryInMBs }},
provisionedConcurrencyConfig = '{{ provisionedConcurrencyConfig }}',
successDestination = '{{ successDestination }}',
timeoutInSeconds = {{ timeoutInSeconds }},
traceConfig = '{{ traceConfig }}'
WHERE
functionId = '{{ functionId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
AND opc-request-id = '{{ opc-request-id}}'
RETURNING
id,
applicationId,
compartmentId,
config,
definedTags,
detachedModeTimeoutInSeconds,
displayName,
failureDestination,
freeformTags,
image,
imageDigest,
invokeEndpoint,
lifecycleState,
memoryInMBs,
provisionedConcurrencyConfig,
shape,
sourceDetails,
successDestination,
timeCreated,
timeUpdated,
timeoutInSeconds,
traceConfig;

DELETE examples​

Deletes a function.

DELETE FROM oci.functions.functions
WHERE functionId = '{{ functionId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
AND opc-request-id = '{{ opc-request-id }}'
;

Lifecycle Methods​

Invokes a function

EXEC oci.functions.functions.invoke_function
@functionId='{{ functionId }}' --required,
@region='{{ region }}' --required,
@fn-intent='{{ fn-intent }}',
@fn-invoke-type='{{ fn-invoke-type }}',
@opc-request-id='{{ opc-request-id }}',
@is-dry-run={{ is-dry-run }}
;