Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi
oci.Ons.getSubscriptions
Explore with Pulumi AI
This data source provides the list of Subscriptions in Oracle Cloud Infrastructure Notifications service.
Lists the subscriptions in the specified compartment or topic.
Transactions Per Minute (TPM) per-tenancy limit for this operation: 60.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testSubscriptions = oci.Ons.getSubscriptions({
    compartmentId: compartmentId,
    topicId: testNotificationTopic.id,
});
import pulumi
import pulumi_oci as oci
test_subscriptions = oci.Ons.get_subscriptions(compartment_id=compartment_id,
    topic_id=test_notification_topic["id"])
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/ons"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ons.GetSubscriptions(ctx, &ons.GetSubscriptionsArgs{
			CompartmentId: compartmentId,
			TopicId:       pulumi.StringRef(testNotificationTopic.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 testSubscriptions = Oci.Ons.GetSubscriptions.Invoke(new()
    {
        CompartmentId = compartmentId,
        TopicId = testNotificationTopic.Id,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Ons.OnsFunctions;
import com.pulumi.oci.Ons.inputs.GetSubscriptionsArgs;
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 testSubscriptions = OnsFunctions.getSubscriptions(GetSubscriptionsArgs.builder()
            .compartmentId(compartmentId)
            .topicId(testNotificationTopic.id())
            .build());
    }
}
variables:
  testSubscriptions:
    fn::invoke:
      function: oci:Ons:getSubscriptions
      arguments:
        compartmentId: ${compartmentId}
        topicId: ${testNotificationTopic.id}
Using getSubscriptions
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 getSubscriptions(args: GetSubscriptionsArgs, opts?: InvokeOptions): Promise<GetSubscriptionsResult>
function getSubscriptionsOutput(args: GetSubscriptionsOutputArgs, opts?: InvokeOptions): Output<GetSubscriptionsResult>def get_subscriptions(compartment_id: Optional[str] = None,
                      filters: Optional[Sequence[_ons.GetSubscriptionsFilter]] = None,
                      topic_id: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetSubscriptionsResult
def get_subscriptions_output(compartment_id: Optional[pulumi.Input[str]] = None,
                      filters: Optional[pulumi.Input[Sequence[pulumi.Input[_ons.GetSubscriptionsFilterArgs]]]] = None,
                      topic_id: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetSubscriptionsResult]func GetSubscriptions(ctx *Context, args *GetSubscriptionsArgs, opts ...InvokeOption) (*GetSubscriptionsResult, error)
func GetSubscriptionsOutput(ctx *Context, args *GetSubscriptionsOutputArgs, opts ...InvokeOption) GetSubscriptionsResultOutput> Note: This function is named GetSubscriptions in the Go SDK.
public static class GetSubscriptions 
{
    public static Task<GetSubscriptionsResult> InvokeAsync(GetSubscriptionsArgs args, InvokeOptions? opts = null)
    public static Output<GetSubscriptionsResult> Invoke(GetSubscriptionsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSubscriptionsResult> getSubscriptions(GetSubscriptionsArgs args, InvokeOptions options)
public static Output<GetSubscriptionsResult> getSubscriptions(GetSubscriptionsArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Ons/getSubscriptions:getSubscriptions
  arguments:
    # arguments dictionaryThe following arguments are supported:
- CompartmentId string
- The OCID of the compartment.
- Filters
List<GetSubscriptions Filter> 
- TopicId string
- Return all subscriptions that are subscribed to the given topic OCID. Either this query parameter or the compartmentId query parameter must be set.
- CompartmentId string
- The OCID of the compartment.
- Filters
[]GetSubscriptions Filter 
- TopicId string
- Return all subscriptions that are subscribed to the given topic OCID. Either this query parameter or the compartmentId query parameter must be set.
- compartmentId String
- The OCID of the compartment.
- filters
List<GetSubscriptions Filter> 
- topicId String
- Return all subscriptions that are subscribed to the given topic OCID. Either this query parameter or the compartmentId query parameter must be set.
- compartmentId string
- The OCID of the compartment.
- filters
GetSubscriptions Filter[] 
- topicId string
- Return all subscriptions that are subscribed to the given topic OCID. Either this query parameter or the compartmentId query parameter must be set.
- compartment_id str
- The OCID of the compartment.
- filters
Sequence[ons.Get Subscriptions Filter] 
- topic_id str
- Return all subscriptions that are subscribed to the given topic OCID. Either this query parameter or the compartmentId query parameter must be set.
- compartmentId String
- The OCID of the compartment.
- filters List<Property Map>
- topicId String
- Return all subscriptions that are subscribed to the given topic OCID. Either this query parameter or the compartmentId query parameter must be set.
getSubscriptions Result
The following output properties are available:
- CompartmentId string
- The OCID of the compartment for the subscription.
- Id string
- The provider-assigned unique ID for this managed resource.
- Subscriptions
List<GetSubscriptions Subscription> 
- The list of subscriptions.
- Filters
List<GetSubscriptions Filter> 
- TopicId string
- The OCID of the associated topic.
- CompartmentId string
- The OCID of the compartment for the subscription.
- Id string
- The provider-assigned unique ID for this managed resource.
- Subscriptions
[]GetSubscriptions Subscription 
- The list of subscriptions.
- Filters
[]GetSubscriptions Filter 
- TopicId string
- The OCID of the associated topic.
- compartmentId String
- The OCID of the compartment for the subscription.
- id String
- The provider-assigned unique ID for this managed resource.
- subscriptions
List<GetSubscriptions Subscription> 
- The list of subscriptions.
- filters
List<GetSubscriptions Filter> 
- topicId String
- The OCID of the associated topic.
- compartmentId string
- The OCID of the compartment for the subscription.
- id string
- The provider-assigned unique ID for this managed resource.
- subscriptions
GetSubscriptions Subscription[] 
- The list of subscriptions.
- filters
GetSubscriptions Filter[] 
- topicId string
- The OCID of the associated topic.
- compartment_id str
- The OCID of the compartment for the subscription.
- id str
- The provider-assigned unique ID for this managed resource.
- subscriptions
Sequence[ons.Get Subscriptions Subscription] 
- The list of subscriptions.
- filters
Sequence[ons.Get Subscriptions Filter] 
- topic_id str
- The OCID of the associated topic.
- compartmentId String
- The OCID of the compartment for the subscription.
- id String
- The provider-assigned unique ID for this managed resource.
- subscriptions List<Property Map>
- The list of subscriptions.
- filters List<Property Map>
- topicId String
- The OCID of the associated topic.
Supporting Types
GetSubscriptionsFilter  
GetSubscriptionsSubscription  
- CompartmentId string
- The OCID of the compartment.
- CreatedTime string
- The time when this suscription was created.
- 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"}
- DeliveryPolicies List<GetSubscriptions Subscription Delivery Policy> 
- Endpoint string
- A locator that corresponds to the subscription protocol. For example, an email address for a subscription that uses the EMAILprotocol, or a URL for a subscription that uses an HTTP-based protocol. Avoid entering confidential information.
- Etag string
- For optimistic concurrency control. See if-match.
- 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 the subscription.
- Protocol string
- The protocol used for the subscription.
- State string
- The lifecycle state of the subscription. The status of a new subscription is PENDING; when confirmed, the subscription status changes to ACTIVE.
- TopicId string
- Return all subscriptions that are subscribed to the given topic OCID. Either this query parameter or the compartmentId query parameter must be set.
- CompartmentId string
- The OCID of the compartment.
- CreatedTime string
- The time when this suscription was created.
- 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"}
- DeliveryPolicies []GetSubscriptions Subscription Delivery Policy 
- Endpoint string
- A locator that corresponds to the subscription protocol. For example, an email address for a subscription that uses the EMAILprotocol, or a URL for a subscription that uses an HTTP-based protocol. Avoid entering confidential information.
- Etag string
- For optimistic concurrency control. See if-match.
- 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 the subscription.
- Protocol string
- The protocol used for the subscription.
- State string
- The lifecycle state of the subscription. The status of a new subscription is PENDING; when confirmed, the subscription status changes to ACTIVE.
- TopicId string
- Return all subscriptions that are subscribed to the given topic OCID. Either this query parameter or the compartmentId query parameter must be set.
- compartmentId String
- The OCID of the compartment.
- createdTime String
- The time when this suscription was created.
- 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"}
- deliveryPolicies List<GetSubscriptions Subscription Delivery Policy> 
- endpoint String
- A locator that corresponds to the subscription protocol. For example, an email address for a subscription that uses the EMAILprotocol, or a URL for a subscription that uses an HTTP-based protocol. Avoid entering confidential information.
- etag String
- For optimistic concurrency control. See if-match.
- 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 the subscription.
- protocol String
- The protocol used for the subscription.
- state String
- The lifecycle state of the subscription. The status of a new subscription is PENDING; when confirmed, the subscription status changes to ACTIVE.
- topicId String
- Return all subscriptions that are subscribed to the given topic OCID. Either this query parameter or the compartmentId query parameter must be set.
- compartmentId string
- The OCID of the compartment.
- createdTime string
- The time when this suscription was created.
- {[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"}
- deliveryPolicies GetSubscriptions Subscription Delivery Policy[] 
- endpoint string
- A locator that corresponds to the subscription protocol. For example, an email address for a subscription that uses the EMAILprotocol, or a URL for a subscription that uses an HTTP-based protocol. Avoid entering confidential information.
- etag string
- For optimistic concurrency control. See if-match.
- {[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 the subscription.
- protocol string
- The protocol used for the subscription.
- state string
- The lifecycle state of the subscription. The status of a new subscription is PENDING; when confirmed, the subscription status changes to ACTIVE.
- topicId string
- Return all subscriptions that are subscribed to the given topic OCID. Either this query parameter or the compartmentId query parameter must be set.
- compartment_id str
- The OCID of the compartment.
- created_time str
- The time when this suscription was created.
- 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"}
- delivery_policies Sequence[ons.Get Subscriptions Subscription Delivery Policy] 
- endpoint str
- A locator that corresponds to the subscription protocol. For example, an email address for a subscription that uses the EMAILprotocol, or a URL for a subscription that uses an HTTP-based protocol. Avoid entering confidential information.
- etag str
- For optimistic concurrency control. See if-match.
- 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 the subscription.
- protocol str
- The protocol used for the subscription.
- state str
- The lifecycle state of the subscription. The status of a new subscription is PENDING; when confirmed, the subscription status changes to ACTIVE.
- topic_id str
- Return all subscriptions that are subscribed to the given topic OCID. Either this query parameter or the compartmentId query parameter must be set.
- compartmentId String
- The OCID of the compartment.
- createdTime String
- The time when this suscription was created.
- 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"}
- deliveryPolicies List<Property Map>
- endpoint String
- A locator that corresponds to the subscription protocol. For example, an email address for a subscription that uses the EMAILprotocol, or a URL for a subscription that uses an HTTP-based protocol. Avoid entering confidential information.
- etag String
- For optimistic concurrency control. See if-match.
- 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 the subscription.
- protocol String
- The protocol used for the subscription.
- state String
- The lifecycle state of the subscription. The status of a new subscription is PENDING; when confirmed, the subscription status changes to ACTIVE.
- topicId String
- Return all subscriptions that are subscribed to the given topic OCID. Either this query parameter or the compartmentId query parameter must be set.
GetSubscriptionsSubscriptionDeliveryPolicy    
GetSubscriptionsSubscriptionDeliveryPolicyBackoffRetryPolicy       
- MaxRetry intDuration 
- The maximum retry duration in milliseconds.
- PolicyType string
- The type of delivery policy. Default value: EXPONENTIAL.
- MaxRetry intDuration 
- The maximum retry duration in milliseconds.
- PolicyType string
- The type of delivery policy. Default value: EXPONENTIAL.
- maxRetry IntegerDuration 
- The maximum retry duration in milliseconds.
- policyType String
- The type of delivery policy. Default value: EXPONENTIAL.
- maxRetry numberDuration 
- The maximum retry duration in milliseconds.
- policyType string
- The type of delivery policy. Default value: EXPONENTIAL.
- max_retry_ intduration 
- The maximum retry duration in milliseconds.
- policy_type str
- The type of delivery policy. Default value: EXPONENTIAL.
- maxRetry NumberDuration 
- The maximum retry duration in milliseconds.
- policyType String
- The type of delivery policy. Default value: EXPONENTIAL.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.