GetRule

Updated at:

Retrieves basic information about rules.

Note

This API has been deprecated. We recommend migrating to Qualitycheck(2019-01-15) - GetRuleV4 for enhanced functionality and continued support. While the deprecated API remains temporarily accessible, no further updates or bug fixes will be provided.

Operation description

Note

This operation returns basic rule information such as the id and name. You can use this information with GetRuleDetails.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

sca:GetRule

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

JsonStr

string

Yes

A complete JSON string. See the detailed information below.

{"ruleIds":"123"}

BaseMeAgentId

integer

No

Workspace ID

123456

Request parameters in the JsonStr string

PropertyTypeRequiredDescription
ruleIdsList<String>NoRule IDs. Separate multiple IDs with commas.
businessCategoryNameList<String>NoBusiness category names
statusIntegerNoStatus. Valid values: 0 (pending), 1 (active), 2 (expired), or 3 (all). Default is 1.

Response elements

Element

Type

Description

Example

object

Code

string

The result code. 200 means success. Any other value means failure. Use this field to identify the cause of failure.

200

Message

string

Error details if the request fails. Returns successful if the request succeeds.

successful

RequestId

string

The request ID

F190ADE9-619A-447D-84E3-7E241A5C428E

Success

boolean

Indicates whether the request succeeded. true means success. false or null means failure.

true

Data

object

The response data

Rules

object

RuleInfo

array<object>

A list of rule information items

array<object>

A list of rules

Status

integer

Status. Valid values: 0 (pending), 1 (active), or 2 (expired)

1

Type

integer

[Deprecated] Rule type

1

ScoreSubId

integer

The ID of the scoring sub-item

22

IsOnline

integer

[Deprecated] Indicates whether the rule is online. 0 means offline. 1 means online. This value is always 1.

1

CreateTime

string

The time when the rule was created

2016-08-05 10:37:10

CreateEmpid

string

The ID of the user who created the rule

123

LastUpdateEmpid

string

The ID of the user who last updated the rule

123

IsDelete

integer

Indicates whether the rule is deleted. Valid values: 0 (not deleted) or 1 (deleted)

0

Rid

string

The rule ID

4

RuleScoreType

integer

Indicates whether the rule contributes to scoring. Valid values: 1 (no score) or 3 (scored)

1

EndTime

string

The expiration time

2016-08-05 10:37:10

Weight

string

[Deprecated] Rule weight

1

StartTime

string

The start time

2016-08-05 10:37:10

RuleLambda

string

[Deprecated] Logical relationship between rule conditions

a && b

ScoreSubName

string

The name of the scoring sub-item. This field appears only when ruleScoreType=3

评分子项

AutoReview

integer

The review option. Valid values: 1 (manual review) or 3 (auto review)

1

Comments

string

Remarks

测试规则

LastUpdateTime

string

The time when the rule was last updated

2019-10-28 14:23:28

ScoreName

string

The name of the scoring main item. This field appears only when ruleScoreType=3

评分大项

Name

string

The rule name

demo

ScoreId

integer

The ID of the scoring main item

123

BusinessCategoryNameList

object

BusinessCategoryNameList

array

A list of business categories

string

A list of business categories

["业务A","业务B"]

Examples

Success response

JSON format

{
  "Code": "200",
  "Message": "successful",
  "RequestId": "F190ADE9-619A-447D-84E3-7E241A5C428E",
  "Success": true,
  "Data": {
    "Rules": {
      "RuleInfo": [
        {
          "Status": 1,
          "Type": 1,
          "ScoreSubId": 22,
          "IsOnline": 1,
          "CreateTime": "2016-08-05 10:37:10",
          "CreateEmpid": "123",
          "LastUpdateEmpid": "123",
          "IsDelete": 0,
          "Rid": "4",
          "RuleScoreType": 1,
          "EndTime": "2016-08-05 10:37:10",
          "Weight": "1",
          "StartTime": "2016-08-05 10:37:10",
          "RuleLambda": "a && b",
          "ScoreSubName": "评分子项",
          "AutoReview": 1,
          "Comments": "测试规则",
          "LastUpdateTime": "2019-10-28 14:23:28",
          "ScoreName": "评分大项",
          "Name": "demo",
          "ScoreId": 123,
          "BusinessCategoryNameList": {
            "BusinessCategoryNameList": [
              "[\"业务A\",\"业务B\"]"
            ]
          }
        }
      ]
    }
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.