1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ApiGateway
  5. getUsagePlans
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

oci.ApiGateway.getUsagePlans

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

This data source provides the list of Usage Plans in Oracle Cloud Infrastructure API Gateway service.

Returns a list of usage plans.

Example Usage

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

const testUsagePlans = oci.ApiGateway.getUsagePlans({
    compartmentId: compartmentId,
    displayName: usagePlanDisplayName,
    state: usagePlanState,
});
Copy
import pulumi
import pulumi_oci as oci

test_usage_plans = oci.ApiGateway.get_usage_plans(compartment_id=compartment_id,
    display_name=usage_plan_display_name,
    state=usage_plan_state)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/apigateway"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apigateway.GetUsagePlans(ctx, &apigateway.GetUsagePlansArgs{
			CompartmentId: compartmentId,
			DisplayName:   pulumi.StringRef(usagePlanDisplayName),
			State:         pulumi.StringRef(usagePlanState),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testUsagePlans = Oci.ApiGateway.GetUsagePlans.Invoke(new()
    {
        CompartmentId = compartmentId,
        DisplayName = usagePlanDisplayName,
        State = usagePlanState,
    });

});
Copy
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.GetUsagePlansArgs;
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 testUsagePlans = ApiGatewayFunctions.getUsagePlans(GetUsagePlansArgs.builder()
            .compartmentId(compartmentId)
            .displayName(usagePlanDisplayName)
            .state(usagePlanState)
            .build());

    }
}
Copy
variables:
  testUsagePlans:
    fn::invoke:
      function: oci:ApiGateway:getUsagePlans
      arguments:
        compartmentId: ${compartmentId}
        displayName: ${usagePlanDisplayName}
        state: ${usagePlanState}
Copy

