Puntos de conexión de la API de REST para reglas
Usa la API REST para administrar conjuntos de reglas para una empresa. Los conjuntos de reglas controlan cómo las personas pueden interactuar con repositorios y código.
Get enterprise ruleset history
Get the history of an enterprise ruleset.
Tokens de acceso granulares para "Get enterprise ruleset history"
Este punto de acceso no funciona con tokens de acceso de usuario de la aplicación de GitHub, tokens de acceso de instalación de la aplicación de GitHub ni tokens de acceso personales de granulación fina.
Parámetros para "Get enterprise ruleset history"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
enterprise string ObligatorioThe slug version of the enterprise name. |
ruleset_id integer ObligatorioThe ID of the ruleset. |
| Nombre, Tipo, Descripción |
|---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Valor predeterminado: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Valor predeterminado: |
Códigos de estado de respuesta HTTP para "Get enterprise ruleset history"
| código de estado | Descripción |
|---|---|
200 | OK |
404 | Resource not found |
500 | Internal Error |
Ejemplos de código para "Get enterprise ruleset history"
Ejemplo de solicitud
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-10-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 acceso granulares para "Get enterprise ruleset version"
Este punto de acceso no funciona con tokens de acceso de usuario de la aplicación de GitHub, tokens de acceso de instalación de la aplicación de GitHub ni tokens de acceso personales de granulación fina.
Parámetros para "Get enterprise ruleset version"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
enterprise string ObligatorioThe slug version of the enterprise name. |
ruleset_id integer ObligatorioThe ID of the ruleset. |
version_id integer ObligatorioThe ID of the version |
Códigos de estado de respuesta HTTP para "Get enterprise ruleset version"
| código de estado | Descripción |
|---|---|
200 | OK |
404 | Resource not found |
500 | Internal Error |
Ejemplos de código para "Get enterprise ruleset version"
Ejemplo de solicitud
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-10-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"
}
]
}
}