百度智能云

All Product Document

          Virtual Private Cloud

          Update Security Rule

          Description

          Update the security group rule information.

          Request Structure

          PUT /v{version}/securityGroup/rule/update?sgVersion={sgVersion}
          Host: bcc.bj.baidubce.com
          Authorization: authorization string
          
          {"name":"test","description":""}

          Request Header Field

          No other special header fields are available except for the public header field.

          Request Parameters

          Parameter Name Type Required? Parameter Position Description
          version String Yes URL parameter API version number
          sgVersion long No Query parameters Version number of the security group
          securityGroupRuleId String Yes RequestBody parameter Security group rule id
          remark String No RequestBody parameter Description
          portRange String No RequestBody parameter Port range
          sourceIp String No RequestBody parameter Inbound rule Ip, which cannot exist together with sourceGroupId simultaneously.
          sourceGroupId String No RequestBody parameter Inbound rule security id, which cannot exist together with sourceIp simultaneously.
          destIp String No RequestBody parameter Outbound rule Ip, which cannot exist together with destGroupId simultaneously.
          destGroupId String No RequestBody parameter Outbound rule security id, which cannot exist together with destIp simultaneously.
          protocol String No RequestBody parameter Protocol, which does not support the conversion from tcp/udp to icmp temporarily.

          Return Header Field

          No other special header fields are available except for the public header field.

          Return Parameter

          No return parameter.

          Error Code

          Error Code Error Description HTTP Status Code Explanation
          VersionMismatch The sgVersion is mismatched. 400 The version number of the specified security group rule is identical to the current latest version number. If no sgVersion parameter exists in the request, do not return the error code.
          NoSuchObject Resource not exist. 404 The security group rule does not exist.
          InvalidProtocolException Invalid protocol 400 Protocol error, transfer to ICMP is not supported.
          SecurityGroup.RuleCIDRAddressError The security group rule ip(cidr) address is incorrect. 400 The security group rule source (destination) address is incorrect.
          SecurityGroup.RuleRemarkTooLong Security group description is too long 400 The description exceeds the length limit.
          SecurityGroup.RulePortInvalid The value of the security group rule port must be number 400 The value of the security group rule port exceeds the limit.
          BadRequest protocol is invalid. 400 The protocol type is incorrect.

          Request Example

          PUT /v2/securityGroup/rule/update
          Host: bcc.bj.baidubce.com
          Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2017-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
          
          {"remark":"test"}

          Return Example

          HTTP/1.1 200 OK
          x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
          Date: Thu, 16 Mar 2017 06:29:48 GMT
          Content-Type: application/json;charset=UTF-8
          Server: BWS
          Previous
          Revoke Security Group Rule
          Next
          Service Network Interface Card Related Interfaces