REST API endpoints for enterprise network configurations
Use the REST API to interact with enterprise network configurations.
List hosted compute network configurations for an enterprise
Lists all hosted compute network configurations configured in an enterprise.
Tokens de acceso específicos para "List hosted compute network configurations for an enterprise"
Este punto de conexión no funciona con tokens de acceso de usuario de aplicación de GitHub, tokens de acceso de instalación de aplicaciones de GitHub ni tokens de acceso personales específicos.
Parámetros para "List hosted compute network configurations for an enterprise"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
enterprise string RequeridoThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
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 "List hosted compute network configurations for an enterprise"
status code | Descripción |
---|---|
200 | OK |
Ejemplos de código para "List hosted compute network configurations for an enterprise"
Si accedes a GitHub en GHE.com, reemplaza api.github.com
por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/network-configurations
Response
Status: 200
{
"total_count": 2,
"network_configurations": [
{
"id": "123456789ABCDEF",
"name": "My network configuration",
"compute_service": "actions",
"network_settings_ids": [
"23456789ABDCEF1",
"3456789ABDCEF12"
],
"created_on": "2022-10-09T23:39:01Z"
},
{
"id": "456789ABDCEF123",
"name": "My other configuration",
"compute_service": "none",
"network_settings_ids": [
"56789ABDCEF1234",
"6789ABDCEF12345"
],
"created_on": "2023-04-26T15:23:37Z"
}
]
}
Create a hosted compute network configuration for an enterprise
Creates a hosted compute network configuration for an enterprise.
Tokens de acceso específicos para "Create a hosted compute network configuration for an enterprise"
Este punto de conexión no funciona con tokens de acceso de usuario de aplicación de GitHub, tokens de acceso de instalación de aplicaciones de GitHub ni tokens de acceso personales específicos.
Parámetros para "Create a hosted compute network configuration for an enterprise"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
enterprise string RequeridoThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Nombre, Tipo, Descripción |
---|
name string RequeridoName of the network configuration. Must be between 1 and 100 characters and may only contain upper and lowercase letters a-z, numbers 0-9, |
compute_service string The hosted compute service to use for the network configuration. Puede ser uno de los siguientes: |
network_settings_ids array of strings RequeridoThe identifier of the network settings to use for the network configuration. Exactly one network settings must be specified. |
Códigos de estado de respuesta HTTP para "Create a hosted compute network configuration for an enterprise"
status code | Descripción |
---|---|
201 | Created |
Ejemplos de código para "Create a hosted compute network configuration for an enterprise"
Si accedes a GitHub en GHE.com, reemplaza api.github.com
por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/network-configurations \
-d '{"name":"my-network-configuration","network_settings_ids":["23456789ABDCEF1"],"compute_service":"actions"}'
Response
Status: 201
{
"id": "123456789ABCDEF",
"name": "My network configuration",
"compute_service": "actions",
"network_settings_ids": [
"23456789ABDCEF1",
"3456789ABDCEF12"
],
"created_on": "2022-10-09T23:39:01Z"
}
Get a hosted compute network configuration for an enterprise
Gets a hosted compute network configuration configured in an enterprise.
Tokens de acceso específicos para "Get a hosted compute network configuration for an enterprise"
Este punto de conexión no funciona con tokens de acceso de usuario de aplicación de GitHub, tokens de acceso de instalación de aplicaciones de GitHub ni tokens de acceso personales específicos.
Parámetros para "Get a hosted compute network configuration for an enterprise"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
enterprise string RequeridoThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
network_configuration_id string RequeridoUnique identifier of the hosted compute network configuration. |
Códigos de estado de respuesta HTTP para "Get a hosted compute network configuration for an enterprise"
status code | Descripción |
---|---|
200 | OK |
Ejemplos de código para "Get a hosted compute network configuration for an enterprise"
Si accedes a GitHub en GHE.com, reemplaza api.github.com
por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/network-configurations/NETWORK_CONFIGURATION_ID
Response
Status: 200
{
"id": "123456789ABCDEF",
"name": "My network configuration",
"compute_service": "actions",
"network_settings_ids": [
"23456789ABDCEF1",
"3456789ABDCEF12"
],
"created_on": "2022-10-09T23:39:01Z"
}
Update a hosted compute network configuration for an enterprise
Updates a hosted compute network configuration for an enterprise.
Tokens de acceso específicos para "Update a hosted compute network configuration for an enterprise"
Este punto de conexión no funciona con tokens de acceso de usuario de aplicación de GitHub, tokens de acceso de instalación de aplicaciones de GitHub ni tokens de acceso personales específicos.
Parámetros para "Update a hosted compute network configuration for an enterprise"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
enterprise string RequeridoThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
network_configuration_id string RequeridoUnique identifier of the hosted compute network configuration. |
Nombre, Tipo, Descripción |
---|
name string Name of the network configuration. Must be between 1 and 100 characters and may only contain upper and lowercase letters a-z, numbers 0-9, |
compute_service string The hosted compute service to use for the network configuration. Puede ser uno de los siguientes: |
network_settings_ids array of strings The identifier of the network settings to use for the network configuration. Exactly one network settings must be specified. |
Códigos de estado de respuesta HTTP para "Update a hosted compute network configuration for an enterprise"
status code | Descripción |
---|---|
200 | OK |
Ejemplos de código para "Update a hosted compute network configuration for an enterprise"
Si accedes a GitHub en GHE.com, reemplaza api.github.com
por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/network-configurations/NETWORK_CONFIGURATION_ID \
-d '{"name":"my-network-configuration","network_settings_ids":["23456789ABDCEF1"],"compute_service":"actions"}'
Response
Status: 200
{
"id": "123456789ABCDEF",
"name": "My network configuration",
"compute_service": "actions",
"network_settings_ids": [
"23456789ABDCEF1",
"3456789ABDCEF12"
],
"created_on": "2022-10-09T23:39:01Z"
}
Delete a hosted compute network configuration from an enterprise
Deletes a hosted compute network configuration from an enterprise.
Tokens de acceso específicos para "Delete a hosted compute network configuration from an enterprise"
Este punto de conexión no funciona con tokens de acceso de usuario de aplicación de GitHub, tokens de acceso de instalación de aplicaciones de GitHub ni tokens de acceso personales específicos.
Parámetros para "Delete a hosted compute network configuration from an enterprise"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
enterprise string RequeridoThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
network_configuration_id string RequeridoUnique identifier of the hosted compute network configuration. |
Códigos de estado de respuesta HTTP para "Delete a hosted compute network configuration from an enterprise"
status code | Descripción |
---|---|
204 | No Content |
Ejemplos de código para "Delete a hosted compute network configuration from an enterprise"
Si accedes a GitHub en GHE.com, reemplaza api.github.com
por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/network-configurations/NETWORK_CONFIGURATION_ID
Response
Status: 204
Get a hosted compute network settings resource for an enterprise
Gets a hosted compute network settings resource configured for an enterprise.
Tokens de acceso específicos para "Get a hosted compute network settings resource for an enterprise"
Este punto de conexión no funciona con tokens de acceso de usuario de aplicación de GitHub, tokens de acceso de instalación de aplicaciones de GitHub ni tokens de acceso personales específicos.
Parámetros para "Get a hosted compute network settings resource for an enterprise"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
enterprise string RequeridoThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
network_settings_id string RequeridoUnique identifier of the hosted compute network settings. |
Códigos de estado de respuesta HTTP para "Get a hosted compute network settings resource for an enterprise"
status code | Descripción |
---|---|
200 | OK |
Ejemplos de código para "Get a hosted compute network settings resource for an enterprise"
Si accedes a GitHub en GHE.com, reemplaza api.github.com
por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/network-settings/NETWORK_SETTINGS_ID
Response
Status: 200
{
"id": "220F78DACB92BBFBC5E6F22DE1CCF52309D",
"network_configuration_id": "934E208B3EE0BD60CF5F752C426BFB53562",
"name": "my_network_settings",
"subnet_id": "/subscriptions/14839728-3ad9-43ab-bd2b-fa6ad0f75e2a/resourceGroups/my-rg/providers/Microsoft.Network/virtualNetworks/my-vnet/subnets/my-subnet",
"region": "eastus"
}