Class Namespace


  • public class Namespace
    extends com.pulumi.resources.CustomResource
    Namespace represents a namespace across the Fleet. To get more information about Namespace, see: * [API documentation](https://cloud.google.com/anthos/fleet-management/docs/reference/rest/v1/projects.locations.scopes.namespaces) * How-to Guides * [Registering a Cluster](https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster#register_cluster) ## Example Usage ### Gkehub Namespace Basic <!--Start PulumiCodeChooser --> ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.gkehub.Scope; import com.pulumi.gcp.gkehub.ScopeArgs; import com.pulumi.gcp.gkehub.Namespace; import com.pulumi.gcp.gkehub.NamespaceArgs; 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) { var scope = new Scope("scope", ScopeArgs.builder() .scopeId("tf-test-scope_8493") .build()); var namespace = new Namespace("namespace", NamespaceArgs.builder() .scopeNamespaceId("tf-test-namespace_9106") .scopeId(scope.scopeId()) .scope(scope.name()) .namespaceLabels(Map.ofEntries( Map.entry("keyb", "valueb"), Map.entry("keya", "valuea"), Map.entry("keyc", "valuec") )) .labels(Map.ofEntries( Map.entry("keyb", "valueb"), Map.entry("keya", "valuea"), Map.entry("keyc", "valuec") )) .build()); } } ``` <!--End PulumiCodeChooser --> ## Import Namespace can be imported using any of these accepted formats: * `projects/{{project}}/locations/global/scopes/{{scope_id}}/namespaces/{{scope_namespace_id}}` * `{{project}}/{{scope_id}}/{{scope_namespace_id}}` * `{{scope_id}}/{{scope_namespace_id}}` When using the `pulumi import` command, Namespace can be imported using one of the formats above. For example: ```sh $ pulumi import gcp:gkehub/namespace:Namespace default projects/{{project}}/locations/global/scopes/{{scope_id}}/namespaces/{{scope_namespace_id}} ``` ```sh $ pulumi import gcp:gkehub/namespace:Namespace default {{project}}/{{scope_id}}/{{scope_namespace_id}} ``` ```sh $ pulumi import gcp:gkehub/namespace:Namespace default {{scope_id}}/{{scope_namespace_id}} ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Namespace​(java.lang.String name)  
      Namespace​(java.lang.String name, NamespaceArgs args)  
      Namespace​(java.lang.String name, NamespaceArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> createTime()  
      com.pulumi.core.Output<java.lang.String> deleteTime()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> effectiveLabels()  
      static Namespace get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, NamespaceState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> labels()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> namespaceLabels()  
      com.pulumi.core.Output<java.lang.String> project()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> pulumiLabels()  
      com.pulumi.core.Output<java.lang.String> scope()  
      com.pulumi.core.Output<java.lang.String> scopeId()  
      com.pulumi.core.Output<java.lang.String> scopeNamespaceId()  
      com.pulumi.core.Output<java.util.List<NamespaceState>> states()  
      com.pulumi.core.Output<java.lang.String> uid()  
      com.pulumi.core.Output<java.lang.String> updateTime()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Namespace

        public Namespace​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Namespace

        public Namespace​(java.lang.String name,
                         NamespaceArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Namespace

        public Namespace​(java.lang.String name,
                         NamespaceArgs args,
                         @Nullable
                         com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • createTime

        public com.pulumi.core.Output<java.lang.String> createTime()
        Returns:
        Time the Namespace was created in UTC.
      • deleteTime

        public com.pulumi.core.Output<java.lang.String> deleteTime()
        Returns:
        Time the Namespace was deleted in UTC.
      • effectiveLabels

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> effectiveLabels()
        Returns:
        All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
      • labels

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> labels()
        Returns:
        Labels for this Namespace. **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field `effective_labels` for all of the labels present on the resource.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The resource name for the namespace
      • namespaceLabels

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> namespaceLabels()
        Returns:
        Namespace-level cluster namespace labels. These labels are applied to the related namespace of the member clusters bound to the parent Scope. Scope-level labels (`namespace_labels` in the Fleet Scope resource) take precedence over Namespace-level labels if they share a key. Keys and values must be Kubernetes-conformant.
      • project

        public com.pulumi.core.Output<java.lang.String> project()
        Returns:
        The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
      • pulumiLabels

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> pulumiLabels()
        Returns:
        The combination of labels configured directly on the resource and default labels configured on the provider.
      • scope

        public com.pulumi.core.Output<java.lang.String> scope()
        Returns:
        The name of the Scope instance.
      • scopeId

        public com.pulumi.core.Output<java.lang.String> scopeId()
        Returns:
        Id of the scope ***
      • scopeNamespaceId

        public com.pulumi.core.Output<java.lang.String> scopeNamespaceId()
        Returns:
        The client-provided identifier of the namespace.
      • states

        public com.pulumi.core.Output<java.util.List<NamespaceState>> states()
        Returns:
        State of the namespace resource. Structure is documented below.
      • uid

        public com.pulumi.core.Output<java.lang.String> uid()
        Returns:
        Google-generated UUID for this resource.
      • updateTime

        public com.pulumi.core.Output<java.lang.String> updateTime()
        Returns:
        Time the Namespace was updated in UTC.
      • get

        public static Namespace get​(java.lang.String name,
                                    com.pulumi.core.Output<java.lang.String> id,
                                    @Nullable
                                    NamespaceState state,
                                    @Nullable
                                    com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.