Obtaining Information About a Trigger
Function
Obtain information about a trigger.
Constraints
None
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
swr:repo:getTrigger
Read
repo *
-
-
-
URI
GET /v2/manage/namespaces/{namespace}/repos/{repository}/triggers/{trigger}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| namespace | Yes | String | Organization name. Enter 1 to 64 characters, starting with a lowercase letter and ending with a lowercase letter or digit. Only lowercase letters, digits, periods (.), underscores (_), and hyphens (-) are allowed. Periods, underscores, and hyphens cannot be placed next to each other. A maximum of two consecutive underscores are allowed. |
| repository | Yes | String | Image repository name. The name contains 1 to 128 characters, starting and ending with a lowercase letter or digit. Only lowercase letters, digits, periods (.), slashes (/), underscores (_), and hyphens (-) are allowed. Periods, slashes, underscores, and hyphens cannot be placed next to each other. A maximum of two consecutive underscores are allowed. If the parameter value contains a slash (/), replace it with a dollar sign ($) before sending the request. |
| trigger | Yes | String | Trigger name |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Message body type (format). Possible values: application/json;charset=utf-8 application/json |
| X-Auth-Token | Yes | String | User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| action | String | Action to trigger. The value is update. |
| app_type | String | Workload type. Options: |
| application | String | App name |
| cluster_id | String | Cluster ID. When trigger_mode is set to cci, leave this parameter blank. |
| cluster_name | String | Cluster name. When trigger_mode is set to cci, leave this parameter blank. |
| cluster_ns | String | Namespace where the application is located. |
| condition | String | Trigger condition. If type is set to all, the value is .*. If type is set to tag, the value is a tag name. If type is set to regular, the value is a regular expression. |
| container | String | Name of the container to be updated. By default, all containers using this image are updated. |
| created_at | String | Creation time |
| creator_name | String | Creator |
| enable | String | Valid or not |
| name | String | Trigger name |
| trigger_history | Array of TriggerHistories objects | Trigger history |
| trigger_mode | String | Trigger type. The value can be cce or cci. |
| trigger_type | String | Triggering condition. Options: |
| Parameter | Type | Description |
|---|---|---|
| action | String | Action to trigger. The value is update. |
| app_type | String | Workload type. Options: |
| application | String | App name |
| cluster_id | String | Cluster ID. When trigger_mode is set to cci, leave this parameter blank. |
| cluster_name | String | Cluster name. When trigger_mode is set to cci, leave this parameter blank. |
| cluster_ns | String | Namespace where the application is located. |
| condition | String | Trigger condition. If type is set to all, the value is .*. If type is set to tag, the value is a tag name. If type is set to regular, the value is a regular expression. |
| container | String | Name of the container to be updated. By default, all containers using this image are updated. |
| created_at | String | Creation time |
| creator_name | String | Creator |
| detail | String | Details |
| result | String | Update result. The value can be success or failed. |
| tag | String | Triggered version number |
Example Requests
GET https://{endpoint}/v2/manage/namespaces/{namespace}/repos/{repository}/triggers/{trigger} Example Responses
Status code: 200
{
"action" : "update",
"app_type" : "deployments",
"application" : "cci-deployment-20204161",
"cluster_id" : "",
"cluster_name" : "",
"cluster_ns" : "cci-namespace-21539491",
"condition" : ".*",
"container" : "",
"created_at" : "2020-04-16T01:35:08.639589Z",
"creator_name" : "creatorName",
"enable" : "true",
"name" : "test",
"trigger_history" : [ {
"action" : "update",
"app_type" : "deployments",
"application" : "cci-deployment-20204161",
"cluster_id" : "",
"cluster_name" : "",
"cluster_ns" : "",
"condition" : ".*",
"container" : "",
"created_at" : "2020-04-16T01:36:36.155119Z",
"creator_name" : "************",
"detail" : "xxxxxxxxxxxxxx",
"result" : "failed",
"tag" : "test"
} ],
"trigger_mode" : "cci",
"trigger_type" : "all"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | The query succeeded. |
| 400 | A request error occurred. |
| 401 | Authentication failed. |
| 404 | The organization, image repository, or trigger does not exist. |
| 500 | An internal error occurred. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot