1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cr
  5. getNamespaces
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.cr.getNamespaces

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    This data source provides a list Container Registry namespaces on Alibaba Cloud.

    NOTE: Available in v1.35.0+

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    // Declare the data source
    const myNamespaces = alicloud.cr.getNamespaces({
        nameRegex: "my-namespace",
        outputFile: "my-namespace-json",
    });
    export const output = myNamespaces.then(myNamespaces => myNamespaces.namespaces);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    # Declare the data source
    my_namespaces = alicloud.cr.get_namespaces(name_regex="my-namespace",
        output_file="my-namespace-json")
    pulumi.export("output", my_namespaces.namespaces)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Declare the data source
    		myNamespaces, err := cr.GetNamespaces(ctx, &cr.GetNamespacesArgs{
    			NameRegex:  pulumi.StringRef("my-namespace"),
    			OutputFile: pulumi.StringRef("my-namespace-json"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("output", myNamespaces.Namespaces)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        // Declare the data source
        var myNamespaces = AliCloud.CR.GetNamespaces.Invoke(new()
        {
            NameRegex = "my-namespace",
            OutputFile = "my-namespace-json",
        });
    
        return new Dictionary<string, object?>
        {
            ["output"] = myNamespaces.Apply(getNamespacesResult => getNamespacesResult.Namespaces),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cr.CrFunctions;
    import com.pulumi.alicloud.cr.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) {
            // Declare the data source
            final var myNamespaces = CrFunctions.getNamespaces(GetNamespacesArgs.builder()
                .nameRegex("my-namespace")
                .outputFile("my-namespace-json")
                .build());
    
            ctx.export("output", myNamespaces.applyValue(getNamespacesResult -> getNamespacesResult.namespaces()));
        }
    }
    
    variables:
      # Declare the data source
      myNamespaces:
        fn::invoke:
          Function: alicloud:cr:getNamespaces
          Arguments:
            nameRegex: my-namespace
            outputFile: my-namespace-json
    outputs:
      output: ${myNamespaces.namespaces}
    

    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(name_regex: Optional[str] = None,
                       output_file: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetNamespacesResult
    def get_namespaces_output(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:cr/getNamespaces:getNamespaces
      arguments:
        # arguments dictionary

    The following arguments are supported:

    NameRegex string
    A regex string to filter results by namespace name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    NameRegex string
    A regex string to filter results by namespace name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    nameRegex String
    A regex string to filter results by namespace name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    nameRegex string
    A regex string to filter results by namespace name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    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).
    nameRegex String
    A regex string to filter results by namespace name.
    outputFile 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>
    A list of matched Container Registry namespaces. Its element is a namespace name.
    Names List<string>
    A list of namespace names.
    Namespaces List<Pulumi.AliCloud.CR.Outputs.GetNamespacesNamespace>
    A list of matched Container Registry namespaces. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of matched Container Registry namespaces. Its element is a namespace name.
    Names []string
    A list of namespace names.
    Namespaces []GetNamespacesNamespace
    A list of matched Container Registry namespaces. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of matched Container Registry namespaces. Its element is a namespace name.
    names List<String>
    A list of namespace names.
    namespaces List<GetNamespacesNamespace>
    A list of matched Container Registry namespaces. Each element contains the following attributes:
    nameRegex String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of matched Container Registry namespaces. Its element is a namespace name.
    names string[]
    A list of namespace names.
    namespaces GetNamespacesNamespace[]
    A list of matched Container Registry namespaces. Each element contains the following attributes:
    nameRegex string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of matched Container Registry namespaces. Its element is a namespace name.
    names Sequence[str]
    A list of namespace names.
    namespaces Sequence[GetNamespacesNamespace]
    A list of matched Container Registry namespaces. Each element contains the following attributes:
    name_regex str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of matched Container Registry namespaces. Its element is a namespace name.
    names List<String>
    A list of namespace names.
    namespaces List<Property Map>
    A list of matched Container Registry namespaces. Each element contains the following attributes:
    nameRegex String
    outputFile String

    Supporting Types

    GetNamespacesNamespace

    AutoCreate bool
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    DefaultVisibility string
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    Name string
    Name of Container Registry namespace.
    AutoCreate bool
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    DefaultVisibility string
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    Name string
    Name of Container Registry namespace.
    autoCreate Boolean
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    defaultVisibility String
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    name String
    Name of Container Registry namespace.
    autoCreate boolean
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    defaultVisibility string
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    name string
    Name of Container Registry namespace.
    auto_create bool
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    default_visibility str
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    name str
    Name of Container Registry namespace.
    autoCreate Boolean
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    defaultVisibility String
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    name String
    Name of Container Registry namespace.

    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.57.1 published on Wednesday, Jun 26, 2024 by Pulumi