Skip to main content

ApplyTempStorageLease - Request temporary file upload authorization

Requests temporary file upload authorization for code-based deployment. Other scenarios are not supported. After obtaining authorization, you must upload the file yourself.

Usage notes

  1. This operation is used for code-based deployment. Other scenarios are not supported.
  2. After obtaining a temporary file upload authorization with this operation, you must upload the file yourself.

Try it out

You can call this operation in OpenAPI Explorer without calculating a signature. After a successful call, OpenAPI Explorer can automatically generate SDK code examples. Try it out

Authorization information

The following table describes the authorization information for this API operation. You can use this information in the Action element of a RAM policy statement to grant a RAM user or RAM role permission to call the operation. The columns are described as follows:
  • Action: a specific permission.
  • Access level: the access level of an action. Valid values: Write, Read, and List.
  • Resource type: the types of resources for which the action supports authorization:
    • Required resource types are marked with an asterisk (*).
    • Actions that do not support resource-level authorization use All resources.
  • Condition key: a condition key defined by the cloud service.
  • Dependent action: an additional permission required to perform the action. The caller must also have permission to perform the dependent action.
ActionAccess levelResource typeCondition keyDependent action
sfm:ApplyTempStorageLeasenone
*All resources
*
    None
None

Request syntax

POST /{WorkspaceId}/datacenter HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample
FileNamestringYes

The file name, which must include the file extension.

example.txt
SizeInByteslongYes

The file size in bytes.

1024
WorkspaceIdstringYes

The Model Studio workspace ID.

llm-mbhn96xxxx

Response parameters

NameTypeDescriptionExample
object

Schema of Response

Codestring

The error status code.

DataCenter.FileTooLarge
Dataobject

The business data returned by the operation.

TempStorageLeaseIdstring

The unique lease ID. This parameter is required when the application retrieves the uploaded file later.

1e6a159107384782be5e45ac4759b247.1719325231035
Paramobject

The HTTP parameters used to upload the file.

Headersany

The key-value pairs to place in the headers. Both keys and values are strings.

Content-Type: application/json
Methodstring

The HTTP method. Valid values: PUT POST

PUT
Urlstring

The authorized URL for uploading the file.

https://bailian-datahub-data-origin-prod.oss-cn-hangzhou.aliyuncs.com/1005426495169178/10024405/68abd1dea7b6404d8f7d7b9f7fbd332d.1716698936847.pdf?Expires=1716699536&OSSAccessKeyId=YOUR_ACCESS_KEY_ID&Signature=YOUR_SIGNATURE
Messagestring

The error message.

User not authorized to operate on the specified resource
RequestIdstring

The request ID.

778C0B3B-xxxx-5FC1-A947-36EDD13606AB
Statusstring

The status code returned by the operation.

200
Successboolean

Indicates whether the call succeeded.

Examples

Sample success response JSON format
{
  "Code": "DataCenter.FileTooLarge",
  "Data": {
    "TempStorageLeaseId": "1e6a159107384782be5e45ac4759b247.1719325231035",
    "Param": {
      "Headers": "Content-Type: application/json",
      "Method": "PUT",
      "Url": "https://bailian-datahub-data-origin-prod.oss-cn-hangzhou.aliyuncs.com/1005426495169178/10024405/68abd1dea7b6404d8f7d7b9f7fbd332d.1716698936847.pdf?Expires=1716699536&OSSAccessKeyId=YOUR_ACCESS_KEY_ID&Signature=YOUR_SIGNATURE"
    }
  },
  "Message": "User not authorized to operate on the specified resource",
  "RequestId": "778C0B3B-xxxx-5FC1-A947-36EDD13606AB",
  "Status": 200,
  "Success": true
}

Error codes

For more error codes, see Error Center.

Change history

Change dateChange summaryAction
2025-11-04New OpenAPIView change details