From 8325f57a82fabe706f8be81348f5390ec376115d Mon Sep 17 00:00:00 2001 From: ninja-vlogs Date: Mon, 29 Oct 2018 18:14:15 +0530 Subject: [PATCH] modify cce node extern_param parameter --- openstack/cce/v3/nodes/results.go | 16 +++++++++++++++- openstack/cce/v3/nodes/testing/fixtures.go | 3 ++- openstack/cce/v3/nodes/testing/requests_test.go | 2 ++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/openstack/cce/v3/nodes/results.go b/openstack/cce/v3/nodes/results.go index c9101d80d..2c4496dd3 100644 --- a/openstack/cce/v3/nodes/results.go +++ b/openstack/cce/v3/nodes/results.go @@ -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 @@ -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"` diff --git a/openstack/cce/v3/nodes/testing/fixtures.go b/openstack/cce/v3/nodes/testing/fixtures.go index 6de5c5f78..32d5550de 100644 --- a/openstack/cce/v3/nodes/testing/fixtures.go +++ b/openstack/cce/v3/nodes/testing/fixtures.go @@ -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, diff --git a/openstack/cce/v3/nodes/testing/requests_test.go b/openstack/cce/v3/nodes/testing/requests_test.go index dfae3d4cc..02f4c3801 100644 --- a/openstack/cce/v3/nodes/testing/requests_test.go +++ b/openstack/cce/v3/nodes/testing/requests_test.go @@ -138,6 +138,8 @@ func TestCreateV3Node(t *testing.T) { "spec": { "az": "cn-east-2a", "count": 1, + "extendParam": { + }, "dataVolumes": [ { "size": 100,