Pontos de extremidade da API REST para regras
Use a API REST para gerenciar conjuntos de regras para uma empresa. Os conjuntos de regras controlam como as pessoas podem interagir com repositórios e código.
Get enterprise ruleset history
Get the history of an enterprise ruleset.
Tokens de acesso refinados para "Get enterprise ruleset history"
Esse ponto de extremidade não funciona com tokens de acesso de usuário do aplicativo GitHub, tokens de acesso de instalação do aplicativo GitHub ou tokens de acesso pessoal refinados.
Parâmetros para "Get enterprise ruleset history"
| Nome, Tipo, Descrição |
|---|
accept string Setting to |
| Nome, Tipo, Descrição |
|---|
enterprise string ObrigatórioThe slug version of the enterprise name. |
ruleset_id integer ObrigatórioThe ID of the ruleset. |
| Nome, Tipo, Descrição |
|---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Padrão: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Padrão: |
Códigos de status de resposta HTTP para "Get enterprise ruleset history"
| Código de status | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
500 | Internal Error |
Exemplos de código para "Get enterprise ruleset history"
Exemplo de solicitação
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/rulesets/RULESET_ID/historyResponse
Status: 200[
{
"version_id": 3,
"actor": {
"id": 1,
"type": "User"
},
"updated_at": "2024-010-23T16:29:47Z"
},
{
"version_id": 2,
"actor": {
"id": 2,
"type": "User"
},
"updated_at": "2024-09-23T16:29:47Z"
},
{
"version_id": 1,
"actor": {
"id": 1,
"type": "User"
},
"updated_at": "2024-08-23T16:29:47Z"
}
]Get enterprise ruleset version
Get a version of an enterprise ruleset.
Tokens de acesso refinados para "Get enterprise ruleset version"
Esse ponto de extremidade não funciona com tokens de acesso de usuário do aplicativo GitHub, tokens de acesso de instalação do aplicativo GitHub ou tokens de acesso pessoal refinados.
Parâmetros para "Get enterprise ruleset version"
| Nome, Tipo, Descrição |
|---|
accept string Setting to |
| Nome, Tipo, Descrição |
|---|
enterprise string ObrigatórioThe slug version of the enterprise name. |
ruleset_id integer ObrigatórioThe ID of the ruleset. |
version_id integer ObrigatórioThe ID of the version |
Códigos de status de resposta HTTP para "Get enterprise ruleset version"
| Código de status | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
500 | Internal Error |
Exemplos de código para "Get enterprise ruleset version"
Exemplo de solicitação
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/rulesets/RULESET_ID/history/VERSION_IDResponse
Status: 200[
{
"version_id": 3,
"actor": {
"id": 1,
"type": "User"
},
"updated_at": "2024-010-23T16:29:47Z",
"state": {
"id": 21,
"name": "super cool ruleset",
"target": "repository",
"source_type": "Enterprise",
"source": "my-enterprise",
"enforcement": "active",
"conditions": {
"organization_name": {
"include": [
"important_organization"
]
},
"repository_name": {
"include": [
"~ALL"
]
}
},
"rules": [
{
"type": "repository_delete"
}
]
}
}
]