1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. DevOps
  5. getRepositoryProtectedBranches
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

oci.DevOps.getRepositoryProtectedBranches

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 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,
});
Copy
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)
Copy
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
	})
}
Copy
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,
    });

});
Copy
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());

    }
}
Copy
variables:
  testRepositoryProtectedBranches:
    fn::invoke:
      function: oci:DevOps:getRepositoryProtectedBranches
      arguments:
        repositoryId: ${testRepository.id}
        name: ${repositoryProtectedBranchName}
Copy

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>
Copy
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]
Copy
func GetRepositoryProtectedBranches(ctx *Context, args *GetRepositoryProtectedBranchesArgs, opts ...InvokeOption) (*GetRepositoryProtectedBranchesResult, error)
func GetRepositoryProtectedBranchesOutput(ctx *Context, args *GetRepositoryProtectedBranchesOutputArgs, opts ...InvokeOption) GetRepositoryProtectedBranchesResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetRepositoryProtectedBranchesResult> getRepositoryProtectedBranches(GetRepositoryProtectedBranchesArgs args, InvokeOptions options)
public static Output<GetRepositoryProtectedBranchesResult> getRepositoryProtectedBranches(GetRepositoryProtectedBranchesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:DevOps/getRepositoryProtectedBranches:getRepositoryProtectedBranches
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

RepositoryId This property is required. string
Unique repository identifier.
Filters Changes to this property will trigger replacement. List<GetRepositoryProtectedBranchesFilter>
Name string
A filter to return only resources that match the given branch name.
RepositoryId This property is required. string
Unique repository identifier.
Filters Changes to this property will trigger replacement. []GetRepositoryProtectedBranchesFilter
Name string
A filter to return only resources that match the given branch name.
repositoryId This property is required. String
Unique repository identifier.
filters Changes to this property will trigger replacement. List<GetRepositoryProtectedBranchesFilter>
name String
A filter to return only resources that match the given branch name.
repositoryId This property is required. string
Unique repository identifier.
filters Changes to this property will trigger replacement. GetRepositoryProtectedBranchesFilter[]
name string
A filter to return only resources that match the given branch name.
repository_id This property is required. str
Unique repository identifier.
filters Changes to this property will trigger replacement. Sequence[devops.GetRepositoryProtectedBranchesFilter]
name str
A filter to return only resources that match the given branch name.
repositoryId This property is required. String
Unique repository identifier.
filters Changes to this property will trigger replacement. 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 This property is required. string
A filter to return only resources that match the given branch name.
Values This property is required. List<string>
Regex bool
Name This property is required. string
A filter to return only resources that match the given branch name.
Values This property is required. []string
Regex bool
name This property is required. String
A filter to return only resources that match the given branch name.
values This property is required. List<String>
regex Boolean
name This property is required. string
A filter to return only resources that match the given branch name.
values This property is required. string[]
regex boolean
name This property is required. str
A filter to return only resources that match the given branch name.
values This property is required. Sequence[str]
regex bool
name This property is required. String
A filter to return only resources that match the given branch name.
values This property is required. List<String>
regex Boolean

GetRepositoryProtectedBranchesProtectedBranchCollection

Items This property is required. List<GetRepositoryProtectedBranchesProtectedBranchCollectionItem>
List of objects describing protected branches
Items This property is required. []GetRepositoryProtectedBranchesProtectedBranchCollectionItem
List of objects describing protected branches
items This property is required. List<GetRepositoryProtectedBranchesProtectedBranchCollectionItem>
List of objects describing protected branches
items This property is required. GetRepositoryProtectedBranchesProtectedBranchCollectionItem[]
List of objects describing protected branches
items This property is required. Sequence[devops.GetRepositoryProtectedBranchesProtectedBranchCollectionItem]
List of objects describing protected branches
items This property is required. List<Property Map>
List of objects describing protected branches

GetRepositoryProtectedBranchesProtectedBranchCollectionItem

BranchName This property is required. string
Branch name inside a repository.
DefinedTags This property is required. 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 This property is required. 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 This property is required. List<string>
Protection level to be added on the branch.
SystemTags This property is required. 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 This property is required. string
Branch name inside a repository.
DefinedTags This property is required. 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 This property is required. 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 This property is required. []string
Protection level to be added on the branch.
SystemTags This property is required. 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 This property is required. String
Branch name inside a repository.
definedTags This property is required. 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 This property is required. 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 This property is required. List<String>
Protection level to be added on the branch.
systemTags This property is required. 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 This property is required. string
Branch name inside a repository.
definedTags This property is required. {[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 This property is required. {[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 This property is required. string[]
Protection level to be added on the branch.
systemTags This property is required. {[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 This property is required. str
Branch name inside a repository.
defined_tags This property is required. 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 This property is required. 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 This property is required. Sequence[str]
Protection level to be added on the branch.
system_tags This property is required. 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 This property is required. String
Branch name inside a repository.
definedTags This property is required. 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 This property is required. 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 This property is required. List<String>
Protection level to be added on the branch.
systemTags This property is required. 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.
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi