Alibaba Cloud

v3.15.0 published on Thursday, Jan 13, 2022 by Pulumi

getApps

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

NOTE: Available in v1.138.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "example_value";
        var @default = new AliCloud.Mhub.App("default", new AliCloud.Mhub.AppArgs
        {
            AppName = name,
            ProductId = alicloud_mhub_product.Default.Id,
            PackageName = "com.test.android",
            Type = "2",
        });
        var ids = Output.Create(AliCloud.Mhub.GetApps.InvokeAsync());
        this.MhubAppId1 = ids.Apply(ids => ids.Apps?[0]?.Id);
        var nameRegex = Output.Create(AliCloud.Mhub.GetApps.InvokeAsync(new AliCloud.Mhub.GetAppsArgs
        {
            NameRegex = "^my-App",
        }));
        this.MhubAppId2 = nameRegex.Apply(nameRegex => nameRegex.Apps?[0]?.Id);
    }

    [Output("mhubAppId1")]
    public Output<string> MhubAppId1 { get; set; }
    [Output("mhubAppId2")]
    public Output<string> MhubAppId2 { get; set; }
}
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(alicloud_mhub_product.Default.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)
		opt0 := "^my-App"
		nameRegex, err := mhub.GetApps(ctx, &mhub.GetAppsArgs{
			NameRegex: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("mhubAppId2", nameRegex.Apps[0].Id)
		return nil
	})
}
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=alicloud_mhub_product["default"]["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)
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: alicloud_mhub_product["default"].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);

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)
}

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
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
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
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

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 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

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.
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.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.