1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Ons
  5. getSubscriptions
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi

oci.Ons.getSubscriptions

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi

    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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Ons/getSubscriptions:getSubscriptions
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    The OCID of the compartment.
    Filters List<GetSubscriptionsFilter>
    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 []GetSubscriptionsFilter
    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<GetSubscriptionsFilter>
    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 GetSubscriptionsFilter[]
    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.GetSubscriptionsFilter]
    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<GetSubscriptionsSubscription>
    The list of subscriptions.
    Filters List<GetSubscriptionsFilter>
    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 []GetSubscriptionsSubscription
    The list of subscriptions.
    Filters []GetSubscriptionsFilter
    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<GetSubscriptionsSubscription>
    The list of subscriptions.
    filters List<GetSubscriptionsFilter>
    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 GetSubscriptionsSubscription[]
    The list of subscriptions.
    filters GetSubscriptionsFilter[]
    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.GetSubscriptionsSubscription]
    The list of subscriptions.
    filters Sequence[ons.GetSubscriptionsFilter]
    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

    Name string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values List<String>
    regex Boolean

    GetSubscriptionsSubscription

    CompartmentId string
    The OCID of the compartment.
    CreatedTime string
    The time when this suscription was 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"}
    DeliveryPolicies List<GetSubscriptionsSubscriptionDeliveryPolicy>
    Endpoint string
    A locator that corresponds to the subscription protocol. For example, an email address for a subscription that uses the EMAIL protocol, 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.
    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 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.
    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"}
    DeliveryPolicies []GetSubscriptionsSubscriptionDeliveryPolicy
    Endpoint string
    A locator that corresponds to the subscription protocol. For example, an email address for a subscription that uses the EMAIL protocol, 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.
    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 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.
    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"}
    deliveryPolicies List<GetSubscriptionsSubscriptionDeliveryPolicy>
    endpoint String
    A locator that corresponds to the subscription protocol. For example, an email address for a subscription that uses the EMAIL protocol, 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.
    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 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.
    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"}
    deliveryPolicies GetSubscriptionsSubscriptionDeliveryPolicy[]
    endpoint string
    A locator that corresponds to the subscription protocol. For example, an email address for a subscription that uses the EMAIL protocol, 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.
    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 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.
    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"}
    delivery_policies Sequence[ons.GetSubscriptionsSubscriptionDeliveryPolicy]
    endpoint str
    A locator that corresponds to the subscription protocol. For example, an email address for a subscription that uses the EMAIL protocol, 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.
    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 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.
    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"}
    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 EMAIL protocol, 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.
    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 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

    MaxRetryDuration int
    The maximum retry duration in milliseconds.
    PolicyType string
    The type of delivery policy. Default value: EXPONENTIAL.
    MaxRetryDuration int
    The maximum retry duration in milliseconds.
    PolicyType string
    The type of delivery policy. Default value: EXPONENTIAL.
    maxRetryDuration Integer
    The maximum retry duration in milliseconds.
    policyType String
    The type of delivery policy. Default value: EXPONENTIAL.
    maxRetryDuration number
    The maximum retry duration in milliseconds.
    policyType string
    The type of delivery policy. Default value: EXPONENTIAL.
    max_retry_duration int
    The maximum retry duration in milliseconds.
    policy_type str
    The type of delivery policy. Default value: EXPONENTIAL.
    maxRetryDuration Number
    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 oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi