Skip to content

Commit

Permalink
Merge pull request #118 from phoenixnap/release/v5.1.0
Browse files Browse the repository at this point in the history
Release/5.1.0
  • Loading branch information
valerioponte authored Sep 25, 2024
2 parents fe33e8c + 8f36441 commit 079fc24
Show file tree
Hide file tree
Showing 24 changed files with 428 additions and 12 deletions.
2 changes: 1 addition & 1 deletion auditapi/VERSION.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package auditapi

const SdkVersion = "3.0.2"
const SdkVersion = "3.0.3"
2 changes: 1 addition & 1 deletion billingapi/VERSION.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package billingapi

const SdkVersion = "3.0.0"
const SdkVersion = "3.1.0"
2 changes: 1 addition & 1 deletion bmcapi/VERSION.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package bmcapi

const SdkVersion = "3.1.0"
const SdkVersion = "3.2.0"
2 changes: 1 addition & 1 deletion invoicingapi/VERSION.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package invoicingapi

const SdkVersion = "1.0.2"
const SdkVersion = "1.0.3"
2 changes: 1 addition & 1 deletion ipapi/VERSION.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package ipapi

const SdkVersion = "3.0.2"
const SdkVersion = "3.0.3"
2 changes: 1 addition & 1 deletion locationapi/VERSION.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package locationapi

const SdkVersion = "3.0.0"
const SdkVersion = "3.0.1"
2 changes: 1 addition & 1 deletion networkapi/VERSION.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package networkapi

const SdkVersion = "3.0.2"
const SdkVersion = "3.1.0"
2 changes: 1 addition & 1 deletion networkstorageapi/VERSION.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package networkstorageapi

const SdkVersion = "3.0.0"
const SdkVersion = "3.0.1"
2 changes: 1 addition & 1 deletion paymentsapi/VERSION.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package paymentsapi

const SdkVersion = "1.0.2"
const SdkVersion = "1.0.3"
2 changes: 1 addition & 1 deletion ranchersolutionapi/VERSION.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package ranchersolutionapi

const SdkVersion = "3.0.2"
const SdkVersion = "3.1.0"
2 changes: 1 addition & 1 deletion tagapi/VERSION.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package tagapi

const SdkVersion = "3.0.2"
const SdkVersion = "3.0.3"
119 changes: 119 additions & 0 deletions tests/network_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,125 @@ func (suite *NetworkApiTestSuite) TestDeletePublicNetworkIpBlocksByPublicNetwork
suite.verifyCalledOnce(expectationId)
}

func (suite *NetworkApiTestSuite) TestGetBgpPeerGroups() {
// Generate payload
request, response := TestUtilsImpl{}.generatePayloadsFrom("networkapi/bgp_peer_groups_get", "./payloads")

// Extract the response expectation id
expectationId := TestUtilsImpl{}.setupExpectation(request, response, 1)

// Fetch a map of query parameters
qpMap := TestUtilsImpl{}.generateQueryParams(request)

loc := fmt.Sprintf("%v", qpMap["location"])

// Operation Execution
result, _, _ := suite.apiClient.BGPPeerGroupsAPI.BgpPeerGroupsGet(suite.ctx).Location(loc).Execute()

// Convert the result and response body to json strings
jsonResult, _ := json.Marshal(result)
jsonResponseBody, _ := json.Marshal(response.Body)

suite.Equal(string(jsonResult), string(jsonResponseBody))

// Verify
suite.verifyCalledOnce(expectationId)
}

func (suite *NetworkApiTestSuite) TestCreateBgpPeerGroups() {
// Generate payload
request, response := TestUtilsImpl{}.generatePayloadsFrom("networkapi/bgp_peer_groups_post", "./payloads")

// Extract the response expectation id
expectationId := TestUtilsImpl{}.setupExpectation(request, response, 1)

body, _ := json.Marshal(request.Body.Json)
var bgpPeerGroupCreate networkapi.BgpPeerGroupCreate
json.Unmarshal(body, &bgpPeerGroupCreate)

// Operation Execution
result, _, _ := suite.apiClient.BGPPeerGroupsAPI.BgpPeerGroupsPost(suite.ctx).BgpPeerGroupCreate(bgpPeerGroupCreate).Execute()

// Convert the result and response body to json strings
jsonResult, _ := json.Marshal(result)
jsonResponseBody, _ := json.Marshal(response.Body)

suite.Equal(string(jsonResult), string(jsonResponseBody))

// Verify
suite.verifyCalledOnce(expectationId)
}

func (suite *NetworkApiTestSuite) TestGetBgpPeerGroupsByID() {
// Generate payload
request, response := TestUtilsImpl{}.generatePayloadsFrom("networkapi/bgp_peer_groups_get_by_id", "./payloads")

// Extract the response expectation id
expectationId := TestUtilsImpl{}.setupExpectation(request, response, 1)

bgpPeerGroupId := request.PathParameters["id"][0]

// Operation Execution
result, _, _ := suite.apiClient.BGPPeerGroupsAPI.BgpPeerGroupsPeerGroupIdGet(suite.ctx, bgpPeerGroupId).Execute()

// Convert the result and response body to json strings
jsonResult, _ := json.Marshal(result)
jsonResponseBody, _ := json.Marshal(response.Body)

suite.Equal(string(jsonResult), string(jsonResponseBody))

// Verify
suite.verifyCalledOnce(expectationId)
}

func (suite *NetworkApiTestSuite) TestDeleteBgpPeerGroupsByID() {
// Generate payload
request, response := TestUtilsImpl{}.generatePayloadsFrom("networkapi/bgp_peer_groups_delete_by_id", "./payloads")

// Extract the response expectation id
expectationId := TestUtilsImpl{}.setupExpectation(request, response, 1)

bgpPeerGroupId := request.PathParameters["id"][0]

// Operation Execution
result, _, _ := suite.apiClient.BGPPeerGroupsAPI.BgpPeerGroupsPeerGroupIdDelete(suite.ctx, bgpPeerGroupId).Execute()

// Convert the result and response body to json strings
jsonResult, _ := json.Marshal(result)
jsonResponseBody, _ := json.Marshal(response.Body)

suite.Equal(string(jsonResult), string(jsonResponseBody))

// Verify
suite.verifyCalledOnce(expectationId)
}

func (suite *NetworkApiTestSuite) TestPatchBgpPeerGroupsByID() {
// Generate payload
request, response := TestUtilsImpl{}.generatePayloadsFrom("networkapi/bgp_peer_groups_patch_by_id", "./payloads")

// Extract the response expectation id
expectationId := TestUtilsImpl{}.setupExpectation(request, response, 1)

bgpPeerGroupId := request.PathParameters["id"][0]

body, _ := json.Marshal(request.Body.Json)
var bgpPeerGroupPatch networkapi.BgpPeerGroupPatch
json.Unmarshal(body, &bgpPeerGroupPatch)

// Operation Execution
result, _, _ := suite.apiClient.BGPPeerGroupsAPI.BgpPeerGroupsPeerGroupIdPatch(suite.ctx, bgpPeerGroupId).BgpPeerGroupPatch(bgpPeerGroupPatch).Execute()

// Convert the result and response body to json strings
jsonResult, _ := json.Marshal(result)
jsonResponseBody, _ := json.Marshal(response.Body)

suite.Equal(string(jsonResult), string(jsonResponseBody))

// Verify
suite.verifyCalledOnce(expectationId)
}

func TestNetworkApiTestSuite(t *testing.T) {
suite.Run(t, new(NetworkApiTestSuite))
}
8 changes: 7 additions & 1 deletion tests/payloads/billingapi/products/products_get.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@
"coresPerCpu" : 5,
"cpuFrequency" : 5,
"network" : "network",
"storage" : "storage"
"storage" : "storage",
"gpuConfigurations": [
{
"count": 10,
"name": "gpu"
}
]
}
}
]
Expand Down
4 changes: 4 additions & 0 deletions tests/payloads/bmcapi/servers/servers_action_provision.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@
"raid": "NO_RAID",
"size": -1
}
},
"gpuConfiguration": {
"longName": "Nvideo PTX 5090X",
"count": 3
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions tests/payloads/bmcapi/servers/servers_action_reserve.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@
"raid": "NO_RAID",
"size": -1
}
},
"gpuConfiguration": {
"longName": "Nvideo PTX 5090X",
"count": 3
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions tests/payloads/bmcapi/servers/servers_get.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@
"raid": "NO_RAID",
"size": -1
}
},
"gpuConfiguration": {
"longName": "Nvideo PTX 5090X",
"count": 3
}
}
]
Expand Down
4 changes: 4 additions & 0 deletions tests/payloads/bmcapi/servers/servers_get_by_id.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@
"raid": "NO_RAID",
"size": -1
}
},
"gpuConfiguration": {
"longName": "Nvideo PTX 5090X",
"count": 3
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions tests/payloads/bmcapi/servers/servers_patch_by_id.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@
"raid": "NO_RAID",
"size": -1
}
},
"gpuConfiguration": {
"longName": "Nvideo PTX 5090X",
"count": 3
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions tests/payloads/bmcapi/servers/servers_post.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@
"raid": "NO_RAID",
"size": -1
}
},
"gpuConfiguration": {
"longName": "Nvideo PTX 5090X",
"count": 3
}
}
}
Expand Down
50 changes: 50 additions & 0 deletions tests/payloads/networkapi/bgp_peer_groups_delete_by_id.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"request": {
"method": "DELETE",
"path": "/networks/v1/bgp-peer-groups/{id}",
"pathParameters": {
"id": [
"e6afba51-7de8-4080-83ab-0f915570659c"
]
}
},
"response": {
"statusCode": 202,
"body": {
"id": "60473c2509268bc77fd06d29",
"status": "PENDING",
"location": "ASH",
"ipv4Prefixes": [
{
"ipv4AllocationId": "6047127fed34ecc3ba8402d2",
"cidr": "10.111.14.40/29",
"status": "READY",
"isBringYourOwnIp": false,
"inUse": false
}
],
"targetAsnDetails": {
"asn": 65401,
"isBringYourOwn": false,
"verificationStatus": "VERIFIED"
},
"activeAsnDetails": {
"asn": 65401,
"isBringYourOwn": false,
"verificationStatus": "VERIFIED"
},
"password": "E!73423ghhjfge45",
"advertisedRoutes": "NONE",
"rpkiRoaOriginAsn": 19437,
"eBgpMultiHop": 7,
"peeringLoopbacksV4": [
"169.254.247.0",
"169.254.247.1"
],
"keepAliveTimerSeconds": 10,
"holdTimerSeconds": 30,
"createdOn": "2024-03-01T10:30:00Z",
"lastUpdatedOn": "2024-03-01T14:30:00Z"
}
}
}
55 changes: 55 additions & 0 deletions tests/payloads/networkapi/bgp_peer_groups_get.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"request": {
"method": "GET",
"path": "/networks/v1/bgp-peer-groups",
"queryStringParameters": [
{
"name": "location",
"values": [
"PHX"
]
}
]
},
"response": {
"statusCode": 200,
"body": [
{
"id": "60473c2509268bc77fd06d29",
"status": "PENDING",
"location": "ASH",
"ipv4Prefixes": [
{
"ipv4AllocationId": "6047127fed34ecc3ba8402d2",
"cidr": "10.111.14.40/29",
"status": "READY",
"isBringYourOwnIp": false,
"inUse": false
}
],
"targetAsnDetails": {
"asn": 65401,
"isBringYourOwn": false,
"verificationStatus": "VERIFIED"
},
"activeAsnDetails": {
"asn": 65401,
"isBringYourOwn": false,
"verificationStatus": "VERIFIED"
},
"password": "E!73423ghhjfge45",
"advertisedRoutes": "NONE",
"rpkiRoaOriginAsn": 19437,
"eBgpMultiHop": 7,
"peeringLoopbacksV4": [
"169.254.247.0",
"169.254.247.1"
],
"keepAliveTimerSeconds": 10,
"holdTimerSeconds": 30,
"createdOn": "2024-03-01T10:30:00Z",
"lastUpdatedOn": "2024-03-01T14:30:00Z"
}
]
}
}
Loading

0 comments on commit 079fc24

Please sign in to comment.