• Virtual Private Cloud

vpc
  1. Help Center
  2. Virtual Private Cloud
  3. API Reference
  4. APIs
  5. VPC Route
  6. Creating a VPC Route

Creating a VPC Route

Function

This interface is used to create a route.

URI

POST /v2.0/vpc/routes

Request Message

  • Request parameter
    Table 1 Request parameter

    Parameter

    Type

    Mandatory

    Description

    route

    Dict

    Yes

    Specifies the route object list. For details, see Table 1.

    Mandatory fields: destinationnexthoptype, and vpc_id

  • Example request
    POST /v2.0/vpc/routes 
    { 
        "route": { 
            "type": "peering",  
            "nexthop": "60c809cb-6731-45d0-ace8-3bf5626421a9",  
            "destination": "192.168.200.0/24",  
            "vpc_id": "ab78be2d-782f-42a5-aa72-35879f6890ff"
        }
    }

Response Message

  • Response parameter
    Table 2 Response parameter

    Parameter

    Type

    Description

    route

    Dict

    Specifies the route object list. For details, see Table 1.

  • Example response
    { 
        "route": { 
            "type": "peering",  
            "nexthop": "60c809cb-6731-45d0-ace8-3bf5626421a9",  
            "destination": "192.168.200.0/24",  
            "vpc_id": "ab78be2d-782f-42a5-aa72-35879f6890ff",  
            "tenant_id": "6fbe9263116a4b68818cf1edce16bc4f",
            "id": "3d42a0d4-a980-4613-ae76-a2cddecff054" 
        }
    }

Status Codes

For details, see section Status Codes.