1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. DevOps
  5. getRepositoryProtectedBranches
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.DevOps.getRepositoryProtectedBranches

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the list of Repository Protected Branches in Oracle Cloud Infrastructure Devops service.

    Returns a list of Protected Branches.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testRepositoryProtectedBranches = oci.DevOps.getRepositoryProtectedBranches({
        repositoryId: testRepository.id,
        name: repositoryProtectedBranchName,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_repository_protected_branches = oci.DevOps.get_repository_protected_branches(repository_id=test_repository["id"],
        name=repository_protected_branch_name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/DevOps"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := DevOps.GetRepositoryProtectedBranches(ctx, &devops.GetRepositoryProtectedBranchesArgs{
    			RepositoryId: testRepository.Id,
    			Name:         pulumi.StringRef(repositoryProtectedBranchName),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testRepositoryProtectedBranches = Oci.DevOps.GetRepositoryProtectedBranches.Invoke(new()
        {
            RepositoryId = testRepository.Id,
            Name = repositoryProtectedBranchName,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.DevOps.DevOpsFunctions;
    import com.pulumi.oci.DevOps.inputs.GetRepositoryProtectedBranchesArgs;
    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 testRepositoryProtectedBranches = DevOpsFunctions.getRepositoryProtectedBranches(GetRepositoryProtectedBranchesArgs.builder()
                .repositoryId(testRepository.id())
                .name(repositoryProtectedBranchName)
                .build());
    
        }
    }
    
    variables:
      testRepositoryProtectedBranches:
        fn::invoke:
          Function: oci:DevOps:getRepositoryProtectedBranches
          Arguments:
            repositoryId: ${testRepository.id}
            name: ${repositoryProtectedBranchName}
    

    Using getRepositoryProtectedBranches

    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 getRepositoryProtectedBranches(args: GetRepositoryProtectedBranchesArgs, opts?: InvokeOptions): Promise<GetRepositoryProtectedBranchesResult>
    function getRepositoryProtectedBranchesOutput(args: GetRepositoryProtectedBranchesOutputArgs, opts?: InvokeOptions): Output<GetRepositoryProtectedBranchesResult>
    def get_repository_protected_branches(filters: Optional[Sequence[_devops.GetRepositoryProtectedBranchesFilter]] = None,
                                          name: Optional[str] = None,
                                          repository_id: Optional[str] = None,
                                          opts: Optional[InvokeOptions] = None) -> GetRepositoryProtectedBranchesResult
    def get_repository_protected_branches_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[_devops.GetRepositoryProtectedBranchesFilterArgs]]]] = None,
                                          name: Optional[pulumi.Input[str]] = None,
                                          repository_id: Optional[pulumi.Input[str]] = None,
                                          opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryProtectedBranchesResult]
    func GetRepositoryProtectedBranches(ctx *Context, args *GetRepositoryProtectedBranchesArgs, opts ...InvokeOption) (*GetRepositoryProtectedBranchesResult, error)
    func GetRepositoryProtectedBranchesOutput(ctx *Context, args *GetRepositoryProtectedBranchesOutputArgs, opts ...InvokeOption) GetRepositoryProtectedBranchesResultOutput

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

    public static class GetRepositoryProtectedBranches 
    {
        public static Task<GetRepositoryProtectedBranchesResult> InvokeAsync(GetRepositoryProtectedBranchesArgs args, InvokeOptions? opts = null)
        public static Output<GetRepositoryProtectedBranchesResult> Invoke(GetRepositoryProtectedBranchesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRepositoryProtectedBranchesResult> getRepositoryProtectedBranches(GetRepositoryProtectedBranchesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:DevOps/getRepositoryProtectedBranches:getRepositoryProtectedBranches
      arguments:
        # arguments dictionary

    The following arguments are supported:

    RepositoryId string
    Unique repository identifier.
    Filters List<GetRepositoryProtectedBranchesFilter>
    Name string
    A filter to return only resources that match the given branch name.
    RepositoryId string
    Unique repository identifier.
    Filters []GetRepositoryProtectedBranchesFilter
    Name string
    A filter to return only resources that match the given branch name.
    repositoryId String
    Unique repository identifier.
    filters List<GetRepositoryProtectedBranchesFilter>
    name String
    A filter to return only resources that match the given branch name.
    repositoryId string
    Unique repository identifier.
    filters GetRepositoryProtectedBranchesFilter[]
    name string
    A filter to return only resources that match the given branch name.
    repository_id str
    Unique repository identifier.
    filters Sequence[devops.GetRepositoryProtectedBranchesFilter]
    name str
    A filter to return only resources that match the given branch name.
    repositoryId String
    Unique repository identifier.
    filters List<Property Map>
    name String
    A filter to return only resources that match the given branch name.

    getRepositoryProtectedBranches Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    ProtectedBranchCollections List<GetRepositoryProtectedBranchesProtectedBranchCollection>
    The list of protected_branch_collection.
    RepositoryId string
    Filters List<GetRepositoryProtectedBranchesFilter>
    Name string
    Id string
    The provider-assigned unique ID for this managed resource.
    ProtectedBranchCollections []GetRepositoryProtectedBranchesProtectedBranchCollection
    The list of protected_branch_collection.
    RepositoryId string
    Filters []GetRepositoryProtectedBranchesFilter
    Name string
    id String
    The provider-assigned unique ID for this managed resource.
    protectedBranchCollections List<GetRepositoryProtectedBranchesProtectedBranchCollection>
    The list of protected_branch_collection.
    repositoryId String
    filters List<GetRepositoryProtectedBranchesFilter>
    name String
    id string
    The provider-assigned unique ID for this managed resource.
    protectedBranchCollections GetRepositoryProtectedBranchesProtectedBranchCollection[]
    The list of protected_branch_collection.
    repositoryId string
    filters GetRepositoryProtectedBranchesFilter[]
    name string
    id String
    The provider-assigned unique ID for this managed resource.
    protectedBranchCollections List<Property Map>
    The list of protected_branch_collection.
    repositoryId String
    filters List<Property Map>
    name String

    Supporting Types

    GetRepositoryProtectedBranchesFilter

    Name string
    A filter to return only resources that match the given branch name.
    Values List<string>
    Regex bool
    Name string
    A filter to return only resources that match the given branch name.
    Values []string
    Regex bool
    name String
    A filter to return only resources that match the given branch name.
    values List<String>
    regex Boolean
    name string
    A filter to return only resources that match the given branch name.
    values string[]
    regex boolean
    name str
    A filter to return only resources that match the given branch name.
    values Sequence[str]
    regex bool
    name String
    A filter to return only resources that match the given branch name.
    values List<String>
    regex Boolean

    GetRepositoryProtectedBranchesProtectedBranchCollection

    Items []GetRepositoryProtectedBranchesProtectedBranchCollectionItem
    List of objects describing protected branches
    items GetRepositoryProtectedBranchesProtectedBranchCollectionItem[]
    List of objects describing protected branches
    items List<Property Map>
    List of objects describing protected branches

    GetRepositoryProtectedBranchesProtectedBranchCollectionItem

    BranchName string
    Branch name inside a repository.
    DefinedTags Dictionary<string, string>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
    FreeformTags Dictionary<string, string>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
    ProtectionLevels List<string>
    Protection level to be added on the branch.
    SystemTags Dictionary<string, string>
    Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
    BranchName string
    Branch name inside a repository.
    DefinedTags map[string]string
    Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
    FreeformTags map[string]string
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
    ProtectionLevels []string
    Protection level to be added on the branch.
    SystemTags map[string]string
    Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
    branchName String
    Branch name inside a repository.
    definedTags Map<String,String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
    freeformTags Map<String,String>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
    protectionLevels List<String>
    Protection level to be added on the branch.
    systemTags Map<String,String>
    Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
    branchName string
    Branch name inside a repository.
    definedTags {[key: string]: string}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
    freeformTags {[key: string]: string}
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
    protectionLevels string[]
    Protection level to be added on the branch.
    systemTags {[key: string]: string}
    Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
    branch_name str
    Branch name inside a repository.
    defined_tags Mapping[str, str]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
    freeform_tags Mapping[str, str]
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
    protection_levels Sequence[str]
    Protection level to be added on the branch.
    system_tags Mapping[str, str]
    Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
    branchName String
    Branch name inside a repository.
    definedTags Map<String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
    freeformTags Map<String>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
    protectionLevels List<String>
    Protection level to be added on the branch.
    systemTags Map<String>
    Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi