QueryParentTunnelMetric

Updated at:

Queries the level-1 Tunnel slot usage or limit for the current tenant in the requested region and returns a time-sampled metric series. The request body must contain at least an empty object.

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

odps:QueryParentTunnelMetric

list

*All Resource

*

None None

Request syntax

POST /api/v1/observations/tunnel/{metric}/forParent HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

metric

string

Yes

The name of the metric. A value of slot_usage indicates the slot usage, and a value of slot_max indicates the slot limit.

slot_usage

Request parameters

Parameter

Type

Required

Description

Example

startTime

integer

Yes

The start time of the query, represented as a UNIX timestamp in seconds. The maximum query span is 7 days.

1767225600

endTime

integer

Yes

The end time of the query, represented as a UNIX timestamp in seconds. The value must be greater than startTime.

1767229200

strategy

string

No

The aggregation method within the sampling window. Valid values:

  • max: the maximum value.

  • avg: the average value. Default value: max.

max

body

object

No

The quota, grouping, and sampling options for the level-1 Tunnel metric query.

parentQuotaNickname

string

No

The level-1 Tunnel quota selection. Set this parameter to default to query the default Tunnel. If this parameter is omitted, the summary of exclusive Tunnels is queried.

default

groupList

array

No

The list of grouping dimensions. Supported values are quota and project. The project dimension is only applicable to the slot usage of the default Tunnel.

string

No

The grouping dimension. A value of quota indicates grouping by quota, and a value of project indicates grouping by project.

quota

interval

integer

No

The sampling interval in seconds. Valid values: 60, 300, and 900. If this parameter is explicitly specified, the maximum query span is 3 days. If this parameter is omitted, the interval is automatically selected based on the duration.

60

Response elements

Element

Type

Description

Example

object

PopResult

requestId

string

The unique identifier of the API request. You can provide this identifier when troubleshooting call issues.

0be3e0aa16667684362147582e038f

httpCode

integer

The HTTP status code of the request.

200

errorCode

string

The error code returned when the request fails.

InvalidArgument

errorMsg

string

The error message returned when the request fails.

The specified parameter is invalid.

data

object

The level-1 Tunnel slot metrics and their time series data.

category

string

[Deprecated] Do not rely on this field. This field is not populated by this operation.

null

name

string

The name of the requested metric.

slot_usage

period

integer

The actual sampling interval used, in seconds.

60

metrics

array<object>

The metric time series grouped by dimension. An empty array is returned if no data is found.

array<object>

metric

object

The dimension label of the time series. The actual key name varies based on the grouping method.

{"quota":"default"}

string

The value of the dimension label, such as the value of quota when grouped by the default quota.

default

values

array

The list of time series data points. Each point contains a timestamp and a slot metric value in sequence.

array

A data point. The first item is a UNIX timestamp in seconds, and the second item is the slot metric value.

number

The numeric elements of the data point. The first element is a UNIX timestamp in seconds, and the second element is the slot metric value.

1767225600

Examples

Success response

JSON format

{
  "requestId": "0be3e0aa16667684362147582e038f",
  "httpCode": 200,
  "errorCode": "InvalidArgument",
  "errorMsg": "The specified parameter is invalid.",
  "data": {
    "category": "null",
    "name": "slot_usage",
    "period": 60,
    "metrics": [
      {
        "metric": {
          "key": "default"
        },
        "values": [
          [
            1767225600
          ]
        ]
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.