Skip to main content
GET
/
cloud
/
v1
/
faas
/
namespaces
/
{project_id}
/
{region_id}
/
{namespace_name}
/
functions
/
{function_name}
Get function
curl --request GET \
  --url https://api.gcore.com/cloud/v1/faas/namespaces/{project_id}/{region_id}/{namespace_name}/functions/{function_name} \
  --header 'Authorization: <api-key>'
{
  "autoscaling": {
    "max_instances": 2,
    "min_instances": 1
  },
  "build_message": "Building",
  "build_status": "Building",
  "code_text": "def main():\n    return 'Hello World'",
  "created_at": "2023-08-22T11:21:00Z",
  "dependencies": "numpy==1.21.0\npandas==1.3.0",
  "deploy_status": {
    "deployed": 1
  },
  "description": "This is a sample function.",
  "enable_api_key": true,
  "endpoint": "https://example.com/function-name",
  "envs": {
    "ENV_VAR": "value"
  },
  "flavor": "64m-64MB",
  "id": "c8a920ad-b5a4-47d5-b8b9-0e6c35cd800f",
  "main_method": "run",
  "name": "function-name",
  "runtime": "python3.7.12",
  "status": "Running",
  "timeout": 5
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

project_id
integer
required

Project ID

Examples:

1

region_id
integer
required

Region ID

Examples:

1

namespace_name
string
required

Namespace name

Examples:

"namespace-name"

function_name
string
required

Function name

Examples:

"function-name"

Response

200 - application/json

OK

autoscaling
object
required

Autoscaling configuration for the function. Keys must be 'min_instances' or 'max_instances', and values must be integers between 0 and 50.

build_message
string
required

Function build message.

Examples:

"Building"

build_status
string
required

Function build status.

Examples:

"Building"

code_text
string
required

Function code text.

Required string length: 1 - 100000
Examples:

"def main():\n return 'Hello World'"

created_at
string
required

Function creation date.

Examples:

"2023-08-22T11:21:00Z"

dependencies
string
required

Dependencies for the function to install.

Maximum length: 100000
Examples:

"numpy==1.21.0\npandas==1.3.0"

deploy_status
object
required

Function deploy status.

Examples:
{ "deployed": 1 }
description
string
required

Description of the function.

Maximum length: 255
Examples:

"This is a sample function."

endpoint
string
required

Function endpoint.

Examples:

"https://example.com/function-name"

flavor
string
required

The name of the flavor associated with the function.

Examples:

"64m-64MB"

id
string
required

Function ID.

Examples:

"c8a920ad-b5a4-47d5-b8b9-0e6c35cd800f"

main_method
string
required

The main startup method name.

Required string length: 1 - 100
Examples:

"run"

name
string
required

Function name.

Examples:

"function-name"

runtime
string
required

Function runtime.

Examples:

"python3.7.12"

status
string
required

Function status.

Examples:

"Running"

timeout
integer
required

Function timeout in seconds.

Required range: 0 <= x <= 180
Examples:

5

enable_api_key
boolean | null

Enable or disable API key authentication.

Examples:

true

envs
object | null

Environment variables for the function. Keys must match a specific regex pattern and be 1-255 characters long, and values must be 0-255 characters long.

Examples:
{ "ENV_VAR": "value" }
I