Skip to content

Commit

Permalink
Fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
duanliguo committed May 14, 2023
1 parent 5d732f0 commit 24d4848
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bce/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

// Constants and default values for the package bce
const (
SDK_VERSION = "0.9.149"
SDK_VERSION = "0.9.150"
URI_PREFIX = "/" // now support uri without prefix "v1" so just set root path
DEFAULT_DOMAIN = "baidubce.com"
DEFAULT_PROTOCOL = "http"
Expand Down
6 changes: 0 additions & 6 deletions doc/BCI.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,8 @@ args := &CreateInstanceArgs{
EipRouteType: "BGP",
// 公网带宽,单位为Mbps
EipBandwidthInMbps: 1,
// 付款时间
EipPaymentTiming: "Postpaid",
// 计费方式
EipBillingMethod: "ByTraffic",
// 支持创建 EIP同时开通自动续费单位
EipAutoRenewTimeUnit: "month",
// 支持创建 EIP同时开通自动续费时间
EipAutoRenewTime: 1,
// 实例所需的 CPU 资源型号
CPUType: "intel",
// 实例所需的 GPU 资源型号
Expand Down
2 changes: 1 addition & 1 deletion doc/VPC.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ fmt.Println("VPC subnets: ", result.VPC.Subnets)
fmt.Println("VPC secondaryCidr: ", result.VPC.SecondaryCidr)
```

查询得到的VPC详情信息包括名称、网段、描述等信息。
查询得到的VPC详情信息包括名称、网段、创建时间、描述等信息。

## 删除VPC

Expand Down
4 changes: 4 additions & 0 deletions services/bcc/api/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,10 @@ type CreateInstanceBySpecArgs struct {
KeypairId string `json:"keypairId"`
AutoRenewTimeUnit string `json:"autoRenewTimeUnit"`
AutoRenewTime int `json:"autoRenewTime"`
RaidId string `json:"raidId,omitempty"`
EnableNuma bool `json:"enableNuma,omitempty"`
DataPartitionType string `json:"dataPartitionType,omitempty"`
RootPartitionType string `json:"rootPartitionType,omitempty"`
CdsAutoRenew bool `json:"cdsAutoRenew"`
AspId string `json:"aspId"`
InternalIps []string `json:"internalIps,omitempty"`
Expand Down
1 change: 0 additions & 1 deletion services/bci/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ func TestClient_CreateInstance(t *testing.T) {
AutoCreateEip: false,
EipRouteType: "BGP",
EipBandwidthInMbps: 150,
EipPaymentTiming: "Postpaid",
EipBillingMethod: "ByTraffic",
Tags: []Tag{
{
Expand Down
3 changes: 0 additions & 3 deletions services/bci/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ type CreateInstanceArgs struct {
EipName string `json:"eipName,omitempty"`
EipRouteType string `json:"eipRouteType,omitempty"`
EipBandwidthInMbps int `json:"eipBandwidthInMbps,omitempty"`
EipPaymentTiming string `json:"eipPaymentTiming,omitempty"`
EipBillingMethod string `json:"eipBillingMethod,omitempty"`
EipAutoRenewTimeUnit string `json:"eipAutoRenewTimeUnit,omitempty"`
EipAutoRenewTime int `json:"eipAutoRenewTime,omitempty"`
CPUType string `json:"cpuType,omitempty"`
GPUType string `json:"gpuType,omitempty"`
TerminationGracePeriodSeconds int64 `json:"terminationGracePeriodSeconds,omitempty"`
Expand Down
8 changes: 4 additions & 4 deletions services/bvw/api/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ type GetMaterialResponse struct {
UserID string `json:"userId,omitempty"`
ActualUserID string `json:"actualUserId,omitempty"`
SaasType string `json:"saasType,omitempty"`
InfoType []string `json:"infoType,omitempty"`
MediaType []string `json:"mediaType,omitempty"`
SourceType []string `json:"sourceType,omitempty"`
Status []string `json:"status,omitempty"`
InfoType string `json:"infoType,omitempty"`
MediaType string `json:"mediaType,omitempty"`
SourceType string `json:"sourceType,omitempty"`
Status string `json:"status,omitempty"`
Title string `json:"title,omitempty"`
SourceURL string `json:"sourceUrl,omitempty"`
SourceURL360P string `json:"sourceUrl360p,omitempty"`
Expand Down
7 changes: 6 additions & 1 deletion services/vpc/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,18 @@ func TestListVPC(t *testing.T) {
MaxKeys: 1000,
IsDefault: "false",
}
_, err := VPC_CLIENT.ListVPC(args)
res, err := VPC_CLIENT.ListVPC(args)
fmt.Println(res.VPCs[0].CreatedTime)
ExpectEqual(t.Errorf, nil, err)
r, err := json.Marshal(res)
fmt.Println(string(r))
}

func TestGetVPCDetail(t *testing.T) {
result, err := VPC_CLIENT.GetVPCDetail(VPCID)
ExpectEqual(t.Errorf, nil, err)
r, err := json.Marshal(result)
fmt.Println(string(r))
ExpectEqual(t.Errorf, "TestSDK-VPC", result.VPC.Name)
ExpectEqual(t.Errorf, "vpc test", result.VPC.Description)
ExpectEqual(t.Errorf, "192.168.0.0/16", result.VPC.Cidr)
Expand Down
2 changes: 2 additions & 0 deletions services/vpc/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ type VPC struct {
VPCID string `json:"vpcId"`
Name string `json:"name"`
Cidr string `json:"cidr"`
CreatedTime string `json:"createdTime"`
Description string `json:"description"`
IsDefault bool `json:"isDefault"`
SecondaryCidr []string `json:"secondaryCidr"`
Expand All @@ -154,6 +155,7 @@ type ShowVPCModel struct {
VPCId string `json:"vpcId"`
Name string `json:"name"`
Cidr string `json:"cidr"`
CreatedTime string `json:"createdTime"`
Description string `json:"description"`
IsDefault bool `json:"isDefault"`
Subnets []Subnet `json:"subnets"`
Expand Down

0 comments on commit 24d4848

Please sign in to comment.