Google Cloud (GCP) Classic

v6.44.0 published on Tuesday, Nov 29, 2022 by Pulumi

getRepository

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

Example Usage

using System.Collections.Generic;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var my_repo = Gcp.SourceRepo.GetRepository.Invoke(new()
    {
        Name = "my-repository",
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/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
	})
}
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.artifactregistry.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());

    }
}
import pulumi
import pulumi_gcp as gcp

my_repo = gcp.sourcerepo.get_repository(name="my-repository")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const my_repo = pulumi.output(gcp.sourcerepo.getRepository({
    name: "my-repository",
}));
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

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.