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

Modifying a Global Variable

Function

This API is used to modify a global variable.

URI

  • URI format

    PUT /v1.0/{project_id}/variables/{var_name}

  • Parameter description
    Table 1 URI parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID, which is used for resource isolation. For details about how to obtain its value, see Obtaining a Project ID.

    var_name

    Yes

    String

    A global variable name can contain a maximum of 128 characters, including only digits, letters, and underscores (_), but cannot start with an underscore (_) or contain only digits.

Request

Table 2 Request parameters

Parameter

Mandatory

Type

Description

var_value

Yes

String

Global variable value.

Response

Table 3 Response parameters

Parameter

Mandatory

Type

Description

is_success

No

Boolean

Indicates whether the request is successfully executed. Value true indicates that the request is successfully executed.

message

No

String

Message content.

Example Request

Change the value of a sensitive variable.

{
    "var_value": "string"
}

Example Response

{
    "is_success": true,
    "message": "string"
}

Status Codes

Table 4 describes status codes.

Table 4 Status codes

Status Code

Description

200

A variable is modified successfully.

400

The input parameter is invalid.

Error Codes

If an error occurs when this API is invoked, the system does not return the result similar to the preceding example, but returns the error code and error information. For details, see Error Codes.

Table 5 Error codes

Error Code

Error Message

DLI.0001

Parameter check errors occur.

DLI.0999

Server-side errors occur.

DLI.12004

The job does not exist. Check the reason or create a job.