UpdateNamespaceSlsConfigs

更新时间:
复制 MD 格式

Updates the namespace-level SLS configuration.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

sae:UpdateNamespaceSlsConfigs

update

*All Resource

*

None None

Request syntax

POST /pop/cas/namespace/updateNamespaceSlsConfigs HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

NamespaceId

string

No

The ID of the namespace.

cn-beijing:test

NameSpaceShortId

string

No

The short ID of the namespace. You do not need to include the region. This parameter is recommended.

test

SlsConfigs

string

No

The configuration for collecting logs to SLS.

  • To use an SLS resource that is automatically created by SAE: [{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}].

  • To use a custom SLS resource: [{"projectName":"test-sls","logType":"stdout","logDir":"","logstoreName":"sae","logtailName":""},{"projectName":"test","logDir":"/tmp/a.log","logstoreName":"sae","logtailName":""}].

The parameters are described as follows:

  • projectName: The name of the SLS project.

  • logDir: The log path.

  • logType: The log type. A value of stdout specifies container standard output logs. You can specify only one stdout configuration. If you do not set this parameter, file logs are collected.

  • logstoreName: The name of the SLS logstore.

  • logtailName: The name of the Logtail. If you do not specify this parameter, a new Logtail is created.

If the SLS configuration remains the same across deployments, you can omit this parameter. To disable log collection to SLS, set the value of SlsConfigs to an empty string ("").

Note

SAE automatically deletes a project when you delete the task template used to create it. Therefore, when you select an existing project, do not select a project that was automatically created by SAE.

[{"projectName":"test","logDir":"/tmp/a.log","logstoreName":"sae","logtailName":""}]

SlsLogEnvTags

string

No

The SLS log tags.

Response elements

Element

Type

Description

Example

object

The response schema.

requestId

string

The request ID.

AD0286B2-F4A4-5D43-9329-97DEF1019F06

Message

string

Additional information.

success

TraceId

string

The trace ID for the request. You can use this ID to query the details of the request.

0a98a02315955564772843261e****

ErrorCode

string

The error code. Valid values:

  • If the request is successful, the response does not include the ErrorCode parameter.

  • If the request fails, the response includes the ErrorCode parameter. For more information, see the Error codes section of this topic.

InvalidNamespaceId.NotFound

Code

string

The API status code or POP error code. Valid values: 2xx (success), 3xx (redirect), 4xx (client error), 5xx (server error).

200

Success

boolean

Indicates whether the namespace's SLS configuration was successfully updated. A value of true indicates success, while false indicates failure.

true

Examples

Success response

JSON format

{
  "requestId": "AD0286B2-F4A4-5D43-9329-97DEF1019F06",
  "Message": "success",
  "TraceId": "0a98a02315955564772843261e****",
  "ErrorCode": "InvalidNamespaceId.NotFound",
  "Code": "200",
  "Success": true
}

Error codes

HTTP status code

Error code

Error message

Description

404 InvalidNamespaceId.NotFound The specified NamespaceId does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.