1. Packages
  2. Spectrocloud Provider
  3. API Docs
  4. getProject
spectrocloud 0.23.5 published on Sunday, Apr 20, 2025 by spectrocloud

spectrocloud.getProject

Explore with Pulumi AI

spectrocloud logo
spectrocloud 0.23.5 published on Sunday, Apr 20, 2025 by spectrocloud

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as spectrocloud from "@pulumi/spectrocloud";
    
    const example = spectrocloud.getProject({
        id: "project-12345",
    });
    export const projectInfo = {
        id: example.then(example => example.id),
        name: example.then(example => example.name),
    };
    
    import pulumi
    import pulumi_spectrocloud as spectrocloud
    
    example = spectrocloud.get_project(id="project-12345")
    pulumi.export("projectInfo", {
        "id": example.id,
        "name": example.name,
    })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/spectrocloud/spectrocloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := spectrocloud.LookupProject(ctx, &spectrocloud.LookupProjectArgs{
    			Id: pulumi.StringRef("project-12345"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("projectInfo", pulumi.StringMap{
    			"id":   example.Id,
    			"name": example.Name,
    		})
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Spectrocloud = Pulumi.Spectrocloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Spectrocloud.GetProject.Invoke(new()
        {
            Id = "project-12345",
        });
    
        return new Dictionary<string, object?>
        {
            ["projectInfo"] = 
            {
                { "id", example.Apply(getProjectResult => getProjectResult.Id) },
                { "name", example.Apply(getProjectResult => getProjectResult.Name) },
            },
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.spectrocloud.SpectrocloudFunctions;
    import com.pulumi.spectrocloud.inputs.GetProjectArgs;
    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 example = SpectrocloudFunctions.getProject(GetProjectArgs.builder()
                .id("project-12345")
                .build());
    
            ctx.export("projectInfo", %!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference));
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: spectrocloud:getProject
          arguments:
            id: project-12345
    outputs:
      # Output project details for reference
      projectInfo:
        id: ${example.id}
        name: ${example.name}
    

    Using getProject

    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 getProject(args: GetProjectArgs, opts?: InvokeOptions): Promise<GetProjectResult>
    function getProjectOutput(args: GetProjectOutputArgs, opts?: InvokeOptions): Output<GetProjectResult>
    def get_project(id: Optional[str] = None,
                    name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetProjectResult
    def get_project_output(id: Optional[pulumi.Input[str]] = None,
                    name: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetProjectResult]
    func LookupProject(ctx *Context, args *LookupProjectArgs, opts ...InvokeOption) (*LookupProjectResult, error)
    func LookupProjectOutput(ctx *Context, args *LookupProjectOutputArgs, opts ...InvokeOption) LookupProjectResultOutput

    > Note: This function is named LookupProject in the Go SDK.

    public static class GetProject 
    {
        public static Task<GetProjectResult> InvokeAsync(GetProjectArgs args, InvokeOptions? opts = null)
        public static Output<GetProjectResult> Invoke(GetProjectInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetProjectResult> getProject(GetProjectArgs args, InvokeOptions options)
    public static Output<GetProjectResult> getProject(GetProjectArgs args, InvokeOptions options)
    
    fn::invoke:
      function: spectrocloud:index/getProject:getProject
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The ID of this resource.
    Name string
    Id string
    The ID of this resource.
    Name string
    id String
    The ID of this resource.
    name String
    id string
    The ID of this resource.
    name string
    id str
    The ID of this resource.
    name str
    id String
    The ID of this resource.
    name String

    getProject Result

    The following output properties are available:

    Id string
    The ID of this resource.
    Name string
    Id string
    The ID of this resource.
    Name string
    id String
    The ID of this resource.
    name String
    id string
    The ID of this resource.
    name string
    id str
    The ID of this resource.
    name str
    id String
    The ID of this resource.
    name String

    Package Details

    Repository
    spectrocloud spectrocloud/terraform-provider-spectrocloud
    License
    Notes
    This Pulumi package is based on the spectrocloud Terraform Provider.
    spectrocloud logo
    spectrocloud 0.23.5 published on Sunday, Apr 20, 2025 by spectrocloud