Cloud Diversion
Cloud Diversion
Overview
Cloud Diversion API
Version information
Version : 1.0.0.BETA
License information
Terms of service : https://www.nexusguard.com/
URI scheme
Host : {your_basic_domain}
BasePath : /api
Schemes : HTTPS
Paths
List Cloud Diversion sites for a customer.
GET /spe/common/customer/{customer_id}/diversion/sites
Description
Returns Cloud Diversion sites owned by the target customer. Results are paginated, use one address family per response, and can be filtered by an exact canonical member CIDR. Origin Protection sites that have not joined Cloud Diversion are not returned.
Parameters
| Type | Name | Description | Schema | Default |
|---|---|---|---|---|
| Path | customer_id required |
Encrypted customer ID. | string | |
| Query | access_token required |
Access token used to authenticate your access to the API.Can be obtained by invoking this API. | string | |
| Query | cidr optional |
Optional canonical protected-network CIDR. It is an exact member match, not a parent, child, or IP containment search, and must match ip_version. | string | |
| Query | ip_version optional |
Address family returned by this page. The default is IPv4. | enum (ipv4, ipv6) | "ipv4" |
| Query | page optional |
Page number, starting from 1. | integer (int32) | 1 |
| Query | page_size optional |
Number of Site items per page. | integer (int32) | 20 |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 200 | Response sent when the API is successfully invoked. An unmatched CIDR or page beyond the last page returns a successful empty items array. | CloudDiversionSiteListResult |
Produces
application/json
Security
| Type | Name |
|---|---|
| apiKey | ApiKeyAuth |
Example HTTP response
Response 200
{
"code" : 0,
"msg" : "Success.",
"result" : {
"items" : [ {
"site_id" : "b6c9bcffa5685971",
"site_name" : "production",
"ip_version" : "ipv4",
"policy" : {
"detection_enabled" : true,
"diversion_mode" : "auto_divert",
"detection_template" : {
"id" : "123",
"name" : "Default Detection"
},
"diversion_scope" : "off_net"
}
} ],
"page" : 1,
"page_size" : 20,
"total" : 1,
"total_pages" : 1
}
}
List Cloud Diversion Network Groups under a Site for a customer.
GET /spe/common/customer/{customer_id}/diversion/sites/{site_id}/network-groups
Description
Returns Network Groups nested below a target Customer’s owned public Site ID. CIDR is normalized and matched only against an exact Protected Network member. policy is always the Network Group’s saved Policy, not an effective Policy.
Parameters
| Type | Name | Description | Schema | Default |
|---|---|---|---|---|
| Path | customer_id required |
Encrypted target Customer ID. | string | |
| Path | site_id required |
Public Origin Protection Site ID. It determines the member CIDR address family. | string | |
| Query | access_token required |
string | ||
| Query | cidr optional |
Optional Protected Network CIDR. The service normalizes it before exact member matching; its address family must match the parent Site. | string | |
| Query | page optional |
integer (int32) | 1 |
|
| Query | page_size optional |
integer (int32) | 20 |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 200 | Response sent when the API is successfully invoked. No match and a page beyond the last page return a successful empty items array. | CloudDiversionNetworkGroupListResult |
Produces
application/json
Security
| Type | Name |
|---|---|
| apiKey | ApiKeyAuth |
Atomically update a Cloud Diversion Network Group Policy for a customer.
POST /spe/common/customer/{customer_id}/diversion/sites/{site_id}/network-groups/{network_group_id}/policy
Description
The encrypted target Customer ID is decrypted by Open API Service, then the App independently verifies Customer ownership of the public Site ID and that the opaque Network Group ID belongs to that Site before any write. Merges submitted fields into the Network Group’s saved Policy, validates the complete target and its saved Supporting Configuration, and saves it atomically. Custom off preserves the saved Group Policy and inherits the Site Policy; Custom on restores that saved Policy and can apply submitted fields in the same request. Success means the Policy was accepted and saved, not that traffic switching has completed. Repeating an already-satisfied target has no downstream or audit side effect. Actual changes retain Network-level audit entries with actor openapi and source spe_admin_api.
Parameters
| Type | Name | Description | Schema |
|---|---|---|---|
| Path | customer_id required |
Encrypted target Customer ID. | string |
| Path | network_group_id required |
Opaque Network Group ID. | string |
| Path | site_id required |
Public Origin Protection Site ID. | string |
| Query | access_token required |
string | |
| Body | body required |
CloudDiversionNetworkGroupPolicyUpdateRequest |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 200 | Configuration was accepted and saved, or a public business/parameter error was returned. | CloudDiversionSitePolicyUpdateResult |
Consumes
application/json
Produces
application/json
Security
| Type | Name |
|---|---|
| apiKey | ApiKeyAuth |
Example HTTP response
Response 200
{
"code" : 0,
"msg" : "Success."
}
Atomically update a Cloud Diversion Site Policy for a customer.
POST /spe/common/customer/{customer_id}/diversion/sites/{site_id}/policy
Description
Merges the submitted fields into the target Customer Site’s saved Policy, validates the complete target, and saves it atomically. Success means the Policy was accepted and saved; it does not guarantee traffic switching has completed. Repeating an already-satisfied target is successful and has no downstream or audit side effect.
Parameters
| Type | Name | Description | Schema |
|---|---|---|---|
| Path | customer_id required |
Encrypted target Customer ID. | string |
| Path | site_id required |
Public Origin Protection Site ID. | string |
| Query | access_token required |
string | |
| Body | body required |
CloudDiversionSitePolicyUpdateRequest |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 200 | Configuration was accepted and saved, or a public business/parameter error was returned. | CloudDiversionSitePolicyUpdateResult |
Consumes
application/json
Produces
application/json
Security
| Type | Name |
|---|---|
| apiKey | ApiKeyAuth |
Example HTTP response
Response 200
{
"code" : 0,
"msg" : "Success."
}
Definitions
CloudDiversionNetworkGroupListResult
Paginated Cloud Diversion Network Group List response.
| Name | Schema |
|---|---|
| code optional |
integer |
| msg optional |
string |
| result optional |
result |
| Name | Schema |
|---|---|
| items optional |
< items > array |
| page optional |
integer |
| page_size optional |
integer |
| total optional |
integer |
| total_pages optional |
integer |
| Name | Description | Schema |
|---|---|---|
| custom_enabled optional |
boolean | |
| description optional |
string | |
| name optional |
string | |
| network_count optional |
integer | |
| network_group_id optional |
Opaque Network Group identifier. | string |
| networks optional |
Normalized Protected Network CIDRs. This is the only member representation returned by this API. | < string > array |
| policy optional |
The Network Group’s own saved Policy, not an effective or inherited Policy. Supported modes are Detection OFF with off/divert, or Detection ON with monitor/auto_divert. This saved Policy is retained when Custom is off; the parent Site Policy applies in that state. | policy |
| Name | Schema |
|---|---|
| detection_enabled optional |
boolean |
| detection_template optional |
CloudDiversionSupportingConfiguration |
| diversion_mode optional |
enum (off, divert, monitor, auto_divert) |
| diversion_scope optional |
enum (off_net, on_net, off_net_and_on_net) |
| off_net_route_template optional |
CloudDiversionSupportingConfiguration |
| on_net_route_template optional |
CloudDiversionSupportingConfiguration |
| peer_group optional |
CloudDiversionSupportingConfiguration |
CloudDiversionNetworkGroupPolicyUpdateRequest
Only these fields are accepted. detection_enabled requires diversion_mode; diversion_mode alone is allowed only when compatible with the current Detection state. With Custom on, targets are Detection off plus off/divert, or Detection on plus monitor/auto_divert. A Custom-off target may submit only custom_enabled; while Custom stays off, Detection and Diversion Mode cannot be changed. Omitted fields retain their saved values.
| Name | Description | Schema |
|---|---|---|
| custom_enabled optional |
boolean | |
| detection_enabled optional |
When present, diversion_mode is required. | boolean |
| diversion_mode optional |
enum (off, divert, monitor, auto_divert) |
CloudDiversionResult
The returned Cloud Diversion result.
| Name | Description | Schema |
|---|---|---|
| code optional |
Error code. 0 means success. Non-zero values indicate validation, permission, ownership, or Cloud Diversion workflow errors. | integer |
| msg optional |
Response message. | string |
| result optional |
Cloud Diversion result. Write APIs return the normalized network when an operation succeeds. The status API also returns the current divert status. | result |
| Name | Description | Schema |
|---|---|---|
| network optional |
Normalized IPv4 /24 or IPv6 /48 network CIDR. | string |
| status optional |
Current divert status returned by the status API. Possible values include manual_in_progress, auto_in_progress, and inactive. | string |
CloudDiversionSiteListResult
Paginated Cloud Diversion Site List response.
| Name | Description | Schema |
|---|---|---|
| code optional |
Error code. 0 means success. | integer |
| msg optional |
Response message. | string |
| result optional |
result |
| Name | Schema |
|---|---|
| items optional |
< items > array |
| page optional |
integer |
| page_size optional |
integer |
| total optional |
integer |
| total_pages optional |
integer |
| Name | Description | Schema |
|---|---|---|
| ip_version optional |
Address family for this Site List item. | enum (ipv4, ipv6) |
| policy optional |
The Site’s complete saved Policy. Supported modes are Detection OFF with off, or Detection ON with monitor/auto_divert. Site Policy does not support manual divert. | policy |
| site_id optional |
Public Origin Protection Site ID reused by Cloud Diversion. | string |
| site_name optional |
Site name. | string |
| Name | Schema |
|---|---|
| detection_enabled optional |
boolean |
| detection_template optional |
CloudDiversionSupportingConfiguration |
| diversion_mode optional |
enum (off, monitor, auto_divert) |
| diversion_scope optional |
enum (off_net, on_net, off_net_and_on_net) |
| off_net_route_template optional |
CloudDiversionSupportingConfiguration |
| on_net_route_template optional |
CloudDiversionSupportingConfiguration |
| peer_group optional |
CloudDiversionSupportingConfiguration |
CloudDiversionSitePolicyUpdateRequest
Only these fields are accepted. Site targets are Detection OFF+off or Detection ON+monitor/auto_divert. Site Policy does not support manual divert; omitted fields keep their saved values.
| Name | Description | Schema |
|---|---|---|
| detection_enabled optional |
When present, diversion_mode is required. | boolean |
| diversion_mode optional |
enum (off, monitor, auto_divert) |
CloudDiversionSitePolicyUpdateResult
| Name | Description | Schema |
|---|---|---|
| code optional |
integer | |
| msg optional |
string | |
| result optional |
Always null for this write operation. | object |
CloudDiversionSupportingConfiguration
A read-only supporting configuration reference. Unconfigured references are null. Deleted references retain id and return name as null.
| Name | Schema |
|---|---|
| id optional |
string |
| name optional |
string |
Security
ApiKeyAuth
Type : apiKey
Name : access_token
In : QUERY