1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. sourcerepo
  5. getRepository
Google Cloud Classic v7.19.0 published on Thursday, Apr 18, 2024 by Pulumi

gcp.sourcerepo.getRepository

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.19.0 published on Thursday, Apr 18, 2024 by Pulumi

    Get infomation about an existing Google Cloud Source Repository. For more information see the official documentation and API.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const my-repo = gcp.sourcerepo.getRepository({
        name: "my-repository",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_repo = gcp.sourcerepo.get_repository(name="my-repository")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/sourcerepo"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sourcerepo.LookupRepository(ctx, &sourcerepo.LookupRepositoryArgs{
    			Name: "my-repository",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var my_repo = Gcp.SourceRepo.GetRepository.Invoke(new()
        {
            Name = "my-repository",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.sourcerepo.SourcerepoFunctions;
    import com.pulumi.gcp.sourcerepo.inputs.GetRepositoryArgs;
    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 my-repo = SourcerepoFunctions.getRepository(GetRepositoryArgs.builder()
                .name("my-repository")
                .build());
    
        }
    }
    
    variables:
      my-repo:
        fn::invoke:
          Function: gcp:sourcerepo:getRepository
          Arguments:
            name: my-repository
    

    Using getRepository

    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 getRepository(args: GetRepositoryArgs, opts?: InvokeOptions): Promise<GetRepositoryResult>
    function getRepositoryOutput(args: GetRepositoryOutputArgs, opts?: InvokeOptions): Output<GetRepositoryResult>
    def get_repository(name: Optional[str] = None,
                       project: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetRepositoryResult
    def get_repository_output(name: Optional[pulumi.Input[str]] = None,
                       project: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryResult]
    func LookupRepository(ctx *Context, args *LookupRepositoryArgs, opts ...InvokeOption) (*LookupRepositoryResult, error)
    func LookupRepositoryOutput(ctx *Context, args *LookupRepositoryOutputArgs, opts ...InvokeOption) LookupRepositoryResultOutput

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

    public static class GetRepository 
    {
        public static Task<GetRepositoryResult> InvokeAsync(GetRepositoryArgs args, InvokeOptions? opts = null)
        public static Output<GetRepositoryResult> Invoke(GetRepositoryInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRepositoryResult> getRepository(GetRepositoryArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:sourcerepo/getRepository:getRepository
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Resource name of the repository. The repo name may contain slashes. eg, name/with/slash
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Name string
    Resource name of the repository. The repo name may contain slashes. eg, name/with/slash
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    name String
    Resource name of the repository. The repo name may contain slashes. eg, name/with/slash
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    name string
    Resource name of the repository. The repo name may contain slashes. eg, name/with/slash
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    name str
    Resource name of the repository. The repo name may contain slashes. eg, name/with/slash
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    name String
    Resource name of the repository. The repo name may contain slashes. eg, name/with/slash
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    getRepository Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    PubsubConfigs List<GetRepositoryPubsubConfig>
    Size int
    Url string
    Project string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    PubsubConfigs []GetRepositoryPubsubConfig
    Size int
    Url string
    Project string
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    pubsubConfigs List<GetRepositoryPubsubConfig>
    size Integer
    url String
    project String
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    pubsubConfigs GetRepositoryPubsubConfig[]
    size number
    url string
    project string
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    pubsub_configs Sequence[GetRepositoryPubsubConfig]
    size int
    url str
    project str
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    pubsubConfigs List<Property Map>
    size Number
    url String
    project String

    Supporting Types

    GetRepositoryPubsubConfig

    MessageFormat string
    The format of the Cloud Pub/Sub messages.

    • PROTOBUF: The message payload is a serialized protocol buffer of SourceRepoEvent.
    • JSON: The message payload is a JSON string of SourceRepoEvent. Possible values: ["PROTOBUF", "JSON"]
    ServiceAccountEmail string
    Email address of the service account used for publishing Cloud Pub/Sub messages. This service account needs to be in the same project as the PubsubConfig. When added, the caller needs to have iam.serviceAccounts.actAs permission on this service account. If unspecified, it defaults to the compute engine default service account.
    Topic string
    MessageFormat string
    The format of the Cloud Pub/Sub messages.

    • PROTOBUF: The message payload is a serialized protocol buffer of SourceRepoEvent.
    • JSON: The message payload is a JSON string of SourceRepoEvent. Possible values: ["PROTOBUF", "JSON"]
    ServiceAccountEmail string
    Email address of the service account used for publishing Cloud Pub/Sub messages. This service account needs to be in the same project as the PubsubConfig. When added, the caller needs to have iam.serviceAccounts.actAs permission on this service account. If unspecified, it defaults to the compute engine default service account.
    Topic string
    messageFormat String
    The format of the Cloud Pub/Sub messages.

    • PROTOBUF: The message payload is a serialized protocol buffer of SourceRepoEvent.
    • JSON: The message payload is a JSON string of SourceRepoEvent. Possible values: ["PROTOBUF", "JSON"]
    serviceAccountEmail String
    Email address of the service account used for publishing Cloud Pub/Sub messages. This service account needs to be in the same project as the PubsubConfig. When added, the caller needs to have iam.serviceAccounts.actAs permission on this service account. If unspecified, it defaults to the compute engine default service account.
    topic String
    messageFormat string
    The format of the Cloud Pub/Sub messages.

    • PROTOBUF: The message payload is a serialized protocol buffer of SourceRepoEvent.
    • JSON: The message payload is a JSON string of SourceRepoEvent. Possible values: ["PROTOBUF", "JSON"]
    serviceAccountEmail string
    Email address of the service account used for publishing Cloud Pub/Sub messages. This service account needs to be in the same project as the PubsubConfig. When added, the caller needs to have iam.serviceAccounts.actAs permission on this service account. If unspecified, it defaults to the compute engine default service account.
    topic string
    message_format str
    The format of the Cloud Pub/Sub messages.

    • PROTOBUF: The message payload is a serialized protocol buffer of SourceRepoEvent.
    • JSON: The message payload is a JSON string of SourceRepoEvent. Possible values: ["PROTOBUF", "JSON"]
    service_account_email str
    Email address of the service account used for publishing Cloud Pub/Sub messages. This service account needs to be in the same project as the PubsubConfig. When added, the caller needs to have iam.serviceAccounts.actAs permission on this service account. If unspecified, it defaults to the compute engine default service account.
    topic str
    messageFormat String
    The format of the Cloud Pub/Sub messages.

    • PROTOBUF: The message payload is a serialized protocol buffer of SourceRepoEvent.
    • JSON: The message payload is a JSON string of SourceRepoEvent. Possible values: ["PROTOBUF", "JSON"]
    serviceAccountEmail String
    Email address of the service account used for publishing Cloud Pub/Sub messages. This service account needs to be in the same project as the PubsubConfig. When added, the caller needs to have iam.serviceAccounts.actAs permission on this service account. If unspecified, it defaults to the compute engine default service account.
    topic String

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.19.0 published on Thursday, Apr 18, 2024 by Pulumi