服务网卡
创建服务网卡
创建服务网卡,返回分配的服务地址及实例ID。
使用以下代码可以创建服务网卡实例
函数声明
1func (c *Client) CreateEndpoint(args *CreateEndpointArgs) (*CreateEndpointResult, error)
            参数含义
请参考OpenAPI文档: 创建服务网卡
返回值
操作成功:
1{
2    "id": "endpoint-11b09ce6",
3    "ipAddress": "192.168.0.1"
4} 
            操作失败:
抛出异常,异常列表参考:异常列表
代码示例
具体代码示例参考:example_create_endpoint.go
查询服务网卡列表
查询服务网卡列表。
使用以下代码可以查询服务网卡列表
函数声明
1func (c *Client) ListEndpoints(args *ListEndpointArgs) (*ListEndpointResult, error)
            参数含义
请参考OpenAPI文档:查询服务网卡列表
返回值
操作成功:
1{
2    "nextMarker": "endpoint-11a09ce9",
3    "marker": "endpoint-11a09ce9",
4    "maxKeys": 1,
5    "isTruncated": true,
6    "result": [
7        {
8            "endpointId': "endpoint-11a09ce9",
9            "name": "name",
10            "ipAddress": "192.168.0.5",
11            "status": "available",
12            "service": "www.test.com",
13            "subnetId": "sbn-crqu2vxzj049",             
14            "createTime": "2019-03-07T02:35:31Z",
15            "description": "",
16          "productType": "postpay",
17          "vpcId": "vpc-q1hcnhf7nmve"
18        }
19    ]
20}  
            操作失败:
抛出异常,异常列表参考:异常列表
代码示例
具体代码示例参考:example_list_endpoints.go
查询服务网卡详情
查询服务网卡详情。
使用以下代码可以查询服务网卡详情
函数声明
1func (c *Client) GetEndpointDetail(endpointId string) (*Endpoint, error)
            参数含义
请参考OpenAPI文档:查询服务网卡详情
返回值
操作成功:
1{
2    "endpointId': "endpoint-11a09ce9",
3    "name": "name", 
4    "ipAddress": "192.168.0.5",
5    "status": "available",
6    "service": "www.test.com",
7    "subnetId": "sbn-crqu2vxzj049",             
8    "createTime": "2019-03-07T02:35:31Z",
9    "description": "",
10      "productType": "postpay",
11      "vpcId": "vpc-q1hcnhf7nmve"
12}   
            操作失败:
抛出异常,异常列表参考:异常列表
代码示例
具体代码示例参考:example_get_endpoint_detail.go
删除服务网卡
删除服务网卡。
使用以下代码可以删除服务网卡
函数声明
1func (c *Client) DeleteEndpoint(endpointId string, clientToken string) error
            参数含义
请参考OpenAPI文档: 删除服务网卡
返回值
操作成功:
返回200
操作失败:
抛出异常,异常列表参考:异常列表
代码示例
具体代码示例参考:example_delete_endpoint.go
更新服务网卡
更新服务网卡,name、description不能同时为空
使用以下代码可以更新服务网卡
函数声明
1func (c *Client) UpdateEndpoint(endpointId string, args *UpdateEndpointArgs) error
            参数含义
请参考OpenAPI文档: 更新服务网卡
返回值
操作成功:
返回200
操作失败:
抛出异常,异常列表参考:异常列表
代码示例
具体代码示例参考:example_update_endpoint.go
查询可挂载的公共服务
查询可挂载的公共服务。
使用以下代码可以查询可挂载的公共服务
函数声明
1func (c *Client) GetServices() (*ListServiceResult, error)
            参数含义
请参考OpenAPI文档: 查询可挂载的公共服务
返回值
操作成功:
1{
2    "services": [
3        "www.test.com",
4        "www.test2.com"
5    ]
6 } 
            操作失败:
抛出异常,异常列表参考:异常列表
代码示例
具体代码示例参考:example_get_services.go
服务网卡更新普通安全组
服务网卡更新绑定的普通安全组,服务网卡至少要有一个安全组,该操作是服务网卡最终加入的安全组,并会移出已有的安全组。
使用以下代码可以更新服务网卡普通安全组
函数声明
1func (c *Client) UpdateEndpointNormalSecurityGroup(endpointId string, args *UpdateEndpointNSGArgs) error
            参数含义
请参考OpenAPI文档: 服务网卡更新普通安全组
返回值
操作成功:
返回200
操作失败:
抛出异常,异常列表参考:异常列表
代码示例
具体代码示例参考:example_update_normal_security_group.go
服务网卡更新企业安全组
服务网卡更新绑定的企业安全组。服务网卡至少要有一个安全组(普通安全组或者企业安全组),该操作是服务网卡最终加入的企业安全组,并会移出已有的安全组(普通安全组或者企业安全组),目前每个服务网卡实例最多支持绑定1个企业安全组。
使用以下代码可以更新服务网卡企业安全组
函数声明
1func (c *Client) UpdateEndpointEnterpriseSecurityGroup(endpointId string, args *UpdateEndpointESGArgs) error
            参数含义
请参考OpenAPI文档: 服务网卡更新企业安全组
返回值
操作成功:
返回200
操作失败:
抛出异常,异常列表参考:异常列表
代码示例
