1. Packages
  2. Sonarqube Provider
  3. API Docs
  4. getPortfolio
sonarqube 0.16.14 published on Monday, Apr 14, 2025 by jdamata

sonarqube.getPortfolio

Explore with Pulumi AI

sonarqube logo
sonarqube 0.16.14 published on Monday, Apr 14, 2025 by jdamata

    Use this data source to get a Sonarqube portfolio resource

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as sonarqube from "@pulumi/sonarqube";
    
    const portfolio = sonarqube.getPortfolio({
        key: "portfolio-key",
    });
    
    import pulumi
    import pulumi_sonarqube as sonarqube
    
    portfolio = sonarqube.get_portfolio(key="portfolio-key")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/sonarqube/sonarqube"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sonarqube.LookupPortfolio(ctx, &sonarqube.LookupPortfolioArgs{
    			Key: "portfolio-key",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Sonarqube = Pulumi.Sonarqube;
    
    return await Deployment.RunAsync(() => 
    {
        var portfolio = Sonarqube.GetPortfolio.Invoke(new()
        {
            Key = "portfolio-key",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.sonarqube.SonarqubeFunctions;
    import com.pulumi.sonarqube.inputs.GetPortfolioArgs;
    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 portfolio = SonarqubeFunctions.getPortfolio(GetPortfolioArgs.builder()
                .key("portfolio-key")
                .build());
    
        }
    }
    
    variables:
      portfolio:
        fn::invoke:
          function: sonarqube:getPortfolio
          arguments:
            key: portfolio-key
    

    Using getPortfolio

    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 getPortfolio(args: GetPortfolioArgs, opts?: InvokeOptions): Promise<GetPortfolioResult>
    function getPortfolioOutput(args: GetPortfolioOutputArgs, opts?: InvokeOptions): Output<GetPortfolioResult>
    def get_portfolio(id: Optional[str] = None,
                      key: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetPortfolioResult
    def get_portfolio_output(id: Optional[pulumi.Input[str]] = None,
                      key: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetPortfolioResult]
    func LookupPortfolio(ctx *Context, args *LookupPortfolioArgs, opts ...InvokeOption) (*LookupPortfolioResult, error)
    func LookupPortfolioOutput(ctx *Context, args *LookupPortfolioOutputArgs, opts ...InvokeOption) LookupPortfolioResultOutput

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

    public static class GetPortfolio 
    {
        public static Task<GetPortfolioResult> InvokeAsync(GetPortfolioArgs args, InvokeOptions? opts = null)
        public static Output<GetPortfolioResult> Invoke(GetPortfolioInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPortfolioResult> getPortfolio(GetPortfolioArgs args, InvokeOptions options)
    public static Output<GetPortfolioResult> getPortfolio(GetPortfolioArgs args, InvokeOptions options)
    
    fn::invoke:
      function: sonarqube:index/getPortfolio:getPortfolio
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Key string
    The key of the portfolio
    Id string
    The ID of this resource.
    Key string
    The key of the portfolio
    Id string
    The ID of this resource.
    key String
    The key of the portfolio
    id String
    The ID of this resource.
    key string
    The key of the portfolio
    id string
    The ID of this resource.
    key str
    The key of the portfolio
    id str
    The ID of this resource.
    key String
    The key of the portfolio
    id String
    The ID of this resource.

    getPortfolio Result

    The following output properties are available:

    Branch string
    Which branch is analyzed
    Description string
    Description of the portfolio
    Id string
    The ID of this resource.
    Key string
    The key of the portfolio
    Name string
    Name of the portfolio
    Qualifier string
    VW (portfolios always have this qualifier)
    Regexp string
    The regular expression used to populate the portfolio. Only active when selection_mode is REGEXP
    SelectionMode string
    How the Portfolio is populated. Possible values are NONE, MANUAL, TAGS, REGEXP or REST. See docs for how Portfolio population works
    Tags List<string>
    The list of tags used to populate the Portfolio. Only active when selection_mode is TAGS
    Visibility string
    Portfolio visibility
    Branch string
    Which branch is analyzed
    Description string
    Description of the portfolio
    Id string
    The ID of this resource.
    Key string
    The key of the portfolio
    Name string
    Name of the portfolio
    Qualifier string
    VW (portfolios always have this qualifier)
    Regexp string
    The regular expression used to populate the portfolio. Only active when selection_mode is REGEXP
    SelectionMode string
    How the Portfolio is populated. Possible values are NONE, MANUAL, TAGS, REGEXP or REST. See docs for how Portfolio population works
    Tags []string
    The list of tags used to populate the Portfolio. Only active when selection_mode is TAGS
    Visibility string
    Portfolio visibility
    branch String
    Which branch is analyzed
    description String
    Description of the portfolio
    id String
    The ID of this resource.
    key String
    The key of the portfolio
    name String
    Name of the portfolio
    qualifier String
    VW (portfolios always have this qualifier)
    regexp String
    The regular expression used to populate the portfolio. Only active when selection_mode is REGEXP
    selectionMode String
    How the Portfolio is populated. Possible values are NONE, MANUAL, TAGS, REGEXP or REST. See docs for how Portfolio population works
    tags List<String>
    The list of tags used to populate the Portfolio. Only active when selection_mode is TAGS
    visibility String
    Portfolio visibility
    branch string
    Which branch is analyzed
    description string
    Description of the portfolio
    id string
    The ID of this resource.
    key string
    The key of the portfolio
    name string
    Name of the portfolio
    qualifier string
    VW (portfolios always have this qualifier)
    regexp string
    The regular expression used to populate the portfolio. Only active when selection_mode is REGEXP
    selectionMode string
    How the Portfolio is populated. Possible values are NONE, MANUAL, TAGS, REGEXP or REST. See docs for how Portfolio population works
    tags string[]
    The list of tags used to populate the Portfolio. Only active when selection_mode is TAGS
    visibility string
    Portfolio visibility
    branch str
    Which branch is analyzed
    description str
    Description of the portfolio
    id str
    The ID of this resource.
    key str
    The key of the portfolio
    name str
    Name of the portfolio
    qualifier str
    VW (portfolios always have this qualifier)
    regexp str
    The regular expression used to populate the portfolio. Only active when selection_mode is REGEXP
    selection_mode str
    How the Portfolio is populated. Possible values are NONE, MANUAL, TAGS, REGEXP or REST. See docs for how Portfolio population works
    tags Sequence[str]
    The list of tags used to populate the Portfolio. Only active when selection_mode is TAGS
    visibility str
    Portfolio visibility
    branch String
    Which branch is analyzed
    description String
    Description of the portfolio
    id String
    The ID of this resource.
    key String
    The key of the portfolio
    name String
    Name of the portfolio
    qualifier String
    VW (portfolios always have this qualifier)
    regexp String
    The regular expression used to populate the portfolio. Only active when selection_mode is REGEXP
    selectionMode String
    How the Portfolio is populated. Possible values are NONE, MANUAL, TAGS, REGEXP or REST. See docs for how Portfolio population works
    tags List<String>
    The list of tags used to populate the Portfolio. Only active when selection_mode is TAGS
    visibility String
    Portfolio visibility

    Package Details

    Repository
    sonarqube jdamata/terraform-provider-sonarqube
    License
    Notes
    This Pulumi package is based on the sonarqube Terraform Provider.
    sonarqube logo
    sonarqube 0.16.14 published on Monday, Apr 14, 2025 by jdamata