doc-exports/docs/vpc/api-ref/vpc_network_0004.html
gtema 4cfecba474 VPC api from PR#278
Reviewed-by: Kucerak, Kristian <kristian.kucerak@t-systems.com>
Co-authored-by: gtema <artem.goncharov@gmail.com>
Co-committed-by: gtema <artem.goncharov@gmail.com>
2022-10-17 12:39:05 +00:00

22 KiB

Updating a Network

Function

This API is used to update a network.

URI

PUT /v2.0/networks/{network_id}

Table 1 describes the parameters.

Table 1 Parameter description

Name

Mandatory

Description

network_id

Yes

Specifies the network ID.

Request Message

Table 2 Request parameter

Parameter

Type

Mandatory

Description

network

network object

Yes

Specifies the network. For details, see Table 3.

You must specify at least one attribute when updating a network.

Table 3 network objects

Attribute

Mandatory

Type

Description

name

No

String

Specifies the network name.

The name cannot be the same as the admin_external_net value.

admin_state_up

No

Boolean

Specifies the administrative status.

The value can only be true.

port_security_enabled

No

Boolean

Specifies whether the security option is enabled for the port. If the option is not enabled, the security group and DHCP snooping settings of all VMs in the network do not take effect.

Response Message

Table 4 Response parameter

Parameter

Type

Description

network

network object

Specifies the network. For details, see Table 5.

Table 5 network objects

Attribute

Type

Description

status

String

Specifies the network status. The value can be ACTIVE, BUILD, DOWN, or ERROR.

subnets

Array of strings

Specifies IDs of the subnets associated with this network. The IDs are in a list.

Only one subnet can be associated with each network.

name

String

Specifies the network name.

The name cannot be the same as the admin_external_net value.

router:external

Boolean

Specifies whether the network is an external network. This is an extended attribute.

admin_state_up

Boolean

Specifies the administrative status.

The value can only be true.

tenant_id

String

Specifies the project ID.

shared

Boolean

Specifies whether the firewall rule can be shared by different tenants.

id

String

Specifies the network ID.

This parameter is not mandatory when you query networks.

provider:network_type

String

Specifies the network type. Only the VXLAN and GENEVE networks are supported. This is an extended attribute.

Tenants can create only networks whose type is geneve.

port_security_enabled

Boolean

Specifies whether the security option is enabled for the port. If the option is not enabled, the security group and DHCP snooping settings of all VMs in the network do not take effect.

dns_domain

String

Specifies the default private network DNS domain address. The system automatically sets this parameter, and you are not allowed to configure or change the parameter value.

project_id

String

Specifies the project ID.

created_at

String

Specifies the time (UTC) when the network is created.

Format: yyyy-MM-ddTHH:mm:ss

updated_at

String

Specifies the time (UTC) when the network is updated.

Format: yyyy-MM-ddTHH:mm:ss

Example:

Example request

PUT https://{Endpoint}/v2.0/networks/c360322d-5315-45d7-b7d2-481f98c56edb
  
{
  "network": {
    "name": "network-test02"
  }
}

Example response

{
    "network": {
        "id": "c360322d-5315-45d7-b7d2-481f98c56edb",
        "name": "network-test02",
        "status": "ACTIVE",
        "shared": false,
        "subnets": [],
        "availability_zone_hints": [],
        "availability_zones": [
            "az2.dc2",
            "az5.dc5"
        ],
        "admin_state_up": true,
        "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
        "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
        "provider:network_type": "vxlan",
        "router:external": false,
        "port_security_enabled": true,
        "created_at": "2018-09-20T01:53:18",
        "updated_at": "2018-09-20T01:55:47"
    }
}

Status Code

See Status Codes.

Error Code

See Error Codes.