1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cms
  5. getNamespaces
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.cms.getNamespaces

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

This data source provides the Cms Namespaces of the current Alibaba Cloud user.

NOTE: Available in v1.171.0+.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.cms.getNamespaces({
    ids: ["example_id"],
});
export const cmsNamespaceId1 = ids.then(ids => ids.namespaces?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.cms.get_namespaces(ids=["example_id"])
pulumi.export("cmsNamespaceId1", ids.namespaces[0].id)
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := cms.GetNamespaces(ctx, &cms.GetNamespacesArgs{
			Ids: []string{
				"example_id",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("cmsNamespaceId1", ids.Namespaces[0].Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var ids = AliCloud.Cms.GetNamespaces.Invoke(new()
    {
        Ids = new[]
        {
            "example_id",
        },
    });

    return new Dictionary<string, object?>
    {
        ["cmsNamespaceId1"] = ids.Apply(getNamespacesResult => getNamespacesResult.Namespaces[0]?.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cms.CmsFunctions;
import com.pulumi.alicloud.cms.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 = CmsFunctions.getNamespaces(GetNamespacesArgs.builder()
            .ids("example_id")
            .build());

        ctx.export("cmsNamespaceId1", ids.applyValue(getNamespacesResult -> getNamespacesResult.namespaces()[0].id()));
    }
}
Copy
variables:
  ids:
    fn::invoke:
      function: alicloud:cms:getNamespaces
      arguments:
        ids:
          - example_id
outputs:
  cmsNamespaceId1: ${ids.namespaces[0].id}
Copy

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>
Copy
def get_namespaces(ids: Optional[Sequence[str]] = None,
                   keyword: Optional[str] = None,
                   output_file: Optional[str] = None,
                   page_number: Optional[int] = None,
                   page_size: Optional[int] = None,
                   opts: Optional[InvokeOptions] = None) -> GetNamespacesResult
def get_namespaces_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                   keyword: Optional[pulumi.Input[str]] = None,
                   output_file: Optional[pulumi.Input[str]] = None,
                   page_number: Optional[pulumi.Input[int]] = None,
                   page_size: Optional[pulumi.Input[int]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetNamespacesResult]
Copy
func GetNamespaces(ctx *Context, args *GetNamespacesArgs, opts ...InvokeOption) (*GetNamespacesResult, error)
func GetNamespacesOutput(ctx *Context, args *GetNamespacesOutputArgs, opts ...InvokeOption) GetNamespacesResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetNamespacesResult> getNamespaces(GetNamespacesArgs args, InvokeOptions options)
public static Output<GetNamespacesResult> getNamespaces(GetNamespacesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:cms/getNamespaces:getNamespaces
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids Changes to this property will trigger replacement. List<string>
A list of Namespace IDs.
Keyword Changes to this property will trigger replacement. string
The keywords of the namespace or description of the namespace.
OutputFile string
File name where to save data source results (after running pulumi preview).
PageNumber int
PageSize int
Ids Changes to this property will trigger replacement. []string
A list of Namespace IDs.
Keyword Changes to this property will trigger replacement. string
The keywords of the namespace or description of the namespace.
OutputFile string
File name where to save data source results (after running pulumi preview).
PageNumber int
PageSize int
ids Changes to this property will trigger replacement. List<String>
A list of Namespace IDs.
keyword Changes to this property will trigger replacement. String
The keywords of the namespace or description of the namespace.
outputFile String
File name where to save data source results (after running pulumi preview).
pageNumber Integer
pageSize Integer
ids Changes to this property will trigger replacement. string[]
A list of Namespace IDs.
keyword Changes to this property will trigger replacement. string
The keywords of the namespace or description of the namespace.
outputFile string
File name where to save data source results (after running pulumi preview).
pageNumber number
pageSize number
ids Changes to this property will trigger replacement. Sequence[str]
A list of Namespace IDs.
keyword Changes to this property will trigger replacement. str
The keywords of the namespace or description of the namespace.
output_file str
File name where to save data source results (after running pulumi preview).
page_number int
page_size int
ids Changes to this property will trigger replacement. List<String>
A list of Namespace IDs.
keyword Changes to this property will trigger replacement. String
The keywords of the namespace or description of the namespace.
outputFile String
File name where to save data source results (after running pulumi preview).
pageNumber Number
pageSize Number

getNamespaces Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Namespaces List<Pulumi.AliCloud.Cms.Outputs.GetNamespacesNamespace>
Keyword string
OutputFile string
PageNumber int
PageSize int
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Namespaces []GetNamespacesNamespace
Keyword string
OutputFile string
PageNumber int
PageSize int
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
namespaces List<GetNamespacesNamespace>
keyword String
outputFile String
pageNumber Integer
pageSize Integer
id string
The provider-assigned unique ID for this managed resource.
ids string[]
namespaces GetNamespacesNamespace[]
keyword string
outputFile string
pageNumber number
pageSize number
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
namespaces Sequence[GetNamespacesNamespace]
keyword str
output_file str
page_number int
page_size int
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
namespaces List<Property Map>
keyword String
outputFile String
pageNumber Number
pageSize Number

Supporting Types

GetNamespacesNamespace

CreateTime This property is required. string
Create the timestamp of the indicator warehouse.
Description This property is required. string
Description of indicator warehouse.
Id This property is required. string
The ID of the Namespace.
ModifyTime This property is required. string
The timestamp of the last modification indicator warehouse.
Namespace This property is required. string
Indicator warehouse name.
NamespaceId This property is required. string
The ID of the Namespace.
Specification This property is required. string
Data storage duration.
CreateTime This property is required. string
Create the timestamp of the indicator warehouse.
Description This property is required. string
Description of indicator warehouse.
Id This property is required. string
The ID of the Namespace.
ModifyTime This property is required. string
The timestamp of the last modification indicator warehouse.
Namespace This property is required. string
Indicator warehouse name.
NamespaceId This property is required. string
The ID of the Namespace.
Specification This property is required. string
Data storage duration.
createTime This property is required. String
Create the timestamp of the indicator warehouse.
description This property is required. String
Description of indicator warehouse.
id This property is required. String
The ID of the Namespace.
modifyTime This property is required. String
The timestamp of the last modification indicator warehouse.
namespace This property is required. String
Indicator warehouse name.
namespaceId This property is required. String
The ID of the Namespace.
specification This property is required. String
Data storage duration.
createTime This property is required. string
Create the timestamp of the indicator warehouse.
description This property is required. string
Description of indicator warehouse.
id This property is required. string
The ID of the Namespace.
modifyTime This property is required. string
The timestamp of the last modification indicator warehouse.
namespace This property is required. string
Indicator warehouse name.
namespaceId This property is required. string
The ID of the Namespace.
specification This property is required. string
Data storage duration.
create_time This property is required. str
Create the timestamp of the indicator warehouse.
description This property is required. str
Description of indicator warehouse.
id This property is required. str
The ID of the Namespace.
modify_time This property is required. str
The timestamp of the last modification indicator warehouse.
namespace This property is required. str
Indicator warehouse name.
namespace_id This property is required. str
The ID of the Namespace.
specification This property is required. str
Data storage duration.
createTime This property is required. String
Create the timestamp of the indicator warehouse.
description This property is required. String
Description of indicator warehouse.
id This property is required. String
The ID of the Namespace.
modifyTime This property is required. String
The timestamp of the last modification indicator warehouse.
namespace This property is required. String
Indicator warehouse name.
namespaceId This property is required. String
The ID of the Namespace.
specification This property is required. String
Data storage duration.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi