1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ApiGateway
  5. getUsagePlan
Oracle Cloud Infrastructure v3.7.0 published on Saturday, Sep 13, 2025 by Pulumi

oci.ApiGateway.getUsagePlan

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v3.7.0 published on Saturday, Sep 13, 2025 by Pulumi

    This data source provides details about a specific Usage Plan resource in Oracle Cloud Infrastructure API Gateway service.

    Gets a usage plan by identifier.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testUsagePlan = oci.ApiGateway.getUsagePlan({
        usagePlanId: testUsagePlanOciApigatewayUsagePlan.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_usage_plan = oci.ApiGateway.get_usage_plan(usage_plan_id=test_usage_plan_oci_apigateway_usage_plan["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v3/go/oci/apigateway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := apigateway.GetUsagePlan(ctx, &apigateway.GetUsagePlanArgs{
    			UsagePlanId: testUsagePlanOciApigatewayUsagePlan.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testUsagePlan = Oci.ApiGateway.GetUsagePlan.Invoke(new()
        {
            UsagePlanId = testUsagePlanOciApigatewayUsagePlan.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.ApiGateway.ApiGatewayFunctions;
    import com.pulumi.oci.ApiGateway.inputs.GetUsagePlanArgs;
    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) {
            final var testUsagePlan = ApiGatewayFunctions.getUsagePlan(GetUsagePlanArgs.builder()
                .usagePlanId(testUsagePlanOciApigatewayUsagePlan.id())
                .build());
    
        }
    }
    
    variables:
      testUsagePlan:
        fn::invoke:
          function: oci:ApiGateway:getUsagePlan
          arguments:
            usagePlanId: ${testUsagePlanOciApigatewayUsagePlan.id}
    

    Using getUsagePlan

    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 getUsagePlan(args: GetUsagePlanArgs, opts?: InvokeOptions): Promise<GetUsagePlanResult>
    function getUsagePlanOutput(args: GetUsagePlanOutputArgs, opts?: InvokeOptions): Output<GetUsagePlanResult>
    def get_usage_plan(usage_plan_id: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetUsagePlanResult
    def get_usage_plan_output(usage_plan_id: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetUsagePlanResult]
    func LookupUsagePlan(ctx *Context, args *LookupUsagePlanArgs, opts ...InvokeOption) (*LookupUsagePlanResult, error)
    func LookupUsagePlanOutput(ctx *Context, args *LookupUsagePlanOutputArgs, opts ...InvokeOption) LookupUsagePlanResultOutput

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

    public static class GetUsagePlan 
    {
        public static Task<GetUsagePlanResult> InvokeAsync(GetUsagePlanArgs args, InvokeOptions? opts = null)
        public static Output<GetUsagePlanResult> Invoke(GetUsagePlanInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetUsagePlanResult> getUsagePlan(GetUsagePlanArgs args, InvokeOptions options)
    public static Output<GetUsagePlanResult> getUsagePlan(GetUsagePlanArgs args, InvokeOptions options)
    
    fn::invoke:
      function: oci:ApiGateway/getUsagePlan:getUsagePlan
      arguments:
        # arguments dictionary

    The following arguments are supported:

    UsagePlanId string
    The ocid of the usage plan.
    UsagePlanId string
    The ocid of the usage plan.
    usagePlanId String
    The ocid of the usage plan.
    usagePlanId string
    The ocid of the usage plan.
    usage_plan_id str
    The ocid of the usage plan.
    usagePlanId String
    The ocid of the usage plan.

    getUsagePlan Result

    The following output properties are available:

    CompartmentId string
    The OCID of the compartment in which the resource is created.
    DefinedTags Dictionary<string, string>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DisplayName string
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    Entitlements List<GetUsagePlanEntitlement>
    A collection of entitlements currently assigned to the usage plan.
    FreeformTags Dictionary<string, string>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The OCID of a usage plan resource.
    IsLockOverride bool
    LifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    Locks List<GetUsagePlanLock>
    Locks associated with this resource.
    State string
    The current state of the usage plan.
    SystemTags Dictionary<string, string>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    TimeUpdated string
    The time this resource was last updated. An RFC3339 formatted datetime string.
    UsagePlanId string
    CompartmentId string
    The OCID of the compartment in which the resource is created.
    DefinedTags map[string]string
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DisplayName string
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    Entitlements []GetUsagePlanEntitlement
    A collection of entitlements currently assigned to the usage plan.
    FreeformTags map[string]string
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The OCID of a usage plan resource.
    IsLockOverride bool
    LifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    Locks []GetUsagePlanLock
    Locks associated with this resource.
    State string
    The current state of the usage plan.
    SystemTags map[string]string
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    TimeUpdated string
    The time this resource was last updated. An RFC3339 formatted datetime string.
    UsagePlanId string
    compartmentId String
    The OCID of the compartment in which the resource is created.
    definedTags Map<String,String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName String
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    entitlements List<GetUsagePlanEntitlement>
    A collection of entitlements currently assigned to the usage plan.
    freeformTags Map<String,String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The OCID of a usage plan resource.
    isLockOverride Boolean
    lifecycleDetails String
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    locks List<GetUsagePlanLock>
    Locks associated with this resource.
    state String
    The current state of the usage plan.
    systemTags Map<String,String>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The time this resource was created. An RFC3339 formatted datetime string.
    timeUpdated String
    The time this resource was last updated. An RFC3339 formatted datetime string.
    usagePlanId String
    compartmentId string
    The OCID of the compartment in which the resource is created.
    definedTags {[key: string]: string}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName string
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    entitlements GetUsagePlanEntitlement[]
    A collection of entitlements currently assigned to the usage plan.
    freeformTags {[key: string]: string}
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id string
    The OCID of a usage plan resource.
    isLockOverride boolean
    lifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    locks GetUsagePlanLock[]
    Locks associated with this resource.
    state string
    The current state of the usage plan.
    systemTags {[key: string]: string}
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    timeUpdated string
    The time this resource was last updated. An RFC3339 formatted datetime string.
    usagePlanId string
    compartment_id str
    The OCID of the compartment in which the resource is created.
    defined_tags Mapping[str, str]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    display_name str
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    entitlements Sequence[GetUsagePlanEntitlement]
    A collection of entitlements currently assigned to the usage plan.
    freeform_tags Mapping[str, str]
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id str
    The OCID of a usage plan resource.
    is_lock_override bool
    lifecycle_details str
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    locks Sequence[GetUsagePlanLock]
    Locks associated with this resource.
    state str
    The current state of the usage plan.
    system_tags Mapping[str, str]
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    time_created str
    The time this resource was created. An RFC3339 formatted datetime string.
    time_updated str
    The time this resource was last updated. An RFC3339 formatted datetime string.
    usage_plan_id str
    compartmentId String
    The OCID of the compartment in which the resource is created.
    definedTags Map<String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName String
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
    entitlements List<Property Map>
    A collection of entitlements currently assigned to the usage plan.
    freeformTags Map<String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The OCID of a usage plan resource.
    isLockOverride Boolean
    lifecycleDetails String
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed state.
    locks List<Property Map>
    Locks associated with this resource.
    state String
    The current state of the usage plan.
    systemTags Map<String>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The time this resource was created. An RFC3339 formatted datetime string.
    timeUpdated String
    The time this resource was last updated. An RFC3339 formatted datetime string.
    usagePlanId String

    Supporting Types

    GetUsagePlanEntitlement

    Description string
    A user-friendly description. To provide some insight about the resource. Avoid entering confidential information.
    Name string
    An entitlement name, unique within a usage plan.
    Quotas List<GetUsagePlanEntitlementQuota>
    Quota policy for a usage plan.
    RateLimits List<GetUsagePlanEntitlementRateLimit>
    Rate-limiting policy for a usage plan.
    Targets List<GetUsagePlanEntitlementTarget>
    A collection of targeted deployments that the entitlement will be applied to.
    Description string
    A user-friendly description. To provide some insight about the resource. Avoid entering confidential information.
    Name string
    An entitlement name, unique within a usage plan.
    Quotas []GetUsagePlanEntitlementQuota
    Quota policy for a usage plan.
    RateLimits []GetUsagePlanEntitlementRateLimit
    Rate-limiting policy for a usage plan.
    Targets []GetUsagePlanEntitlementTarget
    A collection of targeted deployments that the entitlement will be applied to.
    description String
    A user-friendly description. To provide some insight about the resource. Avoid entering confidential information.
    name String
    An entitlement name, unique within a usage plan.
    quotas List<GetUsagePlanEntitlementQuota>
    Quota policy for a usage plan.
    rateLimits List<GetUsagePlanEntitlementRateLimit>
    Rate-limiting policy for a usage plan.
    targets List<GetUsagePlanEntitlementTarget>
    A collection of targeted deployments that the entitlement will be applied to.
    description string
    A user-friendly description. To provide some insight about the resource. Avoid entering confidential information.
    name string
    An entitlement name, unique within a usage plan.
    quotas GetUsagePlanEntitlementQuota[]
    Quota policy for a usage plan.
    rateLimits GetUsagePlanEntitlementRateLimit[]
    Rate-limiting policy for a usage plan.
    targets GetUsagePlanEntitlementTarget[]
    A collection of targeted deployments that the entitlement will be applied to.
    description str
    A user-friendly description. To provide some insight about the resource. Avoid entering confidential information.
    name str
    An entitlement name, unique within a usage plan.
    quotas Sequence[GetUsagePlanEntitlementQuota]
    Quota policy for a usage plan.
    rate_limits Sequence[GetUsagePlanEntitlementRateLimit]
    Rate-limiting policy for a usage plan.
    targets Sequence[GetUsagePlanEntitlementTarget]
    A collection of targeted deployments that the entitlement will be applied to.
    description String
    A user-friendly description. To provide some insight about the resource. Avoid entering confidential information.
    name String
    An entitlement name, unique within a usage plan.
    quotas List<Property Map>
    Quota policy for a usage plan.
    rateLimits List<Property Map>
    Rate-limiting policy for a usage plan.
    targets List<Property Map>
    A collection of targeted deployments that the entitlement will be applied to.

    GetUsagePlanEntitlementQuota

    OperationOnBreach string
    What the usage plan will do when a quota is breached: REJECT will allow no further requests ALLOW will continue to allow further requests
    ResetPolicy string
    The policy that controls when quotas will reset. Example: CALENDAR
    Unit string
    The unit of time over which rate limits are calculated. Example: SECOND
    Value int
    The number of requests that can be made per time period.
    OperationOnBreach string
    What the usage plan will do when a quota is breached: REJECT will allow no further requests ALLOW will continue to allow further requests
    ResetPolicy string
    The policy that controls when quotas will reset. Example: CALENDAR
    Unit string
    The unit of time over which rate limits are calculated. Example: SECOND
    Value int
    The number of requests that can be made per time period.
    operationOnBreach String
    What the usage plan will do when a quota is breached: REJECT will allow no further requests ALLOW will continue to allow further requests
    resetPolicy String
    The policy that controls when quotas will reset. Example: CALENDAR
    unit String
    The unit of time over which rate limits are calculated. Example: SECOND
    value Integer
    The number of requests that can be made per time period.
    operationOnBreach string
    What the usage plan will do when a quota is breached: REJECT will allow no further requests ALLOW will continue to allow further requests
    resetPolicy string
    The policy that controls when quotas will reset. Example: CALENDAR
    unit string
    The unit of time over which rate limits are calculated. Example: SECOND
    value number
    The number of requests that can be made per time period.
    operation_on_breach str
    What the usage plan will do when a quota is breached: REJECT will allow no further requests ALLOW will continue to allow further requests
    reset_policy str
    The policy that controls when quotas will reset. Example: CALENDAR
    unit str
    The unit of time over which rate limits are calculated. Example: SECOND
    value int
    The number of requests that can be made per time period.
    operationOnBreach String
    What the usage plan will do when a quota is breached: REJECT will allow no further requests ALLOW will continue to allow further requests
    resetPolicy String
    The policy that controls when quotas will reset. Example: CALENDAR
    unit String
    The unit of time over which rate limits are calculated. Example: SECOND
    value Number
    The number of requests that can be made per time period.

    GetUsagePlanEntitlementRateLimit

    Unit string
    The unit of time over which rate limits are calculated. Example: SECOND
    Value int
    The number of requests that can be made per time period.
    Unit string
    The unit of time over which rate limits are calculated. Example: SECOND
    Value int
    The number of requests that can be made per time period.
    unit String
    The unit of time over which rate limits are calculated. Example: SECOND
    value Integer
    The number of requests that can be made per time period.
    unit string
    The unit of time over which rate limits are calculated. Example: SECOND
    value number
    The number of requests that can be made per time period.
    unit str
    The unit of time over which rate limits are calculated. Example: SECOND
    value int
    The number of requests that can be made per time period.
    unit String
    The unit of time over which rate limits are calculated. Example: SECOND
    value Number
    The number of requests that can be made per time period.

    GetUsagePlanEntitlementTarget

    DeploymentId string
    The OCID of a deployment resource.
    DeploymentId string
    The OCID of a deployment resource.
    deploymentId String
    The OCID of a deployment resource.
    deploymentId string
    The OCID of a deployment resource.
    deployment_id str
    The OCID of a deployment resource.
    deploymentId String
    The OCID of a deployment resource.

    GetUsagePlanLock

    Message string
    A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.
    RelatedResourceId string
    The id of the resource that is locking this resource. Indicates that deleting this resource will remove the lock.
    TimeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    Type string
    Type of the lock.
    Message string
    A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.
    RelatedResourceId string
    The id of the resource that is locking this resource. Indicates that deleting this resource will remove the lock.
    TimeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    Type string
    Type of the lock.
    message String
    A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.
    relatedResourceId String
    The id of the resource that is locking this resource. Indicates that deleting this resource will remove the lock.
    timeCreated String
    The time this resource was created. An RFC3339 formatted datetime string.
    type String
    Type of the lock.
    message string
    A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.
    relatedResourceId string
    The id of the resource that is locking this resource. Indicates that deleting this resource will remove the lock.
    timeCreated string
    The time this resource was created. An RFC3339 formatted datetime string.
    type string
    Type of the lock.
    message str
    A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.
    related_resource_id str
    The id of the resource that is locking this resource. Indicates that deleting this resource will remove the lock.
    time_created str
    The time this resource was created. An RFC3339 formatted datetime string.
    type str
    Type of the lock.
    message String
    A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.
    relatedResourceId String
    The id of the resource that is locking this resource. Indicates that deleting this resource will remove the lock.
    timeCreated String
    The time this resource was created. An RFC3339 formatted datetime string.
    type String
    Type of the lock.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v3.7.0 published on Saturday, Sep 13, 2025 by Pulumi