Updates the virtual private cloud (VPC) that is bound to a namespace.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation does not have operation-specific request headers and uses only common request headers. For more information, see Common request and response headers.

Request syntax

POST /pop/v1/sam/namespace/updateNamespaceVpc HTTP/1.1

Request parameters

Parameter Type Position Required Example Description
NamespaceId String Query No cn-beijing:test

The long ID of the namespace. If you configure this parameter, the long ID take effects and the value of the NameSpaceShortId parameter is ignored. To ensure compatibility, we recommend that you specify a short namespace ID.

VpcId String Query Yes vpc-2ze0i263cnn311nvj****

The VPC ID. The value of this parameter is used to replace the existing VPC ID.

NameSpaceShortId String Query No test

The short ID of the namespace. You do not need to specify a region ID. We recommend that you configure this parameter.

Response parameters

Parameter Type Example Description
RequestId String 91F93257-7A4A-4BD3-9A7E-2F6EAE6D****

The request ID.

Message String success

The returned message. Valid values:

  • success: If the call is successful, success is returned.
  • An error code: If the call fails, an error code is returned.
TraceId String 0a98a02315955564772843261e****

The trace ID that is used to query the details of the request.

ErrorCode String Null

The error code. Valid values:

  • If the call is successful, the ErrorCode parameter is not returned.
  • If the call fails, the ErrorCode parameter is returned. For more information, see the "Error codes" section in this topic.
Code String 200

The HTTP status code. Valid values:

  • 2xx: The call was successful.
  • 3xx: The call was redirected.
  • 4xx: The call failed.
  • 5xx: A server error occurred.
Success Boolean true

Indicates whether the VPC was updated. Valid values:

  • true: The VPC was updated.
  • false: The VPC failed to be updated.

Examples

Sample requests

POST /pop/v1/sam/namespace/updateNamespaceVpc?NameSpaceShortId=test&VpcId=vpc-2ze0i263cnn311nvj**** HTTP/1.1
Host:sae.aliyuncs.com
Content-Type:application/json

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UpdateNamespaceVpcResponse>
    <RequestId>91F93257-7A4A-4BD3-9A7E-2F6EAE6D****</RequestId>
    <Message>success</Message>
    <TraceId>0a98a02315955564772843261e****</TraceId>
    <Code>200</Code>
    <Success>true</Success>
</UpdateNamespaceVpcResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
  "Message" : "success",
  "TraceId" : "0a98a02315955564772843261e****",
  "Code" : "200",
  "Success" : true
}

Error codes

HTTP status code Error code Error message Description
400 DeleteFail.NamespaceHasIngress Ingress detected when deleting the namespace. The namespace that you want to delete contains routing rules.
400 Namespace.AppExists Please delete the application first. The namespace contains applications. Remove the applications and try again.

For a list of error codes, see Service error codes.