Help Center> Object Storage Service> API Reference> APIs> Data+> Querying Action Template Details

Querying Action Template Details

Functions

Queries action templates by name.

Request Syntax

GET /v2/actiontemplates/{template_name} HTTP/1.1
Host: obs.cn-north-4.myhuaweicloud.com 
Authorization: authorization
Content-Type: application/json
Content-Length: length
Date: date

Request parameters

Table 1 Request Parameters

Parameter

Mandatory

Type

Description

Constraints

template_name

Yes

String

Action template name. The default enumerated value is: Table 8.

The name should start with a letter or digit, and contain a maximum of 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

Request Headers

This request uses common headers. For details, see Table 3.

Request Elements

This request involves no elements.

Response Syntax

HTTP/1.1 status_code 
Date: date 
Content-Length: length 
X-Request-ID: obs request id

json body

Response Headers

The response to the request uses common headers. For details, see Table 1.

Response Elements

Table 2 Response Elements

Parameter

Type

Description

provided_actions

Array of ProvidedAction

List of available actions.

Table 3 ProvidedAction parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Action template name.

category

Yes

String

Category.

create_time

Yes

String

Time when a dataset is created

last_modify_time

No

String

Last modification time

function_template

Yes

String

Function URN.

inputs

No

Array of Input

List of parameter definitions that can be modified.

dynamic_source_definition

Yes

Map

Modifiable parameter references.

need_policy

Yes

Policy

Required permission.

provider

Yes

String

Provider

description

No

String

Indicates the parameter group description.

Table 4 Policy parameters

Parameter

Type

Description

version

String

Permission version number.

  • 1.0: preset role in the system. Only a limited number of service-level roles for authorization are provided.
  • 1.1: policy. Policies are a type of fine-grained authorization mechanism that defines the permissions for performing operations on specific cloud resources under certain conditions.

statement

Array of Statement

Authorization statement, which describes the specific content of a permission.

Table 5 Statement parameters

Parameter

Type

Description

action

Array String

Action Permissions for performing operations on resources. A maximum of 100 permissions are allowed.

  • The value format is Service name:Resource type:Action, for example, vpc:ports:create.
  • The service name is the product name, for example, ecs, evs, and vpc. The service name can contain only lowercase letters. The resource type and action are case insensitive. Wildcard (*) is supported. You do not need to list all authorization items.
  • For a custom policy, the value of this parameter is "Action": ["iam:agencies:assume"].

resource

Array String

Resources The array contains a maximum of 10 values, and each value can not exceed 128 characters. The rules are as follows:

  • 5-segment format with wildcard (*): ::::, for example, obs:::bucket:*.
  • The region field is wildcard (*) or a region that can be accessed. The service field must be specified and the resource belongs to the specified service.
  • If the custom policy is an agency custom policy, the field is the object type: "Resource": {"uri": ["/iam/agencies/07805acaba800fdd4fbdc00b8f888c7c"]}.

Error Responses

No special error responses are returned. For details about error responses, see Table 2.

Sample Request

GET /v2/actiontemplates/{template_name} HTTP/1.1
Host: obs.cn-north-4.myhuaweicloud.com 
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:sc2PM13Wlfcoc/YZLK0MwsI2Zpo=
Content-Type: application/json
Content-Length: 0
Date: Thu, 27 Aug 2020 12:38:10 GMT

Sample Response

HTTP/1.1 200 OK 
Date: Thu, 27 Aug 2020 12:38:10 GMT 
Content-Length: 0 
Content-Type: application/json
X-Request-ID: 6a63a18b8bab40ffb71ebd9cb80d0085
{
    "provided_actions": {
        "created_time": "<timestamp>",
        "last_modify_time": "<timestamp>",
        "name": "<template_name>",
        "category": "<category>",
        "provider_domainid": "<domainid>",
        "provider_userid": "<userid>",
        "provider_name": "<name>",
        "function_template": "urn:fss:cn-north-5:3f1e6caf808246c68457e660e4bfeb2f:function:default:test",
        "inputs": [{
            "parameter_name": "param1",
            "default": "TCP",
            "type": "string",
            "label": "action1",
            "constraints": {
                "valid_values": ["TCP", "UDP"]
            },
            "invisible": true,
            "description": "description param1"
        }],
        "dynamic_source_definition": {
            "param1": {
                "get_input": "$.inputs.param1"
            },
            "param2": {
                "get_input": "$.inputs.param2"
            }
        },
        "need_policy": {
            "version": "1.1",
            "statement": [{
                "action": [
                    "FunctionGraph:function:invokeAsync",
                    "FunctionGraph:function:invoke",
                    "FunctionGraph:function:updateCode",
                    "FunctionGraph:function:updateConfig",
                    "FunctionGraph:function:create",
                    "FunctionGraph:function:getConfig",
                    "FunctionGraph:function:getCode"
                ],
                "resource": ["FunctionGraph:*:*:function:*"]
            }, {
                "action": ["MPC:*:*:mpc:*"]
            }]
        },
        "description": ""
    }
}