Oracle Cloud Infrastructure v2.27.0 published on Thursday, Mar 20, 2025 by Pulumi
oci.DevOps.getRepositoryProtectedBranches
Explore with Pulumi AI
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)
public static Output<GetRepositoryProtectedBranchesResult> getRepositoryProtectedBranches(GetRepositoryProtectedBranchesArgs args, InvokeOptions options)
fn::invoke:
  function: oci:DevOps/getRepositoryProtectedBranches:getRepositoryProtectedBranches
  arguments:
    # arguments dictionaryThe following arguments are supported:
- RepositoryId string
- Unique repository identifier.
- Filters
List<GetRepository Protected Branches Filter> 
- Name string
- A filter to return only resources that match the given branch name.
- RepositoryId string
- Unique repository identifier.
- Filters
[]GetRepository Protected Branches Filter 
- Name string
- A filter to return only resources that match the given branch name.
- repositoryId String
- Unique repository identifier.
- filters
List<GetRepository Protected Branches Filter> 
- name String
- A filter to return only resources that match the given branch name.
- repositoryId string
- Unique repository identifier.
- filters
GetRepository Protected Branches Filter[] 
- name string
- A filter to return only resources that match the given branch name.
- repository_id str
- Unique repository identifier.
- filters
Sequence[devops.Get Repository Protected Branches Filter] 
- 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.
- ProtectedBranch List<GetCollections Repository Protected Branches Protected Branch Collection> 
- The list of protected_branch_collection.
- RepositoryId string
- Filters
List<GetRepository Protected Branches Filter> 
- Name string
- Id string
- The provider-assigned unique ID for this managed resource.
- ProtectedBranch []GetCollections Repository Protected Branches Protected Branch Collection 
- The list of protected_branch_collection.
- RepositoryId string
- Filters
[]GetRepository Protected Branches Filter 
- Name string
- id String
- The provider-assigned unique ID for this managed resource.
- protectedBranch List<GetCollections Repository Protected Branches Protected Branch Collection> 
- The list of protected_branch_collection.
- repositoryId String
- filters
List<GetRepository Protected Branches Filter> 
- name String
- id string
- The provider-assigned unique ID for this managed resource.
- protectedBranch GetCollections Repository Protected Branches Protected Branch Collection[] 
- The list of protected_branch_collection.
- repositoryId string
- filters
GetRepository Protected Branches Filter[] 
- name string
- id str
- The provider-assigned unique ID for this managed resource.
- protected_branch_ Sequence[devops.collections Get Repository Protected Branches Protected Branch Collection] 
- The list of protected_branch_collection.
- repository_id str
- filters
Sequence[devops.Get Repository Protected Branches Filter] 
- name str
- id String
- The provider-assigned unique ID for this managed resource.
- protectedBranch List<Property Map>Collections 
- The list of protected_branch_collection.
- repositoryId String
- filters List<Property Map>
- name String
Supporting Types
GetRepositoryProtectedBranchesFilter    
GetRepositoryProtectedBranchesProtectedBranchCollection      
- Items
List<GetRepository Protected Branches Protected Branch Collection Item> 
- List of objects describing protected branches
- Items
[]GetRepository Protected Branches Protected Branch Collection Item 
- List of objects describing protected branches
- items
List<GetRepository Protected Branches Protected Branch Collection Item> 
- List of objects describing protected branches
- items
GetRepository Protected Branches Protected Branch Collection Item[] 
- List of objects describing protected branches
- items
Sequence[devops.Get Repository Protected Branches Protected Branch Collection Item] 
- List of objects describing protected branches
- items List<Property Map>
- List of objects describing protected branches
GetRepositoryProtectedBranchesProtectedBranchCollectionItem       
- BranchName string
- Branch name inside a repository.
- 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"}
- 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.
- 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.
- 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"}
- 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.
- 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.
- 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"}
- 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.
- 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.
- {[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"}
- {[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.
- {[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.
- 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"}
- 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.
- 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.
- 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"}
- 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.
- 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 ociTerraform Provider.