EipTp Instance
Create a shared traffic package
- Certification is required for creating shared traffic package. Those who have not passed certification can go to the certification under security certification in the Baidu Open Cloud Official Website Console for certification.
Function declaration
1type CreateEipTpArgs struct {
2 ReservationLength int `json:"reservationLength,omitempty"`
3 Capacity string `json:"capacity,omitempty"`
4 DeductPolicy string `json:"deductPolicy,omitempty"`
5 PackageType string `json:"packageType,omitempty"`
6 ClientToken string `json:"-"`
7}
8type CreateEipTpResult struct {
9 Id string `json:"id,omitempty"`
10}
11func (c *Client) CreateEipTp(args *CreateEipTpArgs) (*CreateEipTpResult, error)
Parameter Meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/Nks7gtql8
Response Value
Operation succeeded:
1{
2 "id":"tp-xxxxxxxxxx"
3}
Operation failed:
Throw an exception. For the exception list, refer to https://cloud.baidu.com/doc/EIP/s/nkcu555a4
Code example
For specific code examples, please refer to example_eiptp_create_eiptp.go
Query shared traffic package details
- Retrieve detailed information about the shared traffic package.
Function declaration
1type EipTpDetail struct {
2 Id string `json:"id,omitempty"`
3 DeductPolicy string `json:"deductPolicy,omitempty"`
4 PackageType string `json:"packageType,omitempty"`
5 Status string `json:"status,omitempty"`
6 Capacity string `json:"capacity,omitempty"`
7 UsedCapacity string `json:"usedCapacity,omitempty"`
8 ActiveTime string `json:"activeTime,omitempty"`
9 ExpireTime string `json:"expireTime,omitempty"`
10 CreateTime string `json:"createTime,omitempty"`
11}
12func (c *Client) GetEipTp(id string) (*EipTpDetail, error)
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/uks7gy2lj
Response value
Operation succeeded:
1{
2 "id": "tp-xxxxxxxxxx",
3 "deductPolicy": "FullTimeDurationPackage",
4 "packageType": "WebOutBytes",
5 "status": "RUNNING",
6 "capacity": "322122547200.00",
7 "usedCapacity": "0.00",
8 "activeTime": "2023-11-28T09:50:57Z",
9 "expireTime": "2024-05-28T09:50:57Z",
10 "createTime": "2023-11-28T09:50:08Z"
11}
Operation failed:
Throw an exception. For the exception list, refer to https://cloud.baidu.com/doc/EIP/s/nkcu555a4
Code example
For specific code examples, please refer to example_eiptp_get_eiptp.go
Query shared traffic package list
- Search the shared traffic package list using multiple filtering conditions.
- If no specific criteria are given, the system will default to querying all shared traffic packages.
- The results returned will reflect the intersection of the provided conditions. Specifically, when multiple conditions are applied, only shared traffic packages meeting all the conditions simultaneously will be returned.
- The query results support marker-based pagination, with a default page size of 1,000. You can adjust this by setting the maxKeys parameter.
Function declaration
1type ListEipTpArgs struct {
2 Id string `json:"id,omitempty"`
3 DeductPolicy string `json:"deductPolicy,omitempty"`
4 Status string `json:"status,omitempty"`
5 Marker string `json:"marker"`
6 MaxKeys int `json:"maxKeys"`
7}
8type ListEipTpResult struct {
9 Marker string `json:"marker"`
10 MaxKeys int `json:"maxKeys"`
11 NextMarker string `json:"nextMarker"`
12 IsTruncated bool `json:"isTruncated"`
13 PackageList []Package `json:"packageList"`
14}
15type Package struct {
16 Id string `json:"id,omitempty"`
17 DeductPolicy string `json:"deductPolicy,omitempty"`
18 PackageType string `json:"packageType,omitempty"`
19 Status string `json:"status,omitempty"`
20 Capacity string `json:"capacity,omitempty"`
21 UsedCapacity string `json:"usedCapacity,omitempty"`
22 ActiveTime string `json:"activeTime"`
23 ExpireTime string `json:"expireTime"`
24 CreateTime string `json:"createTime"`
25}
26func (c *Client) ListEipTp(args *ListEipTpArgs) (*ListEipTpResult, error)
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/mks7gz0vq
Response value
Operation succeeded:
1{
2 "marker": "tp-xxxxxxxxxx",
3 "maxKeys": 1000,
4 "nextMarker": "",
5 "isTruncated": false,
6 "packageList": [
7 {
8 "id": "tp-xxxxxxxxxx",
9 "deductPolicy": "FullTimeDurationPackage",
10 "packageType": "WebOutBytes",
11 "status": "RUNNING",
12 "capacity": "322122547200.00",
13 "usedCapacity": "0.00",
14 "activeTime": "2023-11-28T09:50:57Z",
15 "expireTime": "2024-05-28T09:50:57Z",
16 "createTime": "2023-11-28T09:50:08Z"
17 },
18 ...
19 ]
20}
Operation failed:
Throw an exception. For the exception list, refer to https://cloud.baidu.com/doc/EIP/s/nkcu555a4
Code example
For specific code examples, please refer to example_eiptp_list_eiptp.go
