Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion openstack/cce/v3/nodes/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type Spec struct {
// Number of nodes when creating in batch
Count int `json:"count" required:"true"`
// Extended parameter
ExtendParam string `json:"extendParam,omitempty"`
ExtendParam ExtendParam `json:"extendParam,omitempty"`
}

// Gives the current status of the node
Expand Down Expand Up @@ -96,6 +96,20 @@ type VolumeSpec struct {
ExtendParam string `json:"extendParam,omitempty"`
}

type ExtendParam struct {
// Node charging mode, 0 is on-demand charging.
ChargingMode int `json:"chargingMode,omitempty"`
// Classification of cloud server specifications.
EcsPerformanceType string `json:"ecs:performancetype,omitempty"`
// Order ID, mandatory when the node payment type is the automatic payment package period type.
OrderID string `json:"orderID,omitempty"`
// The Product ID.
ProductID string `json:"productID,omitempty"`
PublicKey string `json:"publicKey,omitempty"`
// The maximum number of instances a node is allowed to create.
MaxPods int `json:"maxPods,omitempty"`
}

type PublicIPSpec struct {
// List of existing elastic IP IDs
Ids []string `json:"ids,omitempty"`
Expand Down
3 changes: 2 additions & 1 deletion openstack/cce/v3/nodes/testing/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ var Expected = &nodes.Nodes{
Login: nodes.LoginSpec{
SshKey: "test-keypair",
},
PublicIP: nodes.PublicIPSpec{Eip: nodes.EipSpec{Bandwidth: nodes.BandwidthOpts{}, IpType: ""}},
ExtendParam: nodes.ExtendParam{},
PublicIP: nodes.PublicIPSpec{Eip: nodes.EipSpec{Bandwidth: nodes.BandwidthOpts{}, IpType: ""}},
RootVolume: nodes.VolumeSpec{
VolumeType: "SATA",
Size: 40,
Expand Down
2 changes: 2 additions & 0 deletions openstack/cce/v3/nodes/testing/requests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ func TestCreateV3Node(t *testing.T) {
"spec": {
"az": "cn-east-2a",
"count": 1,
"extendParam": {
},
"dataVolumes": [
{
"size": 100,
Expand Down