Skip to content
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2022.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -34,6 +34,8 @@ public interface Status {
String PENDING = "pending";
}

@SerializedName("advertised_routes")
protected List<RouteReportAdvertisedRoute> advertisedRoutes;
@SerializedName("created_at")
protected Date createdAt;
@SerializedName("gateway_routes")
Expand All @@ -49,6 +51,20 @@ public interface Status {
@SerializedName("virtual_connection_routes")
protected List<RouteReportConnection> virtualConnectionRoutes;

protected RouteReport() { }

/**
* Gets the advertisedRoutes.
*
* Array of connection prefixes advertised to the on-prem network. This parameter is not returned when the route
* report was generated prior to inclusion of this parameter.
*
* @return the advertisedRoutes
*/
public List<RouteReportAdvertisedRoute> getAdvertisedRoutes() {
return advertisedRoutes;
}

/**
* Gets the createdAt.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.ibm.cloud.networking.direct_link.v1.model;

import com.google.gson.annotations.SerializedName;
import com.ibm.cloud.sdk.core.service.model.GenericModel;

/**
* Route advertised to the on-prem network.
*/
public class RouteReportAdvertisedRoute extends GenericModel {

@SerializedName("as_path")
protected String asPath;
protected String prefix;

protected RouteReportAdvertisedRoute() { }

/**
* Gets the asPath.
*
* The BGP AS path of the route.
*
* @return the asPath
*/
public String getAsPath() {
return asPath;
}

/**
* Gets the prefix.
*
* prefix.
*
* @return the prefix
*/
public String getPrefix() {
return prefix;
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2022.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -22,22 +22,24 @@
*/
public class RouteReportConnection extends GenericModel {

protected List<RouteReportRoute> routes;
protected List<RouteReportVirtualConnectionRoute> routes;
@SerializedName("virtual_connection_id")
protected String virtualConnectionId;
@SerializedName("virtual_connection_name")
protected String virtualConnectionName;
@SerializedName("virtual_connection_type")
protected String virtualConnectionType;

protected RouteReportConnection() { }

/**
* Gets the routes.
*
* Array of virtual connection's routes.
*
* @return the routes
*/
public List<RouteReportRoute> getRoutes() {
public List<RouteReportVirtualConnectionRoute> getRoutes() {
return routes;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,25 @@
*/
public class RouteReportOnPremRoute extends GenericModel {

@SerializedName("as_path")
protected String asPath;
@SerializedName("next_hop")
protected String nextHop;
protected String prefix;

protected RouteReportOnPremRoute() { }

/**
* Gets the asPath.
*
* The BGP AS path of the route.
*
* @return the asPath
*/
public String getAsPath() {
return asPath;
}

/**
* Gets the nextHop.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.ibm.cloud.networking.direct_link.v1.model;

import com.google.gson.annotations.SerializedName;
import com.ibm.cloud.sdk.core.service.model.GenericModel;

/**
* A route originating from an attached virtual connection.
*/
public class RouteReportVirtualConnectionRoute extends GenericModel {

protected Boolean active;
@SerializedName("local_preference")
protected String localPreference;
protected String prefix;

protected RouteReportVirtualConnectionRoute() { }

/**
* Gets the active.
*
* Indicates whether the route is the preferred path of the prefix.
*
* @return the active
*/
public Boolean isActive() {
return active;
}

/**
* Gets the localPreference.
*
* The local preference of the route. This attribute can manipulate the chosen path on routes.
*
* @return the localPreference
*/
public String getLocalPreference() {
return localPreference;
}

/**
* Gets the prefix.
*
* prefix.
*
* @return the prefix
*/
public String getPrefix() {
return prefix;
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2023.
* (C) Copyright IBM Corp. 2022.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

import java.text.SimpleDateFormat;


import com.ibm.cloud.networking.direct_link.v1.model.AsPrepend;
import com.ibm.cloud.networking.direct_link.v1.model.AsPrependCollection;
import com.ibm.cloud.networking.direct_link.v1.model.AsPrependEntry;
Expand Down Expand Up @@ -124,6 +123,7 @@
* How to run the tests:
* mvn -Dtest=DirectLinkIT -DfailIfNoTests=false test
*/
@Ignore("Ignoring it due to provisioning time and travis time-out")
public class DirectLinkIT extends SdkIntegrationTestBase {
// Directlink service v1 integration
public DirectLink testService = null;
Expand Down Expand Up @@ -277,13 +277,12 @@ private void cleanUpSDKGateways() {
}

// Delete the DL GW
DeleteGatewayOptions deleteGatewayOptionsModel1 = new DeleteGatewayOptions.Builder().id(gateway.getId()).build();
Response<Void> Delresponse1 = testService.deleteGateway(deleteGatewayOptionsModel1).execute();
assertNotNull(Delresponse1);
assertEquals(204, Delresponse1.getStatusCode());

Void delResponseObj1 = Delresponse1.getResult();
assertNull(delResponseObj1);
deleteGatewayOptionsModel = new DeleteGatewayOptions.Builder().id(gateway.getId()).build();
Delresponse = testService.deleteGateway(deleteGatewayOptionsModel).execute();
assertNotNull(Delresponse);
assertEquals(204, Delresponse.getStatusCode());
delResponseObj = Delresponse.getResult();
assertNull(delResponseObj);
}

}
Expand Down Expand Up @@ -332,7 +331,7 @@ private void deleteVirtualConnection(String gwId, String vcId) {
//
}
}
} catch (com.ibm.cloud.sdk.core.service.exception.NotFoundException nfe) {
} catch (NotFoundException nfe) {
// When the virtual connection no longer exists, this exception is thrown.
done = true;
}
Expand Down Expand Up @@ -865,8 +864,8 @@ public void testConnectGatewayReplaceAsPrependsWOptions() {
assertEquals(asPrependPrefixArrayTemplateModel.specificPrefixes(), as.getSpecificPrefixes());

}
@org.junit.Ignore
// @Test (dependsOnMethods = "testConnectGatewayOptions")

@Test (dependsOnMethods = "testConnectGatewayOptions")
public void testCreateGatewayAction() {

// Construct an instance of the CreateGatewayActionOptions model
Expand Down Expand Up @@ -1118,8 +1117,8 @@ public void testUpdateGatewayExportRouteFilter() {
UpdateGatewayExportRouteFilterOptions updateGatewayExportRouteFilterOptionsModel = new UpdateGatewayExportRouteFilterOptions.Builder()
.gatewayId(connectGatewayId)
.id(exportRFId)
.updateRouteFilterTemplatePatch(updateRouteFilterTemplateModelAsPatch)
.build();
.updateRouteFilterTemplatePatch(updateRouteFilterTemplateModelAsPatch)
.build();

// Invoke updateGatewayExportRouteFilter() with a valid options model and verify the result
Response<RouteFilter> responseObj = testService.updateGatewayExportRouteFilter(updateGatewayExportRouteFilterOptionsModel).execute();
Expand Down Expand Up @@ -1382,8 +1381,8 @@ public void testUpdateGatewayImportRouteFilter() {
UpdateGatewayImportRouteFilterOptions updateGatewayImportRouteFilterOptionsModel = new UpdateGatewayImportRouteFilterOptions.Builder()
.gatewayId(connectGatewayId)
.id(importRFId)
.updateRouteFilterTemplatePatch(updateRouteFilterTemplateModelAsPatch)
.build();
.updateRouteFilterTemplatePatch(updateRouteFilterTemplateModelAsPatch)
.build();

// Invoke updateGatewayImportRouteFilter() with a valid options model and verify the result
Response<RouteFilter> responseObj = testService.updateGatewayImportRouteFilter(updateGatewayImportRouteFilterOptionsModel).execute();
Expand Down Expand Up @@ -1523,7 +1522,7 @@ public void testDeleteGatewayImportRouteFilter() {
}

@Test (dependsOnMethods = "testDeleteGatewayImportRouteFilter")
public void testRouteReports() throws InterruptedException {
public void testRouteReports() throws InterruptedException {
assertNotNull(testService);

String rrID = null;
Expand All @@ -1537,6 +1536,8 @@ public void testRouteReports() throws InterruptedException {
RouteReport rrCreateRespObj = routeReportsResponse.getResult();
assertNotNull(rrCreateRespObj);
assertNotNull(rrCreateRespObj.getId());
assertNotNull(rrCreateRespObj.getGatewayRoutes());
assertNotNull(rrCreateRespObj.getVirtualConnectionRoutes());
assertNotEquals(rrCreateRespObj.getStatus(), "");
assertNotEquals(rrCreateRespObj.getCreatedAt(), "");
assertNotEquals(rrCreateRespObj.getUpdatedAt(), "");
Expand All @@ -1555,6 +1556,8 @@ public void testRouteReports() throws InterruptedException {
RouteReport rrGetRespObj = getRouteResponse.getResult();
assertNotNull(rrGetRespObj);
assertEquals(rrGetRespObj.getId(), rrID);
assertNotNull(rrGetRespObj.getGatewayRoutes());
assertNotNull(rrGetRespObj.getVirtualConnectionRoutes());
assertNotEquals(rrGetRespObj.getStatus(), "completed");
assertNotEquals(rrGetRespObj.getCreatedAt(), "");
assertNotEquals(rrGetRespObj.getUpdatedAt(), "");
Expand All @@ -1572,9 +1575,8 @@ public void testRouteReports() throws InterruptedException {
Response<Void> delResponse = testService.deleteGatewayRouteReport(deleteGatewayRouteReportOptions).execute();
assertNotNull(delResponse);
assertEquals(204, delResponse.getStatusCode());

checkRouteReportDeletion(getGatewayRouteReportOptions);

checkRouteReportDeletion(getGatewayRouteReportOptions);
}

// @Test (dependsOnMethods = "testCompletionNotice")
Expand Down
Loading