Using getUsagePlans

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 getUsagePlans(args: GetUsagePlansArgs, opts?: InvokeOptions): Promise<GetUsagePlansResult>
function getUsagePlansOutput(args: GetUsagePlansOutputArgs, opts?: InvokeOptions): Output<GetUsagePlansResult>
Copy
def get_usage_plans(compartment_id: Optional[str] = None,
                    display_name: Optional[str] = None,
                    filters: Optional[Sequence[_apigateway.GetUsagePlansFilter]] = None,
                    state: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetUsagePlansResult
def get_usage_plans_output(compartment_id: Optional[pulumi.Input[str]] = None,
                    display_name: Optional[pulumi.Input[str]] = None,
                    filters: Optional[pulumi.Input[Sequence[pulumi.Input[_apigateway.GetUsagePlansFilterArgs]]]] = None,
                    state: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetUsagePlansResult]
Copy
func GetUsagePlans(ctx *Context, args *GetUsagePlansArgs, opts ...InvokeOption) (*GetUsagePlansResult, error)
func GetUsagePlansOutput(ctx *Context, args *GetUsagePlansOutputArgs, opts ...InvokeOption) GetUsagePlansResultOutput
Copy

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

public static class GetUsagePlans 
{
    public static Task<GetUsagePlansResult> InvokeAsync(GetUsagePlansArgs args, InvokeOptions? opts = null)
    public static Output<GetUsagePlansResult> Invoke(GetUsagePlansInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetUsagePlansResult> getUsagePlans(GetUsagePlansArgs args, InvokeOptions options)
public static Output<GetUsagePlansResult> getUsagePlans(GetUsagePlansArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:ApiGateway/getUsagePlans:getUsagePlans
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

CompartmentId This property is required. string
The ocid of the compartment in which to list resources.
DisplayName string
A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource
Filters Changes to this property will trigger replacement. List<GetUsagePlansFilter>
State string
A filter to return only resources that match the given lifecycle state. Example: ACTIVE
CompartmentId This property is required. string
The ocid of the compartment in which to list resources.
DisplayName string
A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource
Filters Changes to this property will trigger replacement. []GetUsagePlansFilter
State string
A filter to return only resources that match the given lifecycle state. Example: ACTIVE
compartmentId This property is required. String
The ocid of the compartment in which to list resources.
displayName String
A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource
filters Changes to this property will trigger replacement. List<GetUsagePlansFilter>
state String
A filter to return only resources that match the given lifecycle state. Example: ACTIVE
compartmentId This property is required. string
The ocid of the compartment in which to list resources.
displayName string
A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource
filters Changes to this property will trigger replacement. GetUsagePlansFilter[]
state string
A filter to return only resources that match the given lifecycle state. Example: ACTIVE
compartment_id This property is required. str
The ocid of the compartment in which to list resources.
display_name str
A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource
filters Changes to this property will trigger replacement. Sequence[apigateway.GetUsagePlansFilter]
state str
A filter to return only resources that match the given lifecycle state. Example: ACTIVE
compartmentId This property is required. String
The ocid of the compartment in which to list resources.
displayName String
A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource
filters Changes to this property will trigger replacement. List<Property Map>
state String
A filter to return only resources that match the given lifecycle state. Example: ACTIVE

getUsagePlans Result

The following output properties are available:

CompartmentId string
The OCID of the compartment in which the resource is created.
Id string
The provider-assigned unique ID for this managed resource.
UsagePlanCollections List<GetUsagePlansUsagePlanCollection>
The list of usage_plan_collection.
DisplayName string
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
Filters List<GetUsagePlansFilter>
State string
The current state of the usage plan.
CompartmentId string
The OCID of the compartment in which the resource is created.
Id string
The provider-assigned unique ID for this managed resource.
UsagePlanCollections []GetUsagePlansUsagePlanCollection
The list of usage_plan_collection.
DisplayName string
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
Filters []GetUsagePlansFilter
State string
The current state of the usage plan.
compartmentId String
The OCID of the compartment in which the resource is created.
id String
The provider-assigned unique ID for this managed resource.
usagePlanCollections List<GetUsagePlansUsagePlanCollection>
The list of usage_plan_collection.
displayName String
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
filters List<GetUsagePlansFilter>
state String
The current state of the usage plan.
compartmentId string
The OCID of the compartment in which the resource is created.
id string
The provider-assigned unique ID for this managed resource.
usagePlanCollections GetUsagePlansUsagePlanCollection[]
The list of usage_plan_collection.
displayName string
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
filters GetUsagePlansFilter[]
state string
The current state of the usage plan.
compartment_id str
The OCID of the compartment in which the resource is created.
id str
The provider-assigned unique ID for this managed resource.
usage_plan_collections Sequence[apigateway.GetUsagePlansUsagePlanCollection]
The list of usage_plan_collection.
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
filters Sequence[apigateway.GetUsagePlansFilter]
state str
The current state of the usage plan.
compartmentId String
The OCID of the compartment in which the resource is created.
id String
The provider-assigned unique ID for this managed resource.
usagePlanCollections List<Property Map>
The list of usage_plan_collection.
displayName String
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. Example: My new resource
filters List<Property Map>
state String
The current state of the usage plan.

Supporting Types

GetUsagePlansFilter

Name This property is required. string
An entitlement name, unique within a usage plan.
Values This property is required. List<string>
Regex bool
Name This property is required. string
An entitlement name, unique within a usage plan.
Values This property is required. []string
Regex bool
name This property is required. String
An entitlement name, unique within a usage plan.
values This property is required. List<String>
regex Boolean
name This property is required. string
An entitlement name, unique within a usage plan.
values This property is required. string[]
regex boolean
name This property is required. str
An entitlement name, unique within a usage plan.
values This property is required. Sequence[str]
regex bool
name This property is required. String
An entitlement name, unique within a usage plan.
values This property is required. List<String>
regex Boolean

GetUsagePlansUsagePlanCollection

items This property is required. List<Property Map>

GetUsagePlansUsagePlanCollectionItem

CompartmentId This property is required. string
The ocid of the compartment in which to list resources.
DefinedTags This property is required. 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 This property is required. string
A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource
Entitlements This property is required. List<GetUsagePlansUsagePlanCollectionItemEntitlement>
A collection of entitlements currently assigned to the usage plan.
FreeformTags This property is required. 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 This property is required. string
The OCID of a usage plan resource.
LifecycleDetails This property is required. 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.
State This property is required. string
A filter to return only resources that match the given lifecycle state. Example: ACTIVE
TimeCreated This property is required. string
The time this resource was created. An RFC3339 formatted datetime string.
TimeUpdated This property is required. string
The time this resource was last updated. An RFC3339 formatted datetime string.
CompartmentId This property is required. string
The ocid of the compartment in which to list resources.
DefinedTags This property is required. 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 This property is required. string
A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource
Entitlements This property is required. []GetUsagePlansUsagePlanCollectionItemEntitlement
A collection of entitlements currently assigned to the usage plan.
FreeformTags This property is required. 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 This property is required. string
The OCID of a usage plan resource.
LifecycleDetails This property is required. 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.
State This property is required. string
A filter to return only resources that match the given lifecycle state. Example: ACTIVE
TimeCreated This property is required. string
The time this resource was created. An RFC3339 formatted datetime string.
TimeUpdated This property is required. string
The time this resource was last updated. An RFC3339 formatted datetime string.
compartmentId This property is required. String
The ocid of the compartment in which to list resources.
definedTags This property is required. 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 This property is required. String
A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource
entitlements This property is required. List<GetUsagePlansUsagePlanCollectionItemEntitlement>
A collection of entitlements currently assigned to the usage plan.
freeformTags This property is required. 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 This property is required. String
The OCID of a usage plan resource.
lifecycleDetails This property is required. 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.
state This property is required. String
A filter to return only resources that match the given lifecycle state. Example: ACTIVE
timeCreated This property is required. String
The time this resource was created. An RFC3339 formatted datetime string.
timeUpdated This property is required. String
The time this resource was last updated. An RFC3339 formatted datetime string.
compartmentId This property is required. string
The ocid of the compartment in which to list resources.
definedTags This property is required. {[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 This property is required. string
A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource
entitlements This property is required. GetUsagePlansUsagePlanCollectionItemEntitlement[]
A collection of entitlements currently assigned to the usage plan.
freeformTags This property is required. {[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 This property is required. string
The OCID of a usage plan resource.
lifecycleDetails This property is required. 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.
state This property is required. string
A filter to return only resources that match the given lifecycle state. Example: ACTIVE
timeCreated This property is required. string
The time this resource was created. An RFC3339 formatted datetime string.
timeUpdated This property is required. string
The time this resource was last updated. An RFC3339 formatted datetime string.
compartment_id This property is required. str
The ocid of the compartment in which to list resources.
defined_tags This property is required. 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 This property is required. str
A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource
entitlements This property is required. Sequence[apigateway.GetUsagePlansUsagePlanCollectionItemEntitlement]
A collection of entitlements currently assigned to the usage plan.
freeform_tags This property is required. 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 This property is required. str
The OCID of a usage plan resource.
lifecycle_details This property is required. 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.
state This property is required. str
A filter to return only resources that match the given lifecycle state. Example: ACTIVE
time_created This property is required. str
The time this resource was created. An RFC3339 formatted datetime string.
time_updated This property is required. str
The time this resource was last updated. An RFC3339 formatted datetime string.
compartmentId This property is required. String
The ocid of the compartment in which to list resources.
definedTags This property is required. 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 This property is required. String
A user-friendly name. Does not have to be unique, and it's changeable. Example: My new resource
entitlements This property is required. List<Property Map>
A collection of entitlements currently assigned to the usage plan.
freeformTags This property is required. 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 This property is required. String
The OCID of a usage plan resource.
lifecycleDetails This property is required. 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.
state This property is required. String
A filter to return only resources that match the given lifecycle state. Example: ACTIVE
timeCreated This property is required. String
The time this resource was created. An RFC3339 formatted datetime string.
timeUpdated This property is required. String
The time this resource was last updated. An RFC3339 formatted datetime string.

GetUsagePlansUsagePlanCollectionItemEntitlement

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

GetUsagePlansUsagePlanCollectionItemEntitlementQuota

OperationOnBreach This property is required. 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 This property is required. string
The policy that controls when quotas will reset. Example: CALENDAR
Unit This property is required. string
The unit of time over which rate limits are calculated. Example: SECOND
Value This property is required. int
The number of requests that can be made per time period.
OperationOnBreach This property is required. 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 This property is required. string
The policy that controls when quotas will reset. Example: CALENDAR
Unit This property is required. string
The unit of time over which rate limits are calculated. Example: SECOND
Value This property is required. int
The number of requests that can be made per time period.
operationOnBreach This property is required. 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 This property is required. String
The policy that controls when quotas will reset. Example: CALENDAR
unit This property is required. String
The unit of time over which rate limits are calculated. Example: SECOND
value This property is required. Integer
The number of requests that can be made per time period.
operationOnBreach This property is required. 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 This property is required. string
The policy that controls when quotas will reset. Example: CALENDAR
unit This property is required. string
The unit of time over which rate limits are calculated. Example: SECOND
value This property is required. number
The number of requests that can be made per time period.
operation_on_breach This property is required. 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 This property is required. str
The policy that controls when quotas will reset. Example: CALENDAR
unit This property is required. str
The unit of time over which rate limits are calculated. Example: SECOND
value This property is required. int
The number of requests that can be made per time period.
operationOnBreach This property is required. 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 This property is required. String
The policy that controls when quotas will reset. Example: CALENDAR
unit This property is required. String
The unit of time over which rate limits are calculated. Example: SECOND
value This property is required. Number
The number of requests that can be made per time period.

GetUsagePlansUsagePlanCollectionItemEntitlementRateLimit

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

GetUsagePlansUsagePlanCollectionItemEntitlementTarget

DeploymentId This property is required. string
The OCID of a deployment resource.
DeploymentId This property is required. string
The OCID of a deployment resource.
deploymentId This property is required. String
The OCID of a deployment resource.
deploymentId This property is required. string
The OCID of a deployment resource.
deployment_id This property is required. str
The OCID of a deployment resource.
deploymentId This property is required. String
The OCID of a deployment resource.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi