Updated on 2022-02-22 GMT+08:00

Deleting a Function or Function Version

Function

This API is used to delete a function or function version except the LATEST version. Specifically:

  • If the URN contains a function version or alias, the function version or the version corresponding to the specified alias as well as associated triggers will be deleted.
  • If the URN does not contain a function version or alias, the entire function as well as all its versions, aliases, and triggers will be deleted.

URI

DELETE /v2/{project_id}/fgs/functions/{function_urn}

Table 1 describes the URI parameters.

Table 1 URI parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Project ID.

function_urn

String

Yes

Function URN. See Function Model.

NOTE:

The LATEST version of a function cannot be deleted. To delete a function and all its versions, provide a URN without any version or alias. Example: urn:fss:xxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test.

Request

None

Response

None

Example

Example request

DELETE  /v2/7aad83af3e8d42e99ac194e8419e2c9b/fgs/functions/urn:fss:xxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test:v20170830-181539 HTTP/1.1

Example response

The format of the response for a successful request is as follows:

HTTP/1.1 204

The format of the response for a failed request is as follows:

HTTP/1.1 404 Not Found 
{ 
  "error_code": "FSS.1051", 
  "error_msg": "Not found the function" 
 }

Status Code

See Status Codes.