functions
Creates, updates, deletes, gets or lists a functions resource.
Overview​
| Name | functions |
| Type | Resource |
| Id | oci.functions.functions |
Fields​
The following fields are returned by SELECT queries:
- get
- list
Succesfully retrieved function.
| Name | Datatype | Description |
|---|---|---|
id | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the function. |
applicationId | string | The OCID of the application the function belongs to. |
compartmentId | string | The OCID of the compartment that contains the function. |
config | object | Function 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. |
definedTags | object | Defined 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"}} |
detachedModeTimeoutInSeconds | integer (int32) | Timeout for detached function invocations. Value in seconds. Example: {"detachedModeTimeoutInSeconds": 900} |
displayName | string | The display name of the function. The display name is unique within the application containing the function. |
failureDestination | object | An 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"} |
freeformTags | object | Free-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"} |
image | string | The 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 |
imageDigest | string | The 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 |
invokeEndpoint | string | The 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. |
lifecycleState | string | The current state of the function. (CREATING, ACTIVE, INACTIVE, UPDATING, DELETING, DELETED, FAILED) |
memoryInMBs | integer (int64) | Maximum usable memory for the function (MiB). |
provisionedConcurrencyConfig | object | Define the strategy for provisioned concurrency for the function. |
shape | string | The 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) |
sourceDetails | object | The source details for the Function. The function can be created from various sources. |
successDestination | object | An 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"} |
timeCreated | string (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 |
timeUpdated | string (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 |
timeoutInSeconds | integer (int32) | Timeout for executions of the function. Value in seconds. |
traceConfig | object | Define the tracing configuration for a function. |
Summary of a function.<br />
| Name | Datatype | Description |
|---|---|---|
id | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the function. |
applicationId | string | The OCID of the application the function belongs to. |
compartmentId | string | The OCID of the compartment that contains the function. |
definedTags | object | Defined 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"}} |
detachedModeTimeoutInSeconds | integer (int32) | Timeout for detached function invocations. Value in seconds. |
displayName | string | The display name of the function. The display name is unique within the application containing the function. |
failureDestination | object | An 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"} |
freeformTags | object | Free-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"} |
image | string | The 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 |
imageDigest | string | The 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 |
invokeEndpoint | string | The 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. |
lifecycleState | string | The current state of the function. (x-obmcs-enumref: #/definitions/Function/lifecycleState) |
memoryInMBs | integer (int64) | Maximum usable memory for the function (MiB). |
provisionedConcurrencyConfig | object | Define the strategy for provisioned concurrency for the function. |
shape | string | The 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) |
sourceDetails | object | The source details for the Function. The function can be created from various sources. |
successDestination | object | An 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"} |
timeCreated | string (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 |
timeUpdated | string (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 |
timeoutInSeconds | integer (int32) | Timeout for executions of the function. Value in seconds. |
traceConfig | object | Define the tracing configuration for a function. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | functionId, region | opc-request-id | Retrieves a function. |
list | select | applicationId, region | limit, page, opc-request-id, lifecycleState, displayName, id, sortOrder, sortBy | Lists functions for an application. |
create | insert | region, displayName, applicationId, memoryInMBs | opc-request-id | Creates a new function. |
update | update | functionId, region | if-match, opc-request-id | Modifies a function |
delete | delete | functionId, region | if-match, opc-request-id | Deletes a function. |
invoke_function | exec | functionId, region | fn-intent, fn-invoke-type, opc-request-id, is-dry-run | Invokes 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.
| Name | Datatype | Description |
|---|---|---|
applicationId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the application to which this function belongs. |
functionId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of this function. |
region | string | OCI 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) |
displayName | string | A filter to return only functions with display names that match the display name string. Matching is exact. |
fn-intent | string | An optional intent header that indicates to the FDK the way the event should be interpreted. E.g. 'httprequest', 'cloudevent'. |
fn-invoke-type | string | Indicates 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. |
id | string | A filter to return only functions with the specified OCID. |
if-match | string | For 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-run | boolean | Indicates that the request is a dry run, if set to "true". A dry run request does not execute the function. |
lifecycleState | string | A filter to return only functions that match the lifecycle state in this parameter. Example: Creating |
limit | integer | The maximum number of items to return. 1 is the minimum, 50 is the maximum. Default: 10 |
opc-request-id | string | The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. |
page | string | The pagination token for a list query returned by a previous operation |
sortBy | string | Specifies the attribute with which to sort the rules. Default: displayName * timeCreated: Sorts by timeCreated. * displayName: Sorts by displayName. * id: Sorts by id. |
sortOrder | string | Specifies sort order. * ASC: Ascending sort order. * DESC: Descending sort order. |
SELECT examples​
- get
- list
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 }}'
;
Lists functions for an application.
SELECT
id,
applicationId,
compartmentId,
definedTags,
detachedModeTimeoutInSeconds,
displayName,
failureDestination,
freeformTags,
image,
imageDigest,
invokeEndpoint,
lifecycleState,
memoryInMBs,
provisionedConcurrencyConfig,
shape,
sourceDetails,
successDestination,
timeCreated,
timeUpdated,
timeoutInSeconds,
traceConfig
FROM oci.functions.functions
WHERE applicationId = '{{ applicationId }}' -- required
AND region = '{{ region }}' -- required
AND limit = '{{ limit }}'
AND page = '{{ page }}'
AND opc-request-id = '{{ opc-request-id }}'
AND lifecycleState = '{{ lifecycleState }}'
AND displayName = '{{ displayName }}'
AND id = '{{ id }}'
AND sortOrder = '{{ sortOrder }}'
AND sortBy = '{{ sortBy }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: functions
props:
- name: region
value: "{{ region }}"
description: Required parameter for the functions resource.
- name: applicationId
value: "{{ applicationId }}"
description: |
The OCID of the application this function belongs to.
- name: config
value: "{{ config }}"
description: |
Function configuration. These values are passed on to the function as environment variables, this overrides application configuration values.
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.
- name: definedTags
value: "{{ definedTags }}"
description: |
Defined 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"}}`
- name: detachedModeTimeoutInSeconds
value: {{ detachedModeTimeoutInSeconds }}
description: |
Timeout for detached function invocations. Value in seconds.
- name: displayName
value: "{{ displayName }}"
description: |
The display name of the function. The display name must be unique within the application containing the function. Avoid entering confidential information.
- name: failureDestination
description: |
An 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"}`
value:
kind: "{{ kind }}"
- name: freeformTags
value: "{{ freeformTags }}"
description: |
Free-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"}`
- name: image
value: "{{ image }}"
description: |
The 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`
- name: imageDigest
value: "{{ imageDigest }}"
description: |
The 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`
- name: memoryInMBs
value: {{ memoryInMBs }}
description: |
Maximum usable memory for the function (MiB).
- name: provisionedConcurrencyConfig
description: |
Define the strategy for provisioned concurrency for the function.
value:
strategy: "{{ strategy }}"
- name: sourceDetails
description: |
The source details for the Function. The function can be created from various sources.
value:
sourceType: "{{ sourceType }}"
- name: successDestination
description: |
An 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"}`
value:
kind: "{{ kind }}"
- name: timeoutInSeconds
value: {{ timeoutInSeconds }}
description: |
Timeout for executions of the function. Value in seconds.
default: 30
- name: traceConfig
description: |
Define the tracing configuration for a function.
value:
isEnabled: {{ isEnabled }}
- name: opc-request-id
value: "{{ opc-request-id }}"
description: The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
description: The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
UPDATE examples​
- update
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​
- delete
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​
- invoke_function
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 }}
;