API Reference

更新时间:
复制 MD 格式

Manage hotpatching resources and release tasks through OpenAPI operations.

Maven Dependencies

<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>mpaas20201028</artifactId>
    <version>5.1.0</version>
</dependency>

API Reference

Prerequisites

Before you use OpenAPI, obtain an AccessKey, App ID, Workspace ID, and Tenant ID. You must also configure Maven dependencies and upload the configuration file. For more information, see Preparations.

Common Parameters

All API operations include the following common parameters: appId, workspaceId, and tenantId.

Note

These parameters are omitted from subsequent API descriptions.

Parameter Name

Type

Description

appId

String

The app that owns the resource.

workspaceId

String

The workspace that owns the resource.

tenantId

String

The tenant that owns the resource.

Common Return Values

Parameter Name

Type

Description

resultCode

String

Returns OK on success. Any other value indicates a failed request.

requestId

String

The unique request ID.

resultMessage

String

The error message returned when the request fails.

***Result

Object

The result object. For details, see the specific return values.

The response object also contains the success and resultMsg fields:

Name

Type

Description

success

Boolean

Indicates whether the request succeeded.

resultMsg

String

The error message returned on failure.

Create Hotpatching Resources

Request - CreateMcubeHotpatchResourceRequest

Parameter Name

Type

Description

onexFlag

Boolean

Fixed value: true.

fileUrl

String

The URL of the hotpatching resource file to upload.

productVersion

String

The application version of the hotpatching resource.

platform

String

The target platform for the hotpatching resource package: Android or iOS.

fixDesc

String

The description of the hotpatching resource package.

Response - CreateMcubeHotpatchResourceResponse

{
    "createHotpatchResourceResult": {
        "hotpatchResourceId": "2172",
        "success": true
    },
    "requestId": "6D9405CA-9992-19FC-A027-0F3F9814AF68",
    "resultCode": "OK"
}

List Hotpatching Resource Packages

Request - ListMcubeHotpatchResourcesRequest

Parameter

Type

Description

pageNum

Integer

The page number.

pageSize

Integer

The number of entries per page.

Response - ListMcubeHotpatchResourcesResponse

{
  "listHotpatchResourceResult": {
      "hotpatchResourceInfo": [
          {
              "appCode": "ONEXPRE22BA951112038-default",
              "creator": "default",
              "downloadUrl": "https://pre-mpaas.mpaascloud.com/ONEXPRE22BA951112038-default/hotpatch/ONEXPRE22BA951112038_ANDROID-default/android/1.0.0/81c90a2cafdc6dfc54201e70845b5708/mpaas_a.jar;https://pre-mpaas.mpaascloud.com/ONEXPRE22BA951112038-default/hotpatch/ONEXPRE22BA951112038_ANDROID-default/android/1.0.0/81c90a2cafdc6dfc54201e70845b5708/mpaas_a.jar",
              "fileSize": "10820",
              "gmtCreate": "1770634587000",
              "gmtModified": "1770634587000",
              "hotpatchVersion": "81c90a2cafdc6dfc54201e70845b5708",
              "id": 2172,
              "md5": "81c90a2cafdc6dfc54201e70845b5708",
              "memo": "test",
              "modifier": "default",
              "platform": "android",
              "productId": "ONEXPRE22BA951112038_ANDROID-default",
              "productVersion": "1.0.0",
              "publishPeriod": 0,
              "sourceName": "mpaas_a.jar"
          }
      ],
      "success": true
  },
  "requestId": "33E1C7A2-5FA5-16A9-83C9-EC5C8D85B67D",
  "resultCode": "OK"
}

Return Values

Field

Description

appCode

The appCode, in the format: appId-workspaceId.

creator

The creator.

downloadUrl

The download URL of the hotpatching resource.

fileSize

The size of the hotpatching resource file.

gmtCreate

The creation time of the hotpatching resource.

gmtModified

The update time of the hotpatching resource.

id

The primary key of the hotpatching resource.

md5

The MD5 value of the hotpatching resource file.

memo

The description of the hotpatching resource file.

modifier

The updater.

platform

The supported platform.

productId

The product ID, in the format: appId_platform-workspaceId.

productVersion

The application version of the hotpatching resource package.

publishPeriod

The release status.

  • 1: Internal phased release

  • 2: External phased release

  • 3: Official release

  • 4: Rollback release

  • 5: Release task ended

sourceName

The name of the hotpatching resource package.

