1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getApiGatewayUsagePlans
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.getApiGatewayUsagePlans

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    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,
    });
    
    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)
    
    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
    	})
    }
    
    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,
        });
    
    });
    
    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());
    
        }
    }
    
    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}
    

    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>
    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]
    func GetApiGatewayUsagePlans(ctx *Context, args *GetApiGatewayUsagePlansArgs, opts ...InvokeOption) (*GetApiGatewayUsagePlansResult, error)
    func GetApiGatewayUsagePlansOutput(ctx *Context, args *GetApiGatewayUsagePlansOutputArgs, opts ...InvokeOption) GetApiGatewayUsagePlansResultOutput

    > 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)
    }
    public static CompletableFuture<GetApiGatewayUsagePlansResult> getApiGatewayUsagePlans(GetApiGatewayUsagePlansArgs args, InvokeOptions options)
    public static Output<GetApiGatewayUsagePlansResult> getApiGatewayUsagePlans(GetApiGatewayUsagePlansArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getApiGatewayUsagePlans:getApiGatewayUsagePlans
      arguments:
        # arguments dictionary

    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 string
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    MaxRequestNum double
    Total number of requests allowed. Valid value formats: -1, [1,99999999]. The default value is -1, which indicates no limit.
    MaxRequestNumPreSec double
    Limit of requests per second. Valid values formats: -1, [1,2000]. The default value is -1, which indicates no limit.
    ModifyTime string
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    UsagePlanDesc string
    Custom usage plan description.
    UsagePlanId string
    ID of the usage plan.
    UsagePlanName string
    Name of the usage plan.
    CreateTime string
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    MaxRequestNum float64
    Total number of requests allowed. Valid value formats: -1, [1,99999999]. The default value is -1, which indicates no limit.
    MaxRequestNumPreSec float64
    Limit of requests per second. Valid values formats: -1, [1,2000]. The default value is -1, which indicates no limit.
    ModifyTime string
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    UsagePlanDesc string
    Custom usage plan description.
    UsagePlanId string
    ID of the usage plan.
    UsagePlanName string
    Name of the usage plan.
    createTime String
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    maxRequestNum Double
    Total number of requests allowed. Valid value formats: -1, [1,99999999]. The default value is -1, which indicates no limit.
    maxRequestNumPreSec Double
    Limit of requests per second. Valid values formats: -1, [1,2000]. The default value is -1, which indicates no limit.
    modifyTime String
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    usagePlanDesc String
    Custom usage plan description.
    usagePlanId String
    ID of the usage plan.
    usagePlanName String
    Name of the usage plan.
    createTime string
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    maxRequestNum number
    Total number of requests allowed. Valid value formats: -1, [1,99999999]. The default value is -1, which indicates no limit.
    maxRequestNumPreSec number
    Limit of requests per second. Valid values formats: -1, [1,2000]. The default value is -1, which indicates no limit.
    modifyTime string
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    usagePlanDesc string
    Custom usage plan description.
    usagePlanId string
    ID of the usage plan.
    usagePlanName string
    Name of the usage plan.
    create_time str
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    max_request_num 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 float
    Limit of requests per second. Valid values formats: -1, [1,2000]. The default value is -1, which indicates no limit.
    modify_time 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 str
    Custom usage plan description.
    usage_plan_id str
    ID of the usage plan.
    usage_plan_name str
    Name of the usage plan.
    createTime String
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    maxRequestNum Number
    Total number of requests allowed. Valid value formats: -1, [1,99999999]. The default value is -1, which indicates no limit.
    maxRequestNumPreSec Number
    Limit of requests per second. Valid values formats: -1, [1,2000]. The default value is -1, which indicates no limit.
    modifyTime String
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    usagePlanDesc String
    Custom usage plan description.
    usagePlanId String
    ID of the usage plan.
    usagePlanName 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.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack