1. Packages
  2. Alicloud Provider
  3. API Docs
  4. mhub
  5. getApps
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.mhub.getApps

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    This data source provides the Mhub Apps of the current Alibaba Cloud user.

    NOTE: Available in v1.138.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "example_value";
    const _default = new alicloud.mhub.App("default", {
        appName: name,
        productId: defaultAlicloudMhubProduct.id,
        packageName: "com.test.android",
        type: "2",
    });
    const ids = alicloud.mhub.getApps({});
    export const mhubAppId1 = ids.then(ids => ids.apps?.[0]?.id);
    const nameRegex = alicloud.mhub.getApps({
        nameRegex: "^my-App",
    });
    export const mhubAppId2 = nameRegex.then(nameRegex => nameRegex.apps?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "example_value"
    default = alicloud.mhub.App("default",
        app_name=name,
        product_id=default_alicloud_mhub_product["id"],
        package_name="com.test.android",
        type="2")
    ids = alicloud.mhub.get_apps()
    pulumi.export("mhubAppId1", ids.apps[0].id)
    name_regex = alicloud.mhub.get_apps(name_regex="^my-App")
    pulumi.export("mhubAppId2", name_regex.apps[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/mhub"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "example_value"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_, err := mhub.NewApp(ctx, "default", &mhub.AppArgs{
    			AppName:     pulumi.String(name),
    			ProductId:   pulumi.Any(defaultAlicloudMhubProduct.Id),
    			PackageName: pulumi.String("com.test.android"),
    			Type:        pulumi.String("2"),
    		})
    		if err != nil {
    			return err
    		}
    		ids, err := mhub.GetApps(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("mhubAppId1", ids.Apps[0].Id)
    		nameRegex, err := mhub.GetApps(ctx, &mhub.GetAppsArgs{
    			NameRegex: pulumi.StringRef("^my-App"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("mhubAppId2", nameRegex.Apps[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "example_value";
        var @default = new AliCloud.Mhub.App("default", new()
        {
            AppName = name,
            ProductId = defaultAlicloudMhubProduct.Id,
            PackageName = "com.test.android",
            Type = "2",
        });
    
        var ids = AliCloud.Mhub.GetApps.Invoke();
    
        var nameRegex = AliCloud.Mhub.GetApps.Invoke(new()
        {
            NameRegex = "^my-App",
        });
    
        return new Dictionary<string, object?>
        {
            ["mhubAppId1"] = ids.Apply(getAppsResult => getAppsResult.Apps[0]?.Id),
            ["mhubAppId2"] = nameRegex.Apply(getAppsResult => getAppsResult.Apps[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.mhub.App;
    import com.pulumi.alicloud.mhub.AppArgs;
    import com.pulumi.alicloud.mhub.MhubFunctions;
    import com.pulumi.alicloud.mhub.inputs.GetAppsArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("example_value");
            var default_ = new App("default", AppArgs.builder()
                .appName(name)
                .productId(defaultAlicloudMhubProduct.id())
                .packageName("com.test.android")
                .type("2")
                .build());
    
            final var ids = MhubFunctions.getApps();
    
            ctx.export("mhubAppId1", ids.applyValue(getAppsResult -> getAppsResult.apps()[0].id()));
            final var nameRegex = MhubFunctions.getApps(GetAppsArgs.builder()
                .nameRegex("^my-App")
                .build());
    
            ctx.export("mhubAppId2", nameRegex.applyValue(getAppsResult -> getAppsResult.apps()[0].id()));
        }
    }
    
    configuration:
      name:
        type: string
        default: example_value
    resources:
      default:
        type: alicloud:mhub:App
        properties:
          appName: ${name}
          productId: ${defaultAlicloudMhubProduct.id}
          packageName: com.test.android
          type: '2'
    variables:
      ids:
        fn::invoke:
          Function: alicloud:mhub:getApps
          Arguments: {}
      nameRegex:
        fn::invoke:
          Function: alicloud:mhub:getApps
          Arguments:
            nameRegex: ^my-App
    outputs:
      mhubAppId1: ${ids.apps[0].id}
      mhubAppId2: ${nameRegex.apps[0].id}
    

    Using getApps

    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 getApps(args: GetAppsArgs, opts?: InvokeOptions): Promise<GetAppsResult>
    function getAppsOutput(args: GetAppsOutputArgs, opts?: InvokeOptions): Output<GetAppsResult>
    def get_apps(enable_details: Optional[bool] = None,
                 ids: Optional[Sequence[str]] = None,
                 name_regex: Optional[str] = None,
                 os_type: Optional[str] = None,
                 output_file: Optional[str] = None,
                 product_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetAppsResult
    def get_apps_output(enable_details: Optional[pulumi.Input[bool]] = None,
                 ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 name_regex: Optional[pulumi.Input[str]] = None,
                 os_type: Optional[pulumi.Input[str]] = None,
                 output_file: Optional[pulumi.Input[str]] = None,
                 product_id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetAppsResult]
    func GetApps(ctx *Context, args *GetAppsArgs, opts ...InvokeOption) (*GetAppsResult, error)
    func GetAppsOutput(ctx *Context, args *GetAppsOutputArgs, opts ...InvokeOption) GetAppsResultOutput

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

    public static class GetApps 
    {
        public static Task<GetAppsResult> InvokeAsync(GetAppsArgs args, InvokeOptions? opts = null)
        public static Output<GetAppsResult> Invoke(GetAppsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAppsResult> getApps(GetAppsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:mhub/getApps:getApps
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ProductId string
    The ID of the Product.
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids List<string>
    A list of App IDs. The value formats as <product_id>:<app_key>
    NameRegex string
    A regex string to filter results by App name.
    OsType string
    The os type. Valid values: Android and iOS.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ProductId string
    The ID of the Product.
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids []string
    A list of App IDs. The value formats as <product_id>:<app_key>
    NameRegex string
    A regex string to filter results by App name.
    OsType string
    The os type. Valid values: Android and iOS.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    productId String
    The ID of the Product.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of App IDs. The value formats as <product_id>:<app_key>
    nameRegex String
    A regex string to filter results by App name.
    osType String
    The os type. Valid values: Android and iOS.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    productId string
    The ID of the Product.
    enableDetails boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids string[]
    A list of App IDs. The value formats as <product_id>:<app_key>
    nameRegex string
    A regex string to filter results by App name.
    osType string
    The os type. Valid values: Android and iOS.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    product_id str
    The ID of the Product.
    enable_details bool
    Default to false. Set it to true can output more details about resource attributes.
    ids Sequence[str]
    A list of App IDs. The value formats as <product_id>:<app_key>
    name_regex str
    A regex string to filter results by App name.
    os_type str
    The os type. Valid values: Android and iOS.
    output_file str
    File name where to save data source results (after running pulumi preview).
    productId String
    The ID of the Product.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of App IDs. The value formats as <product_id>:<app_key>
    nameRegex String
    A regex string to filter results by App name.
    osType String
    The os type. Valid values: Android and iOS.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getApps Result

    The following output properties are available:

    Apps List<Pulumi.AliCloud.Mhub.Outputs.GetAppsApp>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    ProductId string
    EnableDetails bool
    NameRegex string
    OsType string
    OutputFile string
    Apps []GetAppsApp
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    ProductId string
    EnableDetails bool
    NameRegex string
    OsType string
    OutputFile string
    apps List<GetAppsApp>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    productId String
    enableDetails Boolean
    nameRegex String
    osType String
    outputFile String
    apps GetAppsApp[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    productId string
    enableDetails boolean
    nameRegex string
    osType string
    outputFile string
    apps Sequence[GetAppsApp]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    product_id str
    enable_details bool
    name_regex str
    os_type str
    output_file str
    apps List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    productId String
    enableDetails Boolean
    nameRegex String
    osType String
    outputFile String

    Supporting Types

    GetAppsApp

    AppKey string
    Application AppKey, which uniquely identifies an application when requested by the interface
    AppName string
    The Name of the App.
    BundleId string
    iOS application ID. Required when creating an iOS app. NOTE: Either bundle_id or package_name must be set.
    CreateTime string
    The CreateTime of the App.
    EncodedIcon string
    Base64 string of picture.
    Id string
    The ID of the App.
    IndustryId string
    The Industry ID of the app. For information about Industry and how to use it, MHUBIndustry.
    PackageName string
    Android App package name. NOTE: Either bundle_id or package_name must be set.
    ProductId string
    The ID of the Product.
    Type string
    The type of the App. Valid values: Android and iOS.
    AppKey string
    Application AppKey, which uniquely identifies an application when requested by the interface
    AppName string
    The Name of the App.
    BundleId string
    iOS application ID. Required when creating an iOS app. NOTE: Either bundle_id or package_name must be set.
    CreateTime string
    The CreateTime of the App.
    EncodedIcon string
    Base64 string of picture.
    Id string
    The ID of the App.
    IndustryId string
    The Industry ID of the app. For information about Industry and how to use it, MHUBIndustry.
    PackageName string
    Android App package name. NOTE: Either bundle_id or package_name must be set.
    ProductId string
    The ID of the Product.
    Type string
    The type of the App. Valid values: Android and iOS.
    appKey String
    Application AppKey, which uniquely identifies an application when requested by the interface
    appName String
    The Name of the App.
    bundleId String
    iOS application ID. Required when creating an iOS app. NOTE: Either bundle_id or package_name must be set.
    createTime String
    The CreateTime of the App.
    encodedIcon String
    Base64 string of picture.
    id String
    The ID of the App.
    industryId String
    The Industry ID of the app. For information about Industry and how to use it, MHUBIndustry.
    packageName String
    Android App package name. NOTE: Either bundle_id or package_name must be set.
    productId String
    The ID of the Product.
    type String
    The type of the App. Valid values: Android and iOS.
    appKey string
    Application AppKey, which uniquely identifies an application when requested by the interface
    appName string
    The Name of the App.
    bundleId string
    iOS application ID. Required when creating an iOS app. NOTE: Either bundle_id or package_name must be set.
    createTime string
    The CreateTime of the App.
    encodedIcon string
    Base64 string of picture.
    id string
    The ID of the App.
    industryId string
    The Industry ID of the app. For information about Industry and how to use it, MHUBIndustry.
    packageName string
    Android App package name. NOTE: Either bundle_id or package_name must be set.
    productId string
    The ID of the Product.
    type string
    The type of the App. Valid values: Android and iOS.
    app_key str
    Application AppKey, which uniquely identifies an application when requested by the interface
    app_name str
    The Name of the App.
    bundle_id str
    iOS application ID. Required when creating an iOS app. NOTE: Either bundle_id or package_name must be set.
    create_time str
    The CreateTime of the App.
    encoded_icon str
    Base64 string of picture.
    id str
    The ID of the App.
    industry_id str
    The Industry ID of the app. For information about Industry and how to use it, MHUBIndustry.
    package_name str
    Android App package name. NOTE: Either bundle_id or package_name must be set.
    product_id str
    The ID of the Product.
    type str
    The type of the App. Valid values: Android and iOS.
    appKey String
    Application AppKey, which uniquely identifies an application when requested by the interface
    appName String
    The Name of the App.
    bundleId String
    iOS application ID. Required when creating an iOS app. NOTE: Either bundle_id or package_name must be set.
    createTime String
    The CreateTime of the App.
    encodedIcon String
    Base64 string of picture.
    id String
    The ID of the App.
    industryId String
    The Industry ID of the app. For information about Industry and how to use it, MHUBIndustry.
    packageName String
    Android App package name. NOTE: Either bundle_id or package_name must be set.
    productId String
    The ID of the Product.
    type String
    The type of the App. Valid values: Android and iOS.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi