All Products
Search
Document Center

Elastic Container Instance:CreateInstanceOpsTask

Last Updated:Oct 17, 2025

Call CreateInstanceOpsTask to create an Operations and Maintenance (O&M) task.

Operation description

API description

O&M tasks support the following two types:

  • coredump: After you enable coredump, the system generates a core file when a container ends abnormally. This file helps you analyze the issue and determine its cause. For more information, see Enable coredump.

  • tcpdump: After you enable tcpdump, the system captures network packets. This helps you analyze messages and locate network issues. For more information, see Enable tcpdump.

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

eci:CreateInstanceOpsTask

create

*All Resource

*

  • eci:tag
None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID.

cn-hangzhou

RegionId

string

Yes

The region ID.

cn-hangzhou

ContainerGroupId

string

Yes

The ID of the ECI instance.

eci-bp1dvysdafbh00t7****

OpsType

string

Yes

The type of the O&M task. Valid values:

  • coredump

  • tcpdump

coredump

OpsValue

string

Yes

The parameters for the O&M task. The parameters that you can set vary based on the value of OpsType.

  • If you set OpsType to coredump, valid values for OpsValue are:
    • enable: Enables coredump.

    • disable: Disables coredump.

  • If you set OpsType to tcpdump, set OpsValue to a JSON string of parameters. For example, {"Enable":true, "IfDeviceName":"eth0"}. The following parameters are available:
    • Enable: Specifies whether to enable tcpdump. This parameter is required. Set the value to true to enable tcpdump or false to disable it.

    • Protocol: The network protocol. Valid values: tcp, udp, and icmpv4.

    • SourceIp: The source IP address.

    • SourceCidr: The source CIDR block. The value must be in CIDR format. If you specify both an IP address and a CIDR block, the CIDR block takes precedence.

    • SourcePort: The source port. The value must be in the range of 1 to 65535.

    • DestIp: The destination IP address.

    • DestCidr: The destination CIDR block. The value must be in CIDR format. If you specify both an IP address and a CIDR block, the CIDR block takes precedence.

    • DestPort: The destination port. The value must be in the range of 1 to 65535.

    • IfDeviceName: The destination network interface card (NIC). The default value is eth0.

    • Snaplen: The length of the captured packet. The default value is 65535 bytes.

    • Duration: The capture duration. Unit: seconds.

    • PacketNum: The number of packets to capture.

    • FileSize: The size of the object file for the captured packets. Unit: bytes. The maximum value is 1073741824 bytes (1 GB).

enable

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

89945DD3-9072-47D0-A318-353284CFC7B

Result

string

The result of the O&M task execution.

Enable Success

Examples

Success response

JSON format

{
  "RequestId": "89945DD3-9072-47D0-A318-353284CFC7B",
  "Result": "Enable Success"
}

Error codes

HTTP status code

Error code

Error message

Description

400 Coredump.RefrshIntervalTooShort The time interval since last setting too short, please try again later.
400 Ops.TypeNotSupport %s
400 Coredump.RegionNotSupport %s
400 CorePattern.UpdateFail Update coredump settings fail, please try again later
400 Coredump.InvalidCorePatternType %s
400 InvalidCorePatternValue %s
400 InvalidInstanceId.NotFound The specified instanceId does not exist
400 Ops.InstanceNotSupport %s
400 Ops.IntervalTooShort The time interval since last setting too short, please try again later.
400 Ops.RegionNotSupport %s
400 Ops.OpsValueInvalid Ops value check failed, please confirm by ops type and try again later.
400 Ops.ExecuteTaskFail %s
400 Tcpdump.InvalidValue %s

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.