Create Hotpatching Release Tasks

Request - CreateMcubeHotpatchTaskRequest

Parameter

Type

Description

platform

String

The supported platform type. Must match the hotpatching resource type. Valid values: Android, iOS.

memo

String

The description of the hotpatching release task.

packageId

Long

The primary key of the hotpatching resource package to be released.

publishType

Integer

The release type.

  • 2: Phased release

  • 3: Official release

publishMode

Integer

The release mode.

  • 0: Official release

  • 1: Whitelist

  • 2: Time window

whitelistIds

String

The primary keys of the whitelist resource packages for whitelist-based release. Separate multiple values with commas.

greyConfigInfo

String

The canary release advanced rules. For more information, see Advanced Rules for Canary Releases.

greyEndtimeData

String

The end time for time window phased release, in the format yyyy-MM-dd HH:mm:ss.

greyNum

Long

The maximum number of users for time window phased release.

syncMode

String

The synchronization mode. Fixed value: 0.

Advanced Rules for Phased Release

Name

Type

Description

ruleElement

String

The rule type.

  • city: City

  • mobileModel: Device model

  • netType: Network

  • osVersion: Device operating system version

value

String

The rule value. Separate multiple values with ,. For operation 3 or 4, use the format aa-bb, where aa is the smaller value and bb is the larger value.

operation

Integer

The operation relationship.

  • 1: Contains

  • 2: Does not contain

  • 3: Within range

  • 4: Outside range

Note
  • If ruleElement is city, mobileModel, or netType, the operation value can only be 1 (contains) or 2 (does not contain).

  • If ruleElement is osVersion, the operation value can be any of the four types.

Response - CreateMcubeHotpatchTaskResponse

{
    "createHotpatchTaskResult": {
        "hotpatchTaskId": "10623",
        "success": true
    },
    "requestId": "05AE738B-9A45-16DA-AC88-155FB324A069",
    "resultCode": "OK"
}

List Hotpatching Release Tasks

Request - ListMcubeHotpatchTasksRequest

Parameter

Type

Description

id

Long

The primary key of the hotpatching resource package to query.

Response - ListMcubeHotpatchTasksResponse

{
    "listHotpatchTasksResult": {
        "hotpatchTaskInfo": [
            {
                "appCode": "ONEXPRE22BA951112038-default",
                "creator": "default",
                "gmtCreate": "1770636082000",
                "gmtModified": "1770636082000",
                "greyConfigInfo": "{\"operator\":\"and\",\"defaultResult\":false,\"subRules\":[{\"operator\":\"contains\",\"defaultResult\":false,\"left\":[\"Weifang City\"],\"right\":\"city\"},{\"operator\":\"vLimitIn\",\"defaultResult\":false,\"left\":{\"upper\":\"4.2.0\",\"lower\":\"4.1.2\"},\"right\":\"osVersion\",\"exclusive\":false},{\"operator\":\"contains\",\"defaultResult\":false,\"left\":[\"Alibaba\"],\"right\":\"isp\"}]}",
                "greyNum": 0,
                "id": 10624,
                "memo": "test",
                "modifier": "default",
                "packageId": 2172,
                "platform": "android",
                "productId": "ONEXPRE22BA951112038_ANDROID-default",
                "productVersion": "1.0.0",
                "publishMode": 1,
                "publishType": 2,
                "taskStatus": 1,
                "whitelistIds": "4632,4631"
            }
        ],
        "success": true
    },
    "requestId": "A391A2A4-0352-16A9-83C9-EC5C8D85B67D",
    "resultCode": "OK"
}

Return Values

Name

Description

appCode

The appCode, in the format: appId-workspaceId.

creator

The creator.

gmtCreate

The creation time of the hotpatching release task.

gmtModified

The update time of the hotpatching release task.

greyConfigInfo

The phased release advanced rules. For a detailed description, see Description of the greyConfigInfo field.

greyNum

The user count limit for time window phased release.

id

The primary key of the hotpatching release task.

memo

The description of the hotpatching release task.

modifier

The updater.

packageId

The primary key of the hotpatching resource package associated with the release task.

platform

The platform supported by the hotpatching resource: Android or iOS.

productId

The product ID, in the format: appId_platform-workspaceId.

productVersion

The application version of the hotpatching resource package.

publishMode

The release mode.

  • 0: Official release

  • 1: Whitelist

  • 2: Time window

publishType

The release type.

2: Phased release

3: Official release

taskStatus

