DescribeInstanceAvailableSecurityGroupResources

DescribeInstanceAvailableSecurityGroupResources

1. API Description

The API is used to obtain security groups available to be applied to an instance.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

instanceId

Yes

String

Instance ID.

3. Output Parameters

Parameter Name
Type
Description

requestId

String

The unique request ID, which is returned for each request. RequestId is required for locating a problem.

instanceAvailableSecurityGroups

All available security groups.

4. Code Example

Obtain security groups available to be applied to an instance.

POST /api/v2/vm HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeInstanceAvailableSecurityGroupResources
<Common Request Params>

Request:
{
  "instanceId": "your-instance-id"
}

Response:
{
  "requestId": "T728669AE-9EC6-463E-8728-F49DE5C2BC67",
  "response": {
    "requestId": "T728669AE-9EC6-463E-8728-F49DE5C2BC67",
    "instanceAvailableSecurityGroups": [
      {
        "securityGroupId": "your-seucurity-id-1",
        "securityGroupName": "redis-security",
        "isDefault": true
      },
      {
        "securityGroupId": "your-seucurity-id-2",
        "securityGroupName": "default-web-80-security",
        "isDefault": false
      },
      {
        "securityGroupId": "your-seucurity-id-3",
        "securityGroupName": "cluster-nginx-security",
        "isDefault": true
      }
    ]
  }
}

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

No error codes related to the API business logic. For other error codes, see Common Error Codes.​

Last updated