All Products
Search
Document Center

Elastic Container Instance:CreateDataCache

Last Updated:Apr 15, 2024

Creates a DataCache.

Operation description

  • You are charged for the creation of image caches. We recommend that you learn the relevant billing information in advance. For more information, see DataCaches .
  • Before you create an image cache, you must evaluate the size of the data to be cached. If the size of the data exceeds the specified cache size, the image cache fails to be created.
  • When a data cache is being created, the system automatically creates a temporary elastic container instance (ECI) and an enhanced SSD (ESSD) for the data cache. During the creation, do not delete the ECI and ESSD. Otherwise, the data cache fails to be created.
  • When a data cache is being created, a snapshot is generated for the data cache. Do not delete the snapshot. Otherwise, the data cache becomes invalid.

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:CreateDataCacheWrite
  • All Resources
    *
  • eci:tag
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID.

cn-hangzhou
SecurityGroupIdstringNo

The ID of the security group to which the generated ECI belongs during the creation of the data cache.

sg-2ze81zoc3yl7a3we****
VSwitchIdstringNo

The ID of the vSwitch to which the generated ECI belongs during the creation of the data cache.

vsw-bp1jrgfqqy54kg5hc****
BucketstringNo

The bucket in which the data is stored. By default, the default bucket is used. You can use a custom bucket for business grouping and to prevent path conflicts.

Note eci-system is the reserved bucket of the ECI and cannot be used.
default
PathstringYes

The storage path of the data.

/model/test
NamestringYes

The DataCache name.

test
SizeintegerNo

The size of the data cache. Unit: GiB. Default value: 20. Evaluate the required size based on the actual data size.

30
DataSourceobjectNo

The data source.

TypestringNo

The type of the data source. Valid values:

  • URL
  • NAS
  • OSS
  • SNAPSHOT
NAS
OptionsobjectNo

The parameters that are configured for the data source.

stringNo

The parameters that are configured for the data source. The parameters to be specified vary based on the type of data sources. For more information about data sources and their parameters, see Create and manage a data cache.

{ "options": { "path": "/", "server": "0ce1f4****-or***.cn-hangzhou.nas.aliyuncs.com", "vers": "3", "options": "nolock,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport" }, "type": "NAS" }
RetentionDaysintegerNo

The number of days for which the DataCache is retained. When the retention days end, the DataCache is deleted. By default, DataCaches do not expire.

7
Tagobject []No

The tags to be bound to the data cache.

KeystringNo

The key of the tag.

testkey
ValuestringNo

The value of the tag.

testvalue
ResourceGroupIdstringNo

The ID of the resource group.

rg-2df3isufhi38****
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

123e4567-****-12d3-****-426655440000
EipInstanceIdstringNo

The existing elastic IP address (EIP) to be associated. If no NAT gateway is configured for the virtual private cloud (VPC), you can associate an EIP to pull data from the Internet.

eip-uf66jeqopgqa9hdn****
EipCreateParamobjectNo

The elastic IP address (EIP) to be created and associated. If no NAT gateway is configured for the virtual private cloud (VPC), you can associate an EIP to pull data from the Internet.

BandwidthintegerNo

The bandwidth of the EIP. Unit: Mbit/s. Default value: 5.

10
CommonBandwidthPackagestringNo

The EIP bandwidth plan to be associated.

cbwp-2zeukbj916scmj51m****
InternetChargeTypestringNo

The metering method of the EIP. Valid values:

  • PayByBandwidth: pay-by-bandwidth
  • PayByTraffic: pay-by-data-transfer
PayByTraffic
PublicIpAddressPoolIdstringNo

The ID of the IP address pool. The EIP is allocated from the IP address pool. You cannot use the IP address pool feature by default. To use this feature, you must apply for the privilege in the Quota Center console.

pippool-2vc4xdtjhwl4t0go5****
ISPstringNo

The line type of the EIP. Valid values:

  • BGP: BGP (Multi-ISP) line
  • BGP_PRO: BGP (Multi-ISP) Pro line
BGP

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

D81A4A13-6DCC-4579-AC62-90A6C3EC7BBC
DataCacheIdstring

The DataCache ID.

edc-bp15l4vvys94oo******

Examples

Sample success responses

JSONformat

{
  "RequestId": "D81A4A13-6DCC-4579-AC62-90A6C3EC7BBC",
  "DataCacheId": "edc-bp15l4vvys94oo******"
}

Error codes

HTTP status codeError codeError messageDescription
400Account.ArrearageYour account has an outstanding payment.Your account has an outstanding payment.
400DryRunOperationRequest validation has been passed with DryRun flag set.Request validation has been passed with DryRun flag set.
400InvalidParameter.CPU.MemoryThe specified cpu and memory are not allowed-
400IncorrectStatus%s-
400ServiceNotEnabled%sYou have not activated the service that is required for processing this request.
400DiskVolume.NotSupportThe disk volume is not supported.Disk volume does not support your structure. If you want to enable this function, contact us.
400RamRole.NotSupportThe RAM role is not supported.The RAM role is not supported.
400ImageCache.IncorrectStatus%s-
400ImageCacheNotSupportImage cache is not available for all users. If you want to enable this function, contact us.Container image cache is currently not available to all users. Submit a ticket if you need to use the feature.
400EipAddressPoolIpNotEnoughThe ip address of specified PublicIpAddressPool is not enough.-
400DryRun.SuccessThis request is a dryrun request with successful result.-
403OperationDenied.VswZoneMisMatchThe specified VSwitchId is not in the specified Zone.-
403QuotaExceeded%s quota exceeded.-
403Zone.NotOnSaleThe specified zone is not available for purchase.-
403Forbidden.RiskControlThis operation has been identified as an abnormal operation and cannot be processed.-
403Forbidden.SubUserThe specified action is not available for you.The specified action is not available for you.
403Forbidden.OnlyForInvitedTestEci create action is only open to invited users during public beta.Eci create action is only open to invited users during public beta.
403OperationDenied.SecurityGroupMisMatchThe specified VSwitchId and SecurityGroupId are not in the same VPC.The specified VSwitchId and SecurityGroupId are not in the same VPC.
403InvalidVSwitchId.IpNotEnoughThe specified VSwitch does not have enough IP addresses.-
403Forbidden.UserBussinessStatusThis operation is not allowed, because you have overdue bills. Pay the overdue bill and try again.-
403Forbidden.UserNotRealNameAuthenticationThis operation is not allowed, because you have not passed the real-name verification.-
403InvalidUser.PassRoleForbiddenThe RAM user is not authorized to assume a RAM role.The RAM user is not authorized to assume a RAM role.
403OperationDenied.NoStockSales of this resource are temporarily suspended in the specified zone. We recommend that you use the multi-zone creation function to avoid the risk of insufficient resource. For more information, see https://help.aliyun.com/document_detail/157290.html-
403NoPermissionThe RAM role AliyunECIContainerGroupRole does not belong to eci.aliyuncs.com. Please check and try again.-
403SecurityRisk.3DVerificationWe have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email.-
403CreateServiceLinkedRole.DeniedPlease make sure the account has ram:CreateServiceLinkedRole permission.Please make sure the account has ram:CreateServiceLinkedRole permission.

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

Change history

Change timeSummary of changesOperation
2023-07-24The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: Path