The task status.

  • 0: To be released

  • 1: Releasing

  • 2: Ended

  • 3: Paused

whitelistIds

The primary keys of the whitelists for phased release. Separate multiple primary keys with commas.

greyConfigInfo Field Description

Name

Type

Description

operator

String

The rule relationship. The value "and" applies an AND operation to all results in subRules.

defaultResult

boolean

The default returned result.

subRules

List

The ruleset.

operator

String

The rule name.

  • contains: Contains

  • excludes: Does not contain

  • vLimitIn: Within range

  • vLimitOut: Outside range

left

List/Object

  • If operator is contains or excludes, this is a List of characters, where each element represents a rule value.

  • If operator is vLimitIn or vLimitOut, this is an object where lower indicates the lower value and upper indicates the upper value.

right

String

The rule type name.

defaultResult

Boolean

The default result.

Query Hotpatching Release Task Details

Request - QueryMcubeHotpatchTaskDetailRequest

Parameter

Type

Description

taskId

Long

The primary key of the hotpatching release task to query.

Response - QueryMcubeHotpatchTaskDetailResponse

{
    "queryHotpatchTaskDetailResult": {
        "hotpatchTaskDetail": {
            "appCode": "ONEXPRE22BA951112038-default",
            "creator": "default",
            "downloadUrl": "https://pre-mpaas.mpaascloud.com/ONEXPRE22BA951112038-default/hotpatch/ONEXPRE22BA951112038_ANDROID-default/android/1.0.0/81c90a2cafdc6dfc54201e70845b5708/mpaas_a.jar;https://pre-mpaas.mpaascloud.com/ONEXPRE22BA951112038-default/hotpatch/ONEXPRE22BA951112038_ANDROID-default/android/1.0.0/81c90a2cafdc6dfc54201e70845b5708/mpaas_a.jar",
            "fileSize": "10820",
            "gmtCreate": "1770636082000",
            "gmtModified": "1770636082000",
            "gmtModifiedStr": "2026-02-09 19:21:22",
            "greyConfigInfo": "{\"operator\":\"and\",\"defaultResult\":false,\"subRules\":[{\"operator\":\"contains\",\"defaultResult\":false,\"left\":[\"Weifang City\"],\"right\":\"city\"},{\"operator\":\"vLimitIn\",\"defaultResult\":false,\"left\":{\"upper\":\"4.2.0\",\"lower\":\"4.1.2\"},\"right\":\"osVersion\",\"exclusive\":false},{\"operator\":\"contains\",\"defaultResult\":false,\"left\":[\"Alibaba\"],\"right\":\"isp\"}]}",
            "greyNum": 0,
            "id": 10624,
            "md5": "81c90a2cafdc6dfc54201e70845b5708",
            "memo": "test",
            "modifier": "default",
            "packageId": 2172,
            "platform": "android",
            "productId": "ONEXPRE22BA951112038_ANDROID-default",
            "productVersion": "1.0.0",
            "publishMode": 1,
            "publishPeriod": 2,
            "publishType": 2,
            "releaseVersion": "81c90a2cafdc6dfc54201e70845b5708",
            "ruleJsonList": [
                {
                    "operation": "1",
                    "ruleElement": "city",
                    "ruleType": "0",
                    "value": "Weifang City"
                },
                {
                    "operation": "3",
                    "ruleElement": "osVersion",
                    "ruleType": "0",
                    "value": "4.1.2-4.2.0"
                },
                {
                    "operation": "1",
                    "ruleElement": "isp",
                    "ruleType": "0",
                    "value": "Alibaba"
                }
            ],
            "sourceName": "mpaas_a.jar",
            "taskStatus": 1,
            "taskVersion": 1770636082770,
            "whitelist": [
                {
                    "appCode": "ONEXPRE22BA951112038-default",
                    "gmtModified": "1770285152000",
                    "id": 4631,
                    "status": 1,
                    "whiteListCount": 0,
                    "whiteListName": "234"
                },
                {
                    "appCode": "ONEXPRE22BA951112038-default",
                    "gmtModified": "1770285156000",
                    "id": 4632,
                    "status": 1,
                    "whiteListCount": 0,
                    "whiteListName": "asdf"
                }
            ],
            "whitelistIds": "4632,4631"
        },
        "success": true
    },
    "requestId": "C09AF6B5-2F37-1338-8CB1-D28D3580BB11",
    "resultCode": "OK"
}

Return Values

Name

Description

appCode

