Creates a ticket.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateOrder

The operation that you want to perform. Set the value to CreateOrder.

Tid Long No 3***

The ID of the tenant. You can call the GetUserActiveTenant operation to query the tenant ID.

Comment String Yes test

The description of the ticket.

PluginParam Map Yes {PluginParam_test}

The parameters that are used to create the ticket. The parameters are specified as a JSON string. The settings of the parameters vary based on the type of the ticket. For more information, see the "PluginParam parameter" section of this topic.

RelatedUserList String Yes user1,user2

The IDs of the stakeholders that are involved in the ticket. If you specify multiple IDs, separate the IDs with commas (,).

PluginType String Yes DATA_EXPORT

The type of the ticket. Valid values:

  • DC_COMMON: a ticket that is used to change data by using a normal method
  • DC_CHUNK: a ticket that is used to change data without locking tables
  • DC_CRON_CLEAR: a ticket that is used to delete historical data
  • NDDL: a ticket that is used to change the schema design
  • DATA_EXPORT: a ticket that is used to export data
  • PERM_APPLY: a ticket that is used to apply for permissions
  • OWNER_APPLY: a ticket that is used to apply for the owner role of a resource
RegionId String No cn-hangzhou

The region in which Data Management (DMS) is activated. For more information, see RegionID parameter.

AttachmentKey String No test_AttachmentKey

The key of an attachment that is returned after the attachment is uploaded. You can call the GetUserUploadFileJob operation to query the key of the attachment.

PluginParam parameter


json

# Change data by using a normal method.
 {
    "classify" : "Test", // The purpose of the ticket.
    "estimateAffectRows" : 1, // The estimated number of affected rows.
    "execSQL" : "update base_op_log set id=1 where id=1;", // The SQL statement that is executed.
    "dbItemList" : [ { // The databases on which the operation is performed.
      "dbId" : 17****,
      "logic" : false
    } ],
    "rbSQL" : "update base_op_log set id=1 where id=1;", // The SQL statement that is executed to roll back the data change.
    "rbAttachmentName" : null, // The name of the attachment that contains the SQL statements for rolling back the data change.
    "sqlType" : "TEXT", // The type of the SQL file to run for data change. Valid values: TEXT and ATTACHMENT.
    "rbSQLType" : "TEXT", // The type of the SQL file to run for rolling back the data change. Valid values: TEXT and ATTACHMENT.
    "attachmentName" : // The name of the attachment that contains the SQL statements for performing the data change. You can call the GetUserUploadFileJob operation to query the key of the attachment. 
  }


# Change data without locking tables.
 {
    "classify" : "Test",
    "execSQL" : "update base_op_log set op_type=op_type where 1=1;", // The SQL statement that is executed.
    "dbItemList" : [ { 
      "dbId" : 17****, // The ID of the database on which the operation is performed.
      "logic" : false
    } ]
  }

# Delete historical data.
 {
    "duration" : 10, // The duration over which the historical data that you want to delete spans. Default value: 0.
    "specifyDuration" : true, // Specifies whether to specify a duration. Valid values: true and false. Default value: false.
    "classify" : "Test",
    "cronFormat" : "0 1 21 * * ?", // The expression that is used to delete historical data at the scheduled time.
    "execSql" : null,
    "dbItemList" : [ {
      "dbId" : 17****, // The ID of the database on which the operation is performed.
      "logic" : false
    } ],
    "cronClearItemList" : [ {
      "filterSQL" : null, // The filter conditions.
      "columnName" : "gmt_create", // The time field.
      "remainDays" : 60, // The retention period of historical data.
      "tableName" : "base_app" // The name of the table.
    } ]
  }

json
# Change a schema design.
 {
    "title": "test", // The name of the ticket.
    "description": "test", // The description of the ticket.
    "dbId": 11****, // The database to which changes are made.
    "logic": false, // Specifies whether the database is a logical database.
    "relatedIds": [], // The IDs of the stakeholders that are involved in the ticket.
  }
json

# Export data.
 {
  "classify": "Reason", // The purpose of the ticket.
  "dbId": 17****, // The ID of the database from which data is exported.
  "exeSQL": "select 1", // The SQL statement that is executed to export data.
  "logic": false, // Specifies whether the database is a logical database.
  "ignoreAffectRows": false, // Specifies whether to ignore the affected rows.
  "affectRows": 1, // The estimated number of affected rows.
  "ignoreAffectRowsReason": "" // The reason for ignoring the affected rows.
 }

Response parameters

Parameter Type Example Description
CreateOrderResult Array of Long 12***

The ID of the ticket.

RequestId String 427688B8-ADFB-4C4E-9D45-EF5C1FD6****

The ID of the request.

ErrorCode String UnknownError

The error code.

ErrorMessage String UnknownError

The error message.

Success Boolean true

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.

Examples

Sample requests

http(s)://dms-enterprise.aliyuncs.com/?Action=CreateOrder
&Comment=test
&PluginParam={PluginParam_test}
&PluginType=DATA_EXPORT
&RelatedUserList=user1,user2
&<Common request parameters>

Sample success responses

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "427688B8-ADFB-4C4E-9D45-EF5C1FD6****",
  "CreateOrderResult" : {
    "OrderIds" : "12***"
  },
  "Success" : true
}

Error codes

For a list of error codes, visit the API Error Center.