reposListDeploymentBranchPolicies
List deployment branch policies
Details
- Method:
GET - Path:
/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies - Operation ID:
repos/list-deployment-branch-policies
Parameters
{
"owner": {
"description": "The account owner of the repository. The name is not case sensitive.",
"required": true,
"location": "path",
"type": "string"
},
"repo": {
"description": "The name of the repository without the `.git` extension. The name is not case sensitive.",
"required": true,
"location": "path",
"type": "string"
},
"environment_name": {
"description": "The name of the environment. The name must be URL encoded. For example, any slashes in the name must be replaced with `%2F`.",
"required": true,
"location": "path",
"type": "string"
},
"per_page": {
"description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"",
"required": false,
"location": "query",
"type": "integer"
},
"page": {
"description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"",
"required": false,
"location": "query",
"type": "integer"
}
}Response Schema
{
"type": "object",
"properties": {
"total_count": {
"description": "The number of deployment branch policies for the environment.",
"type": "integer",
"example": 2
},
"branch_policies": {
"type": "array",
"items": {
"title": "Deployment branch policy",
"description": "Details of a deployment branch or tag policy.",
"type": "object",
"properties": {
"id": {
"description": "The unique identifier of the branch or tag policy.",
"type": "integer",
"example": 361471
},
"node_id": {
"type": "string",
"example": "MDE2OkdhdGVCcmFuY2hQb2xpY3kzNjE0NzE="
},
"name": {
"description": "The name pattern that branches or tags must match in order to deploy to the environment.",
"type": "string",
"example": "release/*"
},
"type": {
"description": "Whether this rule targets a branch or tag.",
"type": "string",
"example": "branch",
"enum": [
"branch",
"tag"
]
}
}
}
}
},
"required": [
"total_count",
"branch_policies"
]
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('github')
# Call this tool
result = await agent.call_tool('reposListDeploymentBranchPolicies', {
# Add required parameters here
})