1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getApiGatewayUsagePlans
tencentcloud 1.81.182 published on Monday, Apr 14, 2025 by tencentcloudstack

tencentcloud.getApiGatewayUsagePlans

Explore with Pulumi AI

Use this data source to query API gateway usage plans.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const plan = new tencentcloud.ApiGatewayUsagePlan("plan", {
    usagePlanName: "my_plan",
    usagePlanDesc: "nice plan",
    maxRequestNum: 100,
    maxRequestNumPreSec: 10,
});
const name = tencentcloud.getApiGatewayUsagePlansOutput({
    usagePlanName: plan.usagePlanName,
});
const id = tencentcloud.getApiGatewayUsagePlansOutput({
    usagePlanId: plan.apiGatewayUsagePlanId,
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

plan = tencentcloud.ApiGatewayUsagePlan("plan",
    usage_plan_name="my_plan",
    usage_plan_desc="nice plan",
    max_request_num=100,
    max_request_num_pre_sec=10)
name = tencentcloud.get_api_gateway_usage_plans_output(usage_plan_name=plan.usage_plan_name)
id = tencentcloud.get_api_gateway_usage_plans_output(usage_plan_id=plan.api_gateway_usage_plan_id)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		plan, err := tencentcloud.NewApiGatewayUsagePlan(ctx, "plan", &tencentcloud.ApiGatewayUsagePlanArgs{
			UsagePlanName:       pulumi.String("my_plan"),
			UsagePlanDesc:       pulumi.String("nice plan"),
			MaxRequestNum:       pulumi.Float64(100),
			MaxRequestNumPreSec: pulumi.Float64(10),
		})
		if err != nil {
			return err
		}
		_ = tencentcloud.GetApiGatewayUsagePlansOutput(ctx, tencentcloud.GetApiGatewayUsagePlansOutputArgs{
			UsagePlanName: plan.UsagePlanName,
		}, nil)
		_ = tencentcloud.GetApiGatewayUsagePlansOutput(ctx, tencentcloud.GetApiGatewayUsagePlansOutputArgs{
			UsagePlanId: plan.ApiGatewayUsagePlanId,
		}, nil)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var plan = new Tencentcloud.ApiGatewayUsagePlan("plan", new()
    {
        UsagePlanName = "my_plan",
        UsagePlanDesc = "nice plan",
        MaxRequestNum = 100,
        MaxRequestNumPreSec = 10,
    });

    var name = Tencentcloud.GetApiGatewayUsagePlans.Invoke(new()
    {
        UsagePlanName = plan.UsagePlanName,
    });

    var id = Tencentcloud.GetApiGatewayUsagePlans.Invoke(new()
    {
        UsagePlanId = plan.ApiGatewayUsagePlanId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.ApiGatewayUsagePlan;
import com.pulumi.tencentcloud.ApiGatewayUsagePlanArgs;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetApiGatewayUsagePlansArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var plan = new ApiGatewayUsagePlan("plan", ApiGatewayUsagePlanArgs.builder()
            .usagePlanName("my_plan")
            .usagePlanDesc("nice plan")
            .maxRequestNum(100)
            .maxRequestNumPreSec(10)
            .build());

        final var name = TencentcloudFunctions.getApiGatewayUsagePlans(GetApiGatewayUsagePlansArgs.builder()
            .usagePlanName(plan.usagePlanName())
            .build());

        final var id = TencentcloudFunctions.getApiGatewayUsagePlans(GetApiGatewayUsagePlansArgs.builder()
            .usagePlanId(plan.apiGatewayUsagePlanId())
            .build());

    }
}
Copy
resources:
  plan:
    type: tencentcloud:ApiGatewayUsagePlan
    properties:
      usagePlanName: my_plan
      usagePlanDesc: nice plan
      maxRequestNum: 100
      maxRequestNumPreSec: 10
variables:
  name:
    fn::invoke:
      function: tencentcloud:getApiGatewayUsagePlans
      arguments:
        usagePlanName: ${plan.usagePlanName}
  id:
    fn::invoke:
      function: tencentcloud:getApiGatewayUsagePlans
      arguments:
        usagePlanId: ${plan.apiGatewayUsagePlanId}
Copy

Using getApiGatewayUsagePlans

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getApiGatewayUsagePlans(args: GetApiGatewayUsagePlansArgs, opts?: InvokeOptions): Promise<GetApiGatewayUsagePlansResult>
function getApiGatewayUsagePlansOutput(args: GetApiGatewayUsagePlansOutputArgs, opts?: InvokeOptions): Output<GetApiGatewayUsagePlansResult>
Copy
def get_api_gateway_usage_plans(id: Optional[str] = None,
                                result_output_file: Optional[str] = None,
                                usage_plan_id: Optional[str] = None,
                                usage_plan_name: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetApiGatewayUsagePlansResult
def get_api_gateway_usage_plans_output(id: Optional[pulumi.Input[str]] = None,
                                result_output_file: Optional[pulumi.Input[str]] = None,
                                usage_plan_id: Optional[pulumi.Input[str]] = None,
                                usage_plan_name: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetApiGatewayUsagePlansResult]
Copy
func GetApiGatewayUsagePlans(ctx *Context, args *GetApiGatewayUsagePlansArgs, opts ...InvokeOption) (*GetApiGatewayUsagePlansResult, error)
func GetApiGatewayUsagePlansOutput(ctx *Context, args *GetApiGatewayUsagePlansOutputArgs, opts ...InvokeOption) GetApiGatewayUsagePlansResultOutput
Copy

> Note: This function is named GetApiGatewayUsagePlans in the Go SDK.

public static class GetApiGatewayUsagePlans 
{
    public static Task<GetApiGatewayUsagePlansResult> InvokeAsync(GetApiGatewayUsagePlansArgs args, InvokeOptions? opts = null)
    public static Output<GetApiGatewayUsagePlansResult> Invoke(GetApiGatewayUsagePlansInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetApiGatewayUsagePlansResult> getApiGatewayUsagePlans(GetApiGatewayUsagePlansArgs args, InvokeOptions options)
public static Output<GetApiGatewayUsagePlansResult> getApiGatewayUsagePlans(GetApiGatewayUsagePlansArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: tencentcloud:index/getApiGatewayUsagePlans:getApiGatewayUsagePlans
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Id string
ResultOutputFile string
Used to save results.
UsagePlanId string
ID of the usage plan.
UsagePlanName string
Name of the usage plan.
Id string
ResultOutputFile string
Used to save results.
UsagePlanId string
ID of the usage plan.
UsagePlanName string
Name of the usage plan.
id String
resultOutputFile String
Used to save results.
usagePlanId String
ID of the usage plan.
usagePlanName String
Name of the usage plan.
id string
resultOutputFile string
Used to save results.
usagePlanId string
ID of the usage plan.
usagePlanName string
Name of the usage plan.
id str
result_output_file str
Used to save results.
usage_plan_id str
ID of the usage plan.
usage_plan_name str
Name of the usage plan.
id String
resultOutputFile String
Used to save results.
usagePlanId String
ID of the usage plan.
usagePlanName String
Name of the usage plan.

getApiGatewayUsagePlans Result

The following output properties are available:

Id string
Lists List<GetApiGatewayUsagePlansList>
A list of usage plans.
ResultOutputFile string
UsagePlanId string
ID of the usage plan.
UsagePlanName string
Name of the usage plan.
Id string
Lists []GetApiGatewayUsagePlansList
A list of usage plans.
ResultOutputFile string
UsagePlanId string
ID of the usage plan.
UsagePlanName string
Name of the usage plan.
id String
lists List<GetApiGatewayUsagePlansList>
A list of usage plans.
resultOutputFile String
usagePlanId String
ID of the usage plan.
usagePlanName String
Name of the usage plan.
id string
lists GetApiGatewayUsagePlansList[]
A list of usage plans.
resultOutputFile string
usagePlanId string
ID of the usage plan.
usagePlanName string
Name of the usage plan.
id str
lists Sequence[GetApiGatewayUsagePlansList]
A list of usage plans.
result_output_file str
usage_plan_id str
ID of the usage plan.
usage_plan_name str
Name of the usage plan.
id String
lists List<Property Map>
A list of usage plans.
resultOutputFile String
usagePlanId String
ID of the usage plan.
usagePlanName String
Name of the usage plan.

Supporting Types

GetApiGatewayUsagePlansList

CreateTime This property is required. string
Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
MaxRequestNum This property is required. double
Total number of requests allowed. Valid value formats: -1, [1,99999999]. The default value is -1, which indicates no limit.
MaxRequestNumPreSec This property is required. double
Limit of requests per second. Valid values formats: -1, [1,2000]. The default value is -1, which indicates no limit.
ModifyTime This property is required. string
Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
UsagePlanDesc This property is required. string
Custom usage plan description.
UsagePlanId This property is required. string
ID of the usage plan.
UsagePlanName This property is required. string
Name of the usage plan.
CreateTime This property is required. string
Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
MaxRequestNum This property is required. float64
Total number of requests allowed. Valid value formats: -1, [1,99999999]. The default value is -1, which indicates no limit.
MaxRequestNumPreSec This property is required. float64
Limit of requests per second. Valid values formats: -1, [1,2000]. The default value is -1, which indicates no limit.
ModifyTime This property is required. string
Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
UsagePlanDesc This property is required. string
Custom usage plan description.
UsagePlanId This property is required. string
ID of the usage plan.
UsagePlanName This property is required. string
Name of the usage plan.
createTime This property is required. String
Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
maxRequestNum This property is required. Double
Total number of requests allowed. Valid value formats: -1, [1,99999999]. The default value is -1, which indicates no limit.
maxRequestNumPreSec This property is required. Double
Limit of requests per second. Valid values formats: -1, [1,2000]. The default value is -1, which indicates no limit.
modifyTime This property is required. String
Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
usagePlanDesc This property is required. String
Custom usage plan description.
usagePlanId This property is required. String
ID of the usage plan.
usagePlanName This property is required. String
Name of the usage plan.
createTime This property is required. string
Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
maxRequestNum This property is required. number
Total number of requests allowed. Valid value formats: -1, [1,99999999]. The default value is -1, which indicates no limit.
maxRequestNumPreSec This property is required. number
Limit of requests per second. Valid values formats: -1, [1,2000]. The default value is -1, which indicates no limit.
modifyTime This property is required. string
Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
usagePlanDesc This property is required. string
Custom usage plan description.
usagePlanId This property is required. string
ID of the usage plan.
usagePlanName This property is required. string
Name of the usage plan.
create_time This property is required. str
Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
max_request_num This property is required. float
Total number of requests allowed. Valid value formats: -1, [1,99999999]. The default value is -1, which indicates no limit.
max_request_num_pre_sec This property is required. float
Limit of requests per second. Valid values formats: -1, [1,2000]. The default value is -1, which indicates no limit.
modify_time This property is required. str
Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
usage_plan_desc This property is required. str
Custom usage plan description.
usage_plan_id This property is required. str
ID of the usage plan.
usage_plan_name This property is required. str
Name of the usage plan.
createTime This property is required. String
Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
maxRequestNum This property is required. Number
Total number of requests allowed. Valid value formats: -1, [1,99999999]. The default value is -1, which indicates no limit.
maxRequestNumPreSec This property is required. Number
Limit of requests per second. Valid values formats: -1, [1,2000]. The default value is -1, which indicates no limit.
modifyTime This property is required. String
Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
usagePlanDesc This property is required. String
Custom usage plan description.
usagePlanId This property is required. String
ID of the usage plan.
usagePlanName This property is required. String
Name of the usage plan.

Package Details

Repository
tencentcloud tencentcloudstack/terraform-provider-tencentcloud
License
Notes
This Pulumi package is based on the tencentcloud Terraform Provider.