All Products
Search
Document Center

Elastic Container Instance:CreateInstanceOpsTask

更新時間:Sep 13, 2024

Creates an operations and maintenance task.

Operation description

O&M tasks are classified into:

  • coredump: After you enable coredump, the system generates a core dump file when a container unexpectedly stops. You can use the core dump file to analyze the exception and find out the cause of the problem. For more information, see Enable coredump.
  • tcpdump: After you enable tcpdump, the system captures network packets when a container unexpectedly stops. You can analyze the packets and locate network problems. For more information, see Enable tcpdump .

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
eci:CreateInstanceOpsTaskcreate
  • All Resources
    *
  • eci:tag
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the O&M task.

cn-hangzhou
ContainerGroupIdstringYes

The ID of the container group.

eci-bp1dvysdafbh00t7****
OpsTypestringYes

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

  • coredump
  • tcpdump
coredump
OpsValuestringYes

The value of the O&M task. You can set this parameter based on the value of OpsType.

  • If OpsType is set to coredump, the valid values of OpsValue are:

    • enable: enables coredump.
    • disable: disables coredump.
  • If OpsType is set to tcpdump, the value of OpsValue is a JSON-formatted parameter string. Example: {"Enable":true, "IfDeviceName":"eth0"}. The value may contain the following parameters:

    • Enable: specifies whether to enable tcpdump. You must specify this parameter. Valid values: true and false.
    • Protocol: the network protocol. Valid values: tcp, udp, and icmpv4.
    • SourceIp: the source IP address.
    • SourceCidr: the source CIDR block. If you specify both an IP address and a CIDR block, the IP address is ignored if the CIDR block is valid.
    • SourcePort: the source port. Valid values: 1 to 65535.
    • DestIp: the destination IP address.
    • DestCidr: the destination CIDR block. If you specify both an IP address and a CIDR block, the IP address is ignored if the CIDR block is valid.
    • DestPort: the destination port. Valid values: 1 to 65535.
    • IfDeviceName: the destination network interface controller. Default value: eth0.
    • Snaplen: the length to be captured. Default value: 65535. Unit: bytes.
    • Duration: the captured period. Unit: seconds.
    • PacketNum: the number of packets to be captured.
    • FileSize: the size of the destination files on packets. Unit: bytes. Maximum value: 1073741824. 1073741824 bytes is equal to 1 GB.
enable

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

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

The creation result of the O&M task.

Coredump settings has been configured successfully.

Examples

Sample success responses

JSONformat

{
  "RequestId": "89945DD3-9072-47D0-A318-353284CFC7B",
  "Result": "Coredump settings has been configured successfully."
}

Error codes

HTTP status codeError codeError message
400Coredump.RefrshIntervalTooShortThe time interval since last setting too short, please try again later.
400Ops.TypeNotSupport%s
400Coredump.RegionNotSupport%s
400CorePattern.UpdateFailUpdate coredump settings fail, please try again later
400Coredump.InvalidCorePatternType%s
400InvalidCorePatternValue%s
400InvalidInstanceId.NotFoundThe specified instanceId does not exist
400Ops.InstanceNotSupport%s
400Ops.IntervalTooShortThe time interval since last setting too short, please try again later.
400Ops.RegionNotSupport%s
400Ops.OpsValueInvalidOps value check failed, please confirm by ops type and try again later.
400Ops.ExecuteTaskFail%s
400Tcpdump.InvalidValue%s

For a list of error codes, visit the Service error codes.