Help Center/ FunctionGraph/ API Reference/ APIs/ Dependencies/ Querying Dependency Versions
Updated on 2024-11-07 GMT+08:00

Querying Dependency Versions

Function

This API is used to query dependency versions.

URI

GET /v2/{project_id}/fgs/dependencies/{depend_id}/version

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID.

depend_id

Yes

String

Dependency ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

marker

No

String

Final record queried last time. Default value: 0.

maxitems

No

String

Maximum number of items to return in a request.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Content-Type

Yes

String

Message body type (format).

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

dependencies

Array of ListDependencyVersionsResult objects

Dependency list.

next_marker

Long

Next read position.

count

Long

Total number of dependencies.

Table 5 ListDependencyVersionsResult

Parameter

Type

Description

id

String

Dependency version ID.

owner

String

Dependency owner. public indicates that the dependency is public.

link

String

URL of the dependency in OBS.

runtime

String

Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Python 3.10 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 Node.js 16.17 Node.js 18.15 C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions Cangjie1.0

Enumeration values:

  • Java8
  • Java11
  • Node.js6.10
  • Node.js8.10
  • Node.js10.16
  • Node.js12.13
  • Node.js14.18
  • Node.js16.17
  • Node.js18.15
  • Python2.7
  • Python3.6
  • Python3.10
  • Go1.x
  • C#(.NET Core 2.1)
  • C#(.NET Core 3.1)
  • Custom
  • PHP7.3
  • Python3.9
  • http
  • Custom Image
  • Cangjie1.0

etag

String

Unique identifier of the dependency (MD5 verification value).

size

Long

Size of the dependency.

name

String

Dependency name.

file_name

String

Dependency file name.

description

String

Dependency description.

version

Long

Dependency version.

last_modified

Long

Time when the dependency was last updated.

dep_id

String

Dependency ID.

is_shared

Boolean

Whether to share the dependency version. (discarded)

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

Query dependencies of the current tenant.

GET /v2/{project_id}/fgs/dependencies/{depend_id}/version?marker=0&maxitems=400

Example Responses

Status code: 200

ok

{
  "dependencies" : [ {
    "id" : "6578de50-9a18-48fa-b84e-b2d36636e433",
    "owner" : "public",
    "link" : "https://{obs_endpoint}/functionstage-examples/fg_test_pandas_1.1.3.zip",
    "runtime" : "Python3.6",
    "etag" : "35a893d9495b3e22259b2773996bc94d-6",
    "size" : 31009808,
    "name" : "panda1.1.3"
  } ],
  "next_marker" : 43,
  "count" : 43
}

Status Codes

Status Code

Description

200

ok

401

Unauthorized.

403

Forbidden.

404

Not found.

500

Internal server error.

Error Codes

See Error Codes.