1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. UsageProxy
  5. getSubscriptionProducts
Oracle Cloud Infrastructure v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi

oci.UsageProxy.getSubscriptionProducts

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi

    This data source provides the list of Subscription Products in Oracle Cloud Infrastructure Usage Proxy service.

    Provides product information that is specific to a reward usage period and its usage details.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testSubscriptionProducts = oci.UsageProxy.getSubscriptionProducts({
        subscriptionId: testSubscription.id,
        tenancyId: testTenancy.id,
        usagePeriodKey: subscriptionProductUsagePeriodKey,
        producttype: subscriptionProductProducttype,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_subscription_products = oci.UsageProxy.get_subscription_products(subscription_id=test_subscription["id"],
        tenancy_id=test_tenancy["id"],
        usage_period_key=subscription_product_usage_period_key,
        producttype=subscription_product_producttype)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/UsageProxy"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := UsageProxy.GetSubscriptionProducts(ctx, &usageproxy.GetSubscriptionProductsArgs{
    			SubscriptionId: testSubscription.Id,
    			TenancyId:      testTenancy.Id,
    			UsagePeriodKey: subscriptionProductUsagePeriodKey,
    			Producttype:    pulumi.StringRef(subscriptionProductProducttype),
    		}, 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 testSubscriptionProducts = Oci.UsageProxy.GetSubscriptionProducts.Invoke(new()
        {
            SubscriptionId = testSubscription.Id,
            TenancyId = testTenancy.Id,
            UsagePeriodKey = subscriptionProductUsagePeriodKey,
            Producttype = subscriptionProductProducttype,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.UsageProxy.UsageProxyFunctions;
    import com.pulumi.oci.UsageProxy.inputs.GetSubscriptionProductsArgs;
    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 testSubscriptionProducts = UsageProxyFunctions.getSubscriptionProducts(GetSubscriptionProductsArgs.builder()
                .subscriptionId(testSubscription.id())
                .tenancyId(testTenancy.id())
                .usagePeriodKey(subscriptionProductUsagePeriodKey)
                .producttype(subscriptionProductProducttype)
                .build());
    
        }
    }
    
    variables:
      testSubscriptionProducts:
        fn::invoke:
          Function: oci:UsageProxy:getSubscriptionProducts
          Arguments:
            subscriptionId: ${testSubscription.id}
            tenancyId: ${testTenancy.id}
            usagePeriodKey: ${subscriptionProductUsagePeriodKey}
            producttype: ${subscriptionProductProducttype}
    

    Using getSubscriptionProducts

    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 getSubscriptionProducts(args: GetSubscriptionProductsArgs, opts?: InvokeOptions): Promise<GetSubscriptionProductsResult>
    function getSubscriptionProductsOutput(args: GetSubscriptionProductsOutputArgs, opts?: InvokeOptions): Output<GetSubscriptionProductsResult>
    def get_subscription_products(filters: Optional[Sequence[_usageproxy.GetSubscriptionProductsFilter]] = None,
                                  producttype: Optional[str] = None,
                                  subscription_id: Optional[str] = None,
                                  tenancy_id: Optional[str] = None,
                                  usage_period_key: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetSubscriptionProductsResult
    def get_subscription_products_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[_usageproxy.GetSubscriptionProductsFilterArgs]]]] = None,
                                  producttype: Optional[pulumi.Input[str]] = None,
                                  subscription_id: Optional[pulumi.Input[str]] = None,
                                  tenancy_id: Optional[pulumi.Input[str]] = None,
                                  usage_period_key: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetSubscriptionProductsResult]
    func GetSubscriptionProducts(ctx *Context, args *GetSubscriptionProductsArgs, opts ...InvokeOption) (*GetSubscriptionProductsResult, error)
    func GetSubscriptionProductsOutput(ctx *Context, args *GetSubscriptionProductsOutputArgs, opts ...InvokeOption) GetSubscriptionProductsResultOutput

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

    public static class GetSubscriptionProducts 
    {
        public static Task<GetSubscriptionProductsResult> InvokeAsync(GetSubscriptionProductsArgs args, InvokeOptions? opts = null)
        public static Output<GetSubscriptionProductsResult> Invoke(GetSubscriptionProductsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSubscriptionProductsResult> getSubscriptionProducts(GetSubscriptionProductsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:UsageProxy/getSubscriptionProducts:getSubscriptionProducts
      arguments:
        # arguments dictionary

    The following arguments are supported:

    SubscriptionId string
    The subscription ID for which rewards information is requested for.
    TenancyId string
    The OCID of the tenancy.
    UsagePeriodKey string
    The SPM Identifier for the usage period.
    Filters List<GetSubscriptionProductsFilter>
    Producttype string
    The field to specify the type of product.
    SubscriptionId string
    The subscription ID for which rewards information is requested for.
    TenancyId string
    The OCID of the tenancy.
    UsagePeriodKey string
    The SPM Identifier for the usage period.
    Filters []GetSubscriptionProductsFilter
    Producttype string
    The field to specify the type of product.
    subscriptionId String
    The subscription ID for which rewards information is requested for.
    tenancyId String
    The OCID of the tenancy.
    usagePeriodKey String
    The SPM Identifier for the usage period.
    filters List<GetSubscriptionProductsFilter>
    producttype String
    The field to specify the type of product.
    subscriptionId string
    The subscription ID for which rewards information is requested for.
    tenancyId string
    The OCID of the tenancy.
    usagePeriodKey string
    The SPM Identifier for the usage period.
    filters GetSubscriptionProductsFilter[]
    producttype string
    The field to specify the type of product.
    subscription_id str
    The subscription ID for which rewards information is requested for.
    tenancy_id str
    The OCID of the tenancy.
    usage_period_key str
    The SPM Identifier for the usage period.
    filters Sequence[usageproxy.GetSubscriptionProductsFilter]
    producttype str
    The field to specify the type of product.
    subscriptionId String
    The subscription ID for which rewards information is requested for.
    tenancyId String
    The OCID of the tenancy.
    usagePeriodKey String
    The SPM Identifier for the usage period.
    filters List<Property Map>
    producttype String
    The field to specify the type of product.

    getSubscriptionProducts Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    ProductCollections List<GetSubscriptionProductsProductCollection>
    The list of product_collection.
    SubscriptionId string
    TenancyId string
    UsagePeriodKey string
    Filters List<GetSubscriptionProductsFilter>
    Producttype string
    Id string
    The provider-assigned unique ID for this managed resource.
    ProductCollections []GetSubscriptionProductsProductCollection
    The list of product_collection.
    SubscriptionId string
    TenancyId string
    UsagePeriodKey string
    Filters []GetSubscriptionProductsFilter
    Producttype string
    id String
    The provider-assigned unique ID for this managed resource.
    productCollections List<GetSubscriptionProductsProductCollection>
    The list of product_collection.
    subscriptionId String
    tenancyId String
    usagePeriodKey String
    filters List<GetSubscriptionProductsFilter>
    producttype String
    id string
    The provider-assigned unique ID for this managed resource.
    productCollections GetSubscriptionProductsProductCollection[]
    The list of product_collection.
    subscriptionId string
    tenancyId string
    usagePeriodKey string
    filters GetSubscriptionProductsFilter[]
    producttype string
    id String
    The provider-assigned unique ID for this managed resource.
    productCollections List<Property Map>
    The list of product_collection.
    subscriptionId String
    tenancyId String
    usagePeriodKey String
    filters List<Property Map>
    producttype String

    Supporting Types

    GetSubscriptionProductsFilter

    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

    GetSubscriptionProductsProductCollection

    Items List<GetSubscriptionProductsProductCollectionItem>
    The list of product rewards summaries.
    Items []GetSubscriptionProductsProductCollectionItem
    The list of product rewards summaries.
    items List<GetSubscriptionProductsProductCollectionItem>
    The list of product rewards summaries.
    items GetSubscriptionProductsProductCollectionItem[]
    The list of product rewards summaries.
    items List<Property Map>
    The list of product rewards summaries.

    GetSubscriptionProductsProductCollectionItem

    Items []GetSubscriptionProductsProductCollectionItemItem
    The list of product rewards summaries.
    items GetSubscriptionProductsProductCollectionItemItem[]
    The list of product rewards summaries.
    items List<Property Map>
    The list of product rewards summaries.

    GetSubscriptionProductsProductCollectionItemItem

    EarnedRewards double
    The earned rewards for the product.
    IsEligibleToEarnRewards bool
    The boolean parameter to indicate if the product is eligible to earn rewards.
    ProductName string
    The rate card product name.
    ProductNumber string
    The rate card product number.
    UsageAmount double
    The rate card product usage amount.
    EarnedRewards float64
    The earned rewards for the product.
    IsEligibleToEarnRewards bool
    The boolean parameter to indicate if the product is eligible to earn rewards.
    ProductName string
    The rate card product name.
    ProductNumber string
    The rate card product number.
    UsageAmount float64
    The rate card product usage amount.
    earnedRewards Double
    The earned rewards for the product.
    isEligibleToEarnRewards Boolean
    The boolean parameter to indicate if the product is eligible to earn rewards.
    productName String
    The rate card product name.
    productNumber String
    The rate card product number.
    usageAmount Double
    The rate card product usage amount.
    earnedRewards number
    The earned rewards for the product.
    isEligibleToEarnRewards boolean
    The boolean parameter to indicate if the product is eligible to earn rewards.
    productName string
    The rate card product name.
    productNumber string
    The rate card product number.
    usageAmount number
    The rate card product usage amount.
    earned_rewards float
    The earned rewards for the product.
    is_eligible_to_earn_rewards bool
    The boolean parameter to indicate if the product is eligible to earn rewards.
    product_name str
    The rate card product name.
    product_number str
    The rate card product number.
    usage_amount float
    The rate card product usage amount.
    earnedRewards Number
    The earned rewards for the product.
    isEligibleToEarnRewards Boolean
    The boolean parameter to indicate if the product is eligible to earn rewards.
    productName String
    The rate card product name.
    productNumber String
    The rate card product number.
    usageAmount Number
    The rate card product usage amount.

    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 v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi