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

oci.UsageProxy.getSubscriptionProduct

Explore with Pulumi AI

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

    This data source provides details about a specific Subscription Product resource 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 testSubscriptionProduct = oci.UsageProxy.getSubscriptionProduct({
        subscriptionId: testSubscription.id,
        tenancyId: testTenancy.id,
        usagePeriodKey: subscriptionProductUsagePeriodKey,
        producttype: subscriptionProductProducttype,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_subscription_product = oci.UsageProxy.get_subscription_product(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/v2/go/oci/UsageProxy"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := UsageProxy.GetSubscriptionProduct(ctx, &usageproxy.GetSubscriptionProductArgs{
    			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 testSubscriptionProduct = Oci.UsageProxy.GetSubscriptionProduct.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.GetSubscriptionProductArgs;
    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 testSubscriptionProduct = UsageProxyFunctions.getSubscriptionProduct(GetSubscriptionProductArgs.builder()
                .subscriptionId(testSubscription.id())
                .tenancyId(testTenancy.id())
                .usagePeriodKey(subscriptionProductUsagePeriodKey)
                .producttype(subscriptionProductProducttype)
                .build());
    
        }
    }
    
    variables:
      testSubscriptionProduct:
        fn::invoke:
          Function: oci:UsageProxy:getSubscriptionProduct
          Arguments:
            subscriptionId: ${testSubscription.id}
            tenancyId: ${testTenancy.id}
            usagePeriodKey: ${subscriptionProductUsagePeriodKey}
            producttype: ${subscriptionProductProducttype}
    

    Using getSubscriptionProduct

    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 getSubscriptionProduct(args: GetSubscriptionProductArgs, opts?: InvokeOptions): Promise<GetSubscriptionProductResult>
    function getSubscriptionProductOutput(args: GetSubscriptionProductOutputArgs, opts?: InvokeOptions): Output<GetSubscriptionProductResult>
    def get_subscription_product(producttype: Optional[str] = None,
                                 subscription_id: Optional[str] = None,
                                 tenancy_id: Optional[str] = None,
                                 usage_period_key: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetSubscriptionProductResult
    def get_subscription_product_output(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[GetSubscriptionProductResult]
    func GetSubscriptionProduct(ctx *Context, args *GetSubscriptionProductArgs, opts ...InvokeOption) (*GetSubscriptionProductResult, error)
    func GetSubscriptionProductOutput(ctx *Context, args *GetSubscriptionProductOutputArgs, opts ...InvokeOption) GetSubscriptionProductResultOutput

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

    public static class GetSubscriptionProduct 
    {
        public static Task<GetSubscriptionProductResult> InvokeAsync(GetSubscriptionProductArgs args, InvokeOptions? opts = null)
        public static Output<GetSubscriptionProductResult> Invoke(GetSubscriptionProductInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSubscriptionProductResult> getSubscriptionProduct(GetSubscriptionProductArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:UsageProxy/getSubscriptionProduct:getSubscriptionProduct
      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.
    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.
    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.
    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.
    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.
    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.
    producttype String
    The field to specify the type of product.

    getSubscriptionProduct Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Items List<GetSubscriptionProductItem>
    The list of product rewards summaries.
    SubscriptionId string
    TenancyId string
    UsagePeriodKey string
    Producttype string
    Id string
    The provider-assigned unique ID for this managed resource.
    Items []GetSubscriptionProductItem
    The list of product rewards summaries.
    SubscriptionId string
    TenancyId string
    UsagePeriodKey string
    Producttype string
    id String
    The provider-assigned unique ID for this managed resource.
    items List<GetSubscriptionProductItem>
    The list of product rewards summaries.
    subscriptionId String
    tenancyId String
    usagePeriodKey String
    producttype String
    id string
    The provider-assigned unique ID for this managed resource.
    items GetSubscriptionProductItem[]
    The list of product rewards summaries.
    subscriptionId string
    tenancyId string
    usagePeriodKey string
    producttype string
    id str
    The provider-assigned unique ID for this managed resource.
    items Sequence[usageproxy.GetSubscriptionProductItem]
    The list of product rewards summaries.
    subscription_id str
    tenancy_id str
    usage_period_key str
    producttype str
    id String
    The provider-assigned unique ID for this managed resource.
    items List<Property Map>
    The list of product rewards summaries.
    subscriptionId String
    tenancyId String
    usagePeriodKey String
    producttype String

    Supporting Types

    GetSubscriptionProductItem

    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 v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi