All Products
Search
Document Center

Container Registry:GetScanRule

Last Updated:Jun 30, 2026

Retrieves a scan rule.

Operation description

Retrieves a scan rule.

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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The instance ID.

cri-xkx6vujuhay0****

ScanRuleId

string

Yes

The scan rule ID.

crscnr-2sdveqjhpzdcafyq

Response elements

Element

Type

Description

Example

object

Schema of Response

Code

string

The return code.

success

IsSuccess

boolean

Indicates whether the API call is successful. Valid values:

  • true: The API call is successful.

  • false: The API call failed.

true

RequestId

string

The request ID.

C87993B5-7D61-5CAC-8D64-1AC732DD69FF

ScanRule

object

The scan rule.

InstanceId

string

The instance ID.

cri-szw6f6bhrky0c8jk

ScanRuleId

string

The scan rule ID.

crscnr-aemytkwad2h7fyhb

RuleName

string

The name of the event rule.

protection

ScanScope

string

The scan scope.

REPO

TriggerType

string

The trigger type. Valid values:

  • ALL: all triggers

  • TAG_LISTTAG: tag trigger

  • TAG_REG_EXP: expression trigger

AUTO

Namespaces

array

The namespace names for which the event takes effect.

string

The namespace names for which the event takes effect.

[\"lwc-app-group\"]

RepoNames

array

The repository names for which the event takes effect.

string

The repository names for which the event takes effect.

[\"lesson-kit-api\",\"lesson-kit-consumer-gen\"]

RepoTagFilterPattern

string

The tag filtering rule that triggers the event.

.*

CreateTime

integer

The creation time.

2018-03-15T17:08Z

UpdateTime

integer

The update time.

2025-08-28T20:07:33.164

ScanType

string

The vulnerability type. Valid values:

  • cve: system vulnerability

  • sca: application vulnerability

SBOM

Examples

Success response

JSON format

{
  "Code": "success",
  "IsSuccess": true,
  "RequestId": "C87993B5-7D61-5CAC-8D64-1AC732DD69FF",
  "ScanRule": {
    "InstanceId": "cri-szw6f6bhrky0c8jk",
    "ScanRuleId": "crscnr-aemytkwad2h7fyhb",
    "RuleName": "protection",
    "ScanScope": "REPO",
    "TriggerType": "AUTO",
    "Namespaces": [
      "[\\\"lwc-app-group\\\"]"
    ],
    "RepoNames": [
      "[\\\"lesson-kit-api\\\",\\\"lesson-kit-consumer-gen\\\"]"
    ],
    "RepoTagFilterPattern": ".*",
    "CreateTime": 0,
    "UpdateTime": 0,
    "ScanType": "SBOM"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.