Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.schedulerx.getNamespaces
Explore with Pulumi AI
This data source provides the Schedulerx Namespaces of the current Alibaba Cloud user.
NOTE: Available in v1.173.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.schedulerx.getNamespaces({});
export const schedulerxNamespaceId1 = ids.then(ids => ids.namespaces?.[0]?.id);
const nameRegex = alicloud.schedulerx.getNamespaces({
nameRegex: "^my-Namespace",
});
export const schedulerxNamespaceId2 = nameRegex.then(nameRegex => nameRegex.namespaces?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.schedulerx.get_namespaces()
pulumi.export("schedulerxNamespaceId1", ids.namespaces[0].id)
name_regex = alicloud.schedulerx.get_namespaces(name_regex="^my-Namespace")
pulumi.export("schedulerxNamespaceId2", name_regex.namespaces[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/schedulerx"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := schedulerx.GetNamespaces(ctx, nil, nil)
if err != nil {
return err
}
ctx.Export("schedulerxNamespaceId1", ids.Namespaces[0].Id)
nameRegex, err := schedulerx.GetNamespaces(ctx, &schedulerx.GetNamespacesArgs{
NameRegex: pulumi.StringRef("^my-Namespace"),
}, nil)
if err != nil {
return err
}
ctx.Export("schedulerxNamespaceId2", nameRegex.Namespaces[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.SchedulerX.GetNamespaces.Invoke();
var nameRegex = AliCloud.SchedulerX.GetNamespaces.Invoke(new()
{
NameRegex = "^my-Namespace",
});
return new Dictionary<string, object?>
{
["schedulerxNamespaceId1"] = ids.Apply(getNamespacesResult => getNamespacesResult.Namespaces[0]?.Id),
["schedulerxNamespaceId2"] = nameRegex.Apply(getNamespacesResult => getNamespacesResult.Namespaces[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.schedulerx.SchedulerxFunctions;
import com.pulumi.alicloud.schedulerx.inputs.GetNamespacesArgs;
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 ids = SchedulerxFunctions.getNamespaces();
ctx.export("schedulerxNamespaceId1", ids.applyValue(getNamespacesResult -> getNamespacesResult.namespaces()[0].id()));
final var nameRegex = SchedulerxFunctions.getNamespaces(GetNamespacesArgs.builder()
.nameRegex("^my-Namespace")
.build());
ctx.export("schedulerxNamespaceId2", nameRegex.applyValue(getNamespacesResult -> getNamespacesResult.namespaces()[0].id()));
}
}
variables:
ids:
fn::invoke:
Function: alicloud:schedulerx:getNamespaces
Arguments: {}
nameRegex:
fn::invoke:
Function: alicloud:schedulerx:getNamespaces
Arguments:
nameRegex: ^my-Namespace
outputs:
schedulerxNamespaceId1: ${ids.namespaces[0].id}
schedulerxNamespaceId2: ${nameRegex.namespaces[0].id}
Using getNamespaces
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 getNamespaces(args: GetNamespacesArgs, opts?: InvokeOptions): Promise<GetNamespacesResult>
function getNamespacesOutput(args: GetNamespacesOutputArgs, opts?: InvokeOptions): Output<GetNamespacesResult>
def get_namespaces(ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetNamespacesResult
def get_namespaces_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNamespacesResult]
func GetNamespaces(ctx *Context, args *GetNamespacesArgs, opts ...InvokeOption) (*GetNamespacesResult, error)
func GetNamespacesOutput(ctx *Context, args *GetNamespacesOutputArgs, opts ...InvokeOption) GetNamespacesResultOutput
> Note: This function is named GetNamespaces
in the Go SDK.
public static class GetNamespaces
{
public static Task<GetNamespacesResult> InvokeAsync(GetNamespacesArgs args, InvokeOptions? opts = null)
public static Output<GetNamespacesResult> Invoke(GetNamespacesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNamespacesResult> getNamespaces(GetNamespacesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:schedulerx/getNamespaces:getNamespaces
arguments:
# arguments dictionary
The following arguments are supported:
- Ids List<string>
- A list of Namespace IDs.
- Name
Regex string - A regex string to filter results by Namespace name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Ids []string
- A list of Namespace IDs.
- Name
Regex string - A regex string to filter results by Namespace name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- ids List<String>
- A list of Namespace IDs.
- name
Regex String - A regex string to filter results by Namespace name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- ids string[]
- A list of Namespace IDs.
- name
Regex string - A regex string to filter results by Namespace name.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- ids Sequence[str]
- A list of Namespace IDs.
- name_
regex str - A regex string to filter results by Namespace name.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- ids List<String>
- A list of Namespace IDs.
- name
Regex String - A regex string to filter results by Namespace name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getNamespaces Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Namespaces
List<Pulumi.
Ali Cloud. Scheduler X. Outputs. Get Namespaces Namespace> - Name
Regex string - Output
File string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Namespaces
[]Get
Namespaces Namespace - Name
Regex string - Output
File string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- namespaces
List<Get
Namespaces Namespace> - name
Regex String - output
File String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- namespaces
Get
Namespaces Namespace[] - name
Regex string - output
File string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- namespaces
Sequence[Get
Namespaces Namespace] - name_
regex str - output_
file str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- namespaces List<Property Map>
- name
Regex String - output
File String
Supporting Types
GetNamespacesNamespace
- Description string
- The description of the resource.
- Id string
- The ID of the resource.
- Namespace
Id string - The ID of the Namespace.
- Namespace
Name string - The name of the resource.
- Description string
- The description of the resource.
- Id string
- The ID of the resource.
- Namespace
Id string - The ID of the Namespace.
- Namespace
Name string - The name of the resource.
- description String
- The description of the resource.
- id String
- The ID of the resource.
- namespace
Id String - The ID of the Namespace.
- namespace
Name String - The name of the resource.
- description string
- The description of the resource.
- id string
- The ID of the resource.
- namespace
Id string - The ID of the Namespace.
- namespace
Name string - The name of the resource.
- description str
- The description of the resource.
- id str
- The ID of the resource.
- namespace_
id str - The ID of the Namespace.
- namespace_
name str - The name of the resource.
- description String
- The description of the resource.
- id String
- The ID of the resource.
- namespace
Id String - The ID of the Namespace.
- namespace
Name String - The name of the resource.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.