Skip to main content
Resource Center/Network Service/Network Service Operations/Security Group Operations
POSTSecurity Group OperationsSince 0.6SynchronousAuth Required

AttachSecurityGroupToL3Network

AttachSecurityGroupToL3Network

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Path Parameters

Request Inputs

Path Parameters

  • securityGroupUuidStringRequired

    The security group UUID.

  • l3NetworkUuidStringRequired

    The L3 network UUID.

Body Fields

  • systemTagsList

    Optional. The system tags.

  • userTagsList

    Optional. The user tags.

Responses

200 OK

On success, this API returns the following response structure.

  • successbooleanRequired

    操作是否成功。

  • errorErrorCodeRequired

    The error code. If not null, the operation fails, or vice versa. For more information, see error.

    • codeStringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      The brief description of the error.

    • detailsStringRequired

      The details about the error.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

  • inventorySecurityGroupInventoryRequired

    See inventory.

    • uuidStringRequired

      The resource UUID.

    • nameStringRequired

      The resource name.

    • descriptionStringRequired

      The detailed description of the resource.

    • stateStringRequired

      当前状态。

    • ipVersionIntegerRequired

      The IP version.

    • createDateTimestampRequired

      The creation date.

    • lastOpDateTimestampRequired

      The last operation date.

    • attachedL3NetworkUuidsSetRequired

      No description provided.

    • rulesListRequired

      See rules.

      • uuidStringRequired

        The resource UUID.

      • securityGroupUuidStringRequired

        The security group UUID.

      • typeStringRequired

        The traffic type.

      • ipVersionIntegerRequired

        The IP version.

      • startPortIntegerRequired

        If the protocol is TCP or UDP, this parameter is the start port of the port range. If the protocol is ICMP, this parameter is the ICMP type.

      • endPortIntegerRequired

        If the protocol is TCP or UDP, this parameter is the end port of the port range. If the protocol is ICMP, this parameter is the ICMP type.

      • protocolStringRequired

        The traffic protocol type.

      • stateStringRequired

        The rule state, which is not implemented in the current version.

      • allowedCidrStringRequired

        The allowed CIDR, which has different meanings according to different traffic types. If the traffic type is Ingress, the allowed CIDR is a source CIDR that is allowed to access VM NICs. If the traffic type is Egress, the allowed CIDR is a destination CIDR that is allowed to leave from VM NICs.

      • remoteSecurityGroupUuidStringRequired

        远程安全组UUID。

      • createDateTimestampRequired

        The creation date.

      • lastOpDateTimestampRequired

        The last operation date.

Endpoint

POST/zstack/v1/security-groups/{securityGroupUuid}/l3-networks/{l3NetworkUuid}

/zstack/v1/security-groups/{securityGroupUuid}/l3-networks/{l3NetworkUuid}

Operation ID

AttachSecurityGroupToL3Network

Permalink

Request Example

curl -X POST 'http://{host}/zstack/v1/security-groups/{securityGroupUuid}/l3-networks/{l3NetworkUuid}' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "uuid": "5870eab620d2487d8d0320eabe185718", "name": "web", "description": "for test", "state": "Enabled", "createDate": "Jun 7, 2017 9:20:28 PM", "lastOpDate": "Jun 7, 2017 9:20:28 PM", "internalId": 0 } }

Change History

This API has no change history records yet.

View all change history