DeliverToUserSls

Updated at:

Configures operation log delivery for specified products and writes the logs to a Simple Log Service (SLS) project and Logstore of the current account.

Operation description

Before you begin

  • Specify the region where SLS is deployed and at least one product delivery scope.

  • Specify either ProjectName or ExistedProjectName. If you use an existing project, make sure that it belongs to the current account and is located in the specified region.

  • Only one enabled delivery configuration can exist for the same account and product type. Before you call this operation, you can call DescribeSlsDeliveryConfig to query existing configurations. If an enabled configuration already exists, calling this operation again returns SlsDeliveryAlreadyExists.

Configuration management

  • This operation is used to configure delivery, not to query logs.

  • To pause delivery, call StopDeliveryConfig. Stopping delivery does not delete the delivery configuration.

  • To reconfigure the delivery destination or rebuild the configuration, query and delete the corresponding old configuration by calling DeleteDeliveryConfig before you call this operation. Deleting a delivery configuration does not delete the SLS project or Logstore.

  • Do not treat repeated calls for an existing configuration as update or resume operations. After the call, you can call DescribeSlsDeliveryConfig to confirm the configuration status.

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

appstreaming:DeliverToUserSls

create

*All Resource

*

None None

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

ProjectName

string

No

The name of the SLS project to be created or reused. The name must start with elastic-desktop-.

Specify either this parameter or ExistedProjectName. If the project does not exist, it is created. If the project already exists, it is reused.

elastic-desktop-audit

LogStoreName

string

No

The name of the destination Logstore. The name must start with elastic_desktop_. If the Logstore does not exist, it is created. If the Logstore already exists, it is reused.

If this parameter is not specified, the part after elastic-desktop- in the selected project name is used as a suffix to generate a name that starts with elastic_desktop_. For example, if the project name is elastic-desktop-audit, the default Logstore name is elastic_desktop_audit.

elastic_desktop_audit

Ttl

integer

No

The data retention period of the new Logstore. Unit: days.

Valid values: 1 to 3650.

Default value: 30.

If an existing Logstore is reused, this operation does not update its data retention period.

30

ExistedProjectName

string

No

The name of an existing SLS project. The name must start with elastic-desktop- and the project must already exist in the specified SLS region of the current account.

Specify either this parameter or ProjectName.

elastic-desktop-audit

SlsRegionId

string

Yes

The ID of the region where the destination SLS project is located. This parameter is required.

cn-hangzhou

DeliveryScopes

array<object>

Yes

The list of product scopes for which delivery needs to be configured. Specify at least one item. You cannot create duplicate enabled delivery configurations for the same account and product type.

[{"ProductType":"CloudBrowser"}]

object

No

A product delivery scope.

ProductType

string

Yes

The product type to which the logs belong. Specify the product type for which you want to enable log delivery. For example, CloudBrowser indicates Cloud Browser.

CloudBrowser

The project name must start with elastic-desktop-, and the Logstore name must start with elastic_desktop_. The example names only demonstrate the format. Replace them with actual names.

Response elements

Element

Type

Description

Example

object

The processing result of the delivery configuration.

RequestId

string

The ID of the request. It is used to troubleshoot call issues.

1CBAFFAB-B697-4049-A9B1-67E1FC5F****

The request ID is returned upon success. A success response does not indicate that new logs have been generated in the destination Logstore. You can call the operation for querying delivery configurations to confirm the status.

Examples

Success response

JSON format

{
  "RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.