The application code, in the format: appId-workspaceId.

creator

The creator.

downloadUrl

The download URL of the corresponding hotpatching resource package file.

fileSize

The size of the corresponding hotpatching resource package file.

gmtCreate

The creation time.

gmtModified

The update time.

greyConfigInfo

The phased release advanced rules. For more information, see Query the list of hotpatching release tasks.

greyNum

The maximum user count for time window phased release.

id

The primary key of the hotpatching release task.

md5

The MD5 value of the corresponding hotpatching resource file.

memo

The description of the corresponding hotpatching release task.

modifier

The updater.

packageId

The primary key of the corresponding hotpatching resource package.

platform

The platform supported by the hotpatching resource: Android or iOS.

productVersion

The application version matched by the hotpatching resource.

publishMode

The release mode.

  • 0: Official release

  • 1: Whitelist

  • 2: Time window

publishType

The release type.

  • 2: Phased release

  • 3: Official release

sourceName

The name of the corresponding hotpatching resource file.

taskStatus

The status of the hotpatching release task.

  • 0: To be released

  • 1: Releasing

  • 2: Ended

  • 3: Paused

whitelistIds

The primary keys of the whitelists for phased release. Separate multiple primary keys with commas.

ruleJsonList

The object format for advanced release rules. For more information, see the following section Description of the ruleJson object format for publishing advanced rules.

whitelist

The whitelist details for whitelist-based canary release. For more information, see Whitelist Details for Whitelist-Based Canary Release.

ruleJson Description for Advanced Release Rules

Name

Description

operation

The advanced rule mode.

  • 1: Contains

  • 2: Does not contain

  • 3: Within range

  • 4: Outside range

value

The advanced rule value. Format varies by operation type.

  • If operation is 1 (contains), specify the included values. Separate multiple values with commas.

  • If operation is 2 (does not contain), specify the excluded values. Separate multiple values with commas.

  • If operation is 3 (within range), use the format minimum value-maximum value.

  • If operation is 4 (outside range), use the format minimum value-maximum value.

ruleType

The rule type. Current value: 0.

ruleElement

The advanced rule name.

  • osVersion: Operating system version

  • netType: Network type

  • mobileModel: Device model

  • city: City

Whitelist Details for Phased Release

Name

Description

status

The status.

  • 1: Normal

  • 0: Deleted

whitelistCount

The number of entries in the whitelist.

AppCode

The application code.

idType

Fixed value: userId.

business

The business type.

id

The primary key of the whitelist.

whitelistName

The name of the whitelist.

Update Hotpatching Release Task Status

Request - UpdateMcubeHotpatchTaskStatusRequest

Parameter

Type

Description

taskId

Long

The primary key of the hotpatching release task to update.

taskStatus

Integer

The target status of the hotpatching release task.

  • 0: To be released

  • 1: Releasing

  • 2: Ended

  • 3: Paused

packageId

Long

The primary key of the hotpatching resource associated with the release task to update.

bizType

String

Default value: hotpatch

Response - UpdateMcubeHotpatchTaskStatusResponse

{
    "requestId": "40EE22B7-EDF6-1C2A-84CF-9866656573EB",
    "resultCode": "OK",
    "updateHotpatchTaskStatusResult": {
        "result": "Processed successfully",
        "success": true
    }
}

Create Hotpatching Rollback Tasks

Request - CreateMcubeHotpatchRollbackTaskRequest

Parameter

Type

Description

id

Long

The primary key of the hotpatching resource for which to create a rollback task.

productVersion

String

The application version of the hotpatching resource.

productId

String

In the format: appId_platform-workspaceId.

Response - CreateMcubeHotpatchRollbackTaskResponse

{
    "createHotpatchRollbackTaskResult": {
        "rollbackTaskId": "10627",
        "success": true
    },
    "requestId": "B7A55C9D-E521-1E44-9D3B-91B75D1CDC62",
    "resultCode": "OK"
}

Delete Hotpatching Resources

Request - DeleteMcubeHotpatchResourceRequest

Parameter

Type

Description

id

Long

The primary key of the hotpatching resource to delete.

appCode

String

In the format: appId-workspaceId.

Response - DeleteMcubeHotpatchResourceResponse

{
    "deleteHotpatchResourceResult": {
        "deleteResult": "Processed successfully",
        "success": true
    },
    "requestId": "7374F01F-552A-1C0D-99B9-E4E8F08EE979",
    "resultCode": "OK"
}