Updated on 2024-07-12 GMT+08:00

Updating Template Metadata

Function

UpdateTemplateMetadata

This API updates template metadata.

  • This API only updates template description.

URI

PATCH /v1/{project_id}/templates/{template_name}/metadata

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. It can be obtained by calling an API or from the console.

Obtaining a Project ID

Minimum: 3

Maximum: 64

template_name

Yes

String

Name of the template to be created.

Minimum: 1

Maximum: 128

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Client-Request-Id

Yes

String

Unique request ID. It is specified by a user and is used to locate a request. UUID is recommended.

Minimum: 36

Maximum: 128

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

template_id

No

String

Unique template ID. It is randomly generated by the template service.

Minimum: 36

Maximum: 36

template_description

No

String

Template description. It can be used by users to identify their own templates.

Minimum: 0

Maximum: 1024

Response Parameters

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 5 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 7 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 9 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 11 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Status code: 429

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 13 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Status code: 500

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 15 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Example Requests

Update template metadata.

PATCH https://{endpoint}/v1/c364070ab35041ddae68cf8b4839b60f/templates/my_template/metadata

{
  "template_id" : "1b15e005-bdbb-4bd7-8f9a-a09b6774b4b3",
  "template_description" : "my template description"
}

Example Responses

None

Status Codes

Status Code

Description

204

Template metadata updated. No data returned.

400

Invalid request.

401

Authentication failed.

403

The user does not have the permission to call this API.

404

The template does not exist.

429

Too frequent requests.

500

Internal server error.