Skip to content

feat: directlink - dedicated vlan mapping #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 11, 2024
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2023.
* (C) Copyright IBM Corp. 2024.
*
* 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 @@ -12,7 +12,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 3.60.2-95dc7721-20221102-203229
* IBM OpenAPI SDK Code Generator Version: 3.80.0-29334a73-20230925-151553
*/

package com.ibm.cloud.networking.direct_link.v1;
Expand Down Expand Up @@ -42,6 +42,7 @@
import com.ibm.cloud.networking.direct_link.v1.model.GetGatewayExportRouteFilterOptions;
import com.ibm.cloud.networking.direct_link.v1.model.GetGatewayImportRouteFilterOptions;
import com.ibm.cloud.networking.direct_link.v1.model.GetGatewayOptions;
import com.ibm.cloud.networking.direct_link.v1.model.GetGatewayResponse;
import com.ibm.cloud.networking.direct_link.v1.model.GetGatewayRouteReportOptions;
import com.ibm.cloud.networking.direct_link.v1.model.GetGatewayStatisticsOptions;
import com.ibm.cloud.networking.direct_link.v1.model.GetGatewayStatusOptions;
Expand Down Expand Up @@ -260,9 +261,9 @@ public ServiceCall<Void> deleteGateway(DeleteGatewayOptions deleteGatewayOptions
* Retrieve a Direct Link gateway.
*
* @param getGatewayOptions the {@link GetGatewayOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link Gateway}
* @return a {@link ServiceCall} with a result of type {@link GetGatewayResponse}
*/
public ServiceCall<Gateway> getGateway(GetGatewayOptions getGatewayOptions) {
public ServiceCall<GetGatewayResponse> getGateway(GetGatewayOptions getGatewayOptions) {
com.ibm.cloud.sdk.core.util.Validator.notNull(getGatewayOptions,
"getGatewayOptions cannot be null");
Map<String, String> pathParamsMap = new HashMap<String, String>();
Expand All @@ -274,8 +275,8 @@ public ServiceCall<Gateway> getGateway(GetGatewayOptions getGatewayOptions) {
}
builder.header("Accept", "application/json");
builder.query("version", String.valueOf(this.version));
ResponseConverter<Gateway> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<Gateway>() { }.getType());
ResponseConverter<GetGatewayResponse> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<GetGatewayResponse>() { }.getType());
return createServiceCall(builder.build(), responseConverter);
}

Expand All @@ -299,56 +300,11 @@ public ServiceCall<Gateway> updateGateway(UpdateGatewayOptions updateGatewayOpti
}
builder.header("Accept", "application/json");
builder.query("version", String.valueOf(this.version));
final JsonObject contentJson = new JsonObject();
if (updateGatewayOptions.authenticationKey() != null) {
contentJson.add("authentication_key", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateGatewayOptions.authenticationKey()));
}
if (updateGatewayOptions.bfdConfig() != null) {
contentJson.add("bfd_config", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateGatewayOptions.bfdConfig()));
}
if (updateGatewayOptions.bgpAsn() != null) {
contentJson.addProperty("bgp_asn", updateGatewayOptions.bgpAsn());
}
if (updateGatewayOptions.bgpCerCidr() != null) {
contentJson.addProperty("bgp_cer_cidr", updateGatewayOptions.bgpCerCidr());
}
if (updateGatewayOptions.bgpIbmCidr() != null) {
contentJson.addProperty("bgp_ibm_cidr", updateGatewayOptions.bgpIbmCidr());
}
if (updateGatewayOptions.connectionMode() != null) {
contentJson.addProperty("connection_mode", updateGatewayOptions.connectionMode());
}
if (updateGatewayOptions.defaultExportRouteFilter() != null) {
contentJson.addProperty("default_export_route_filter", updateGatewayOptions.defaultExportRouteFilter());
}
if (updateGatewayOptions.defaultImportRouteFilter() != null) {
contentJson.addProperty("default_import_route_filter", updateGatewayOptions.defaultImportRouteFilter());
}
if (updateGatewayOptions.global() != null) {
contentJson.addProperty("global", updateGatewayOptions.global());
}
if (updateGatewayOptions.loaRejectReason() != null) {
contentJson.addProperty("loa_reject_reason", updateGatewayOptions.loaRejectReason());
}
if (updateGatewayOptions.macsecConfig() != null) {
contentJson.add("macsec_config", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateGatewayOptions.macsecConfig()));
}
if (updateGatewayOptions.metered() != null) {
contentJson.addProperty("metered", updateGatewayOptions.metered());
}
if (updateGatewayOptions.name() != null) {
contentJson.addProperty("name", updateGatewayOptions.name());
}
if (updateGatewayOptions.operationalStatus() != null) {
contentJson.addProperty("operational_status", updateGatewayOptions.operationalStatus());
}
if (updateGatewayOptions.patchPanelCompletionNotice() != null) {
contentJson.addProperty("patch_panel_completion_notice", updateGatewayOptions.patchPanelCompletionNotice());
}
if (updateGatewayOptions.speedMbps() != null) {
contentJson.addProperty("speed_mbps", updateGatewayOptions.speedMbps());
}
builder.bodyJson(contentJson);
String patchBodyString = com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(updateGatewayOptions.gatewayPatchTemplatePatch());
patchBodyString = patchBodyString.replace(".0,", ",");
builder.bodyContent(patchBodyString, "application/merge-patch+json");

builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(updateGatewayOptions.gatewayPatchTemplatePatch()), "application/merge-patch+json");
ResponseConverter<Gateway> responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<Gateway>() { }.getType());
return createServiceCall(builder.build(), responseConverter);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* (C) Copyright IBM Corp. 2024.
*
* 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.ibm.cloud.sdk.core.service.model.GenericModel;

/**
* gateway port for type=connect gateways.
*/
public class CrossAccountGatewayPort extends GenericModel {

protected String id;

protected CrossAccountGatewayPort() { }

/**
* Gets the id.
*
* Port Identifier.
*
* @return the id
*/
public String getId() {
return id;
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2023.
* (C) Copyright IBM Corp. 2024.
*
* 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 @@ -156,6 +156,8 @@ public interface Type {
@SerializedName("created_at")
protected Date createdAt;
protected String crn;
@SerializedName("cross_account")
protected Boolean crossAccount;
@SerializedName("cross_connect_router")
protected String crossConnectRouter;
@SerializedName("customer_name")
Expand All @@ -180,15 +182,15 @@ public interface Type {
protected String name;
@SerializedName("operational_status")
protected String operationalStatus;
@SerializedName("patch_panel_completion_notice")
protected String patchPanelCompletionNotice;
protected GatewayPort port;
@SerializedName("provider_api_managed")
protected Boolean providerApiManaged;
@SerializedName("resource_group")
protected ResourceGroupReference resourceGroup;
@SerializedName("speed_mbps")
protected Long speedMbps;
@SerializedName("patch_panel_completion_notice")
protected String patchPanelCompletionNotice;
protected String type;
protected Long vlan;

Expand Down Expand Up @@ -381,6 +383,17 @@ public String getCrn() {
return crn;
}

/**
* Gets the crossAccount.
*
* Indicates whether this gateway is cross account gateway.
*
* @return the crossAccount
*/
public Boolean isCrossAccount() {
return crossAccount;
}

/**
* Gets the crossConnectRouter.
*
Expand Down Expand Up @@ -539,17 +552,6 @@ public String getOperationalStatus() {
return operationalStatus;
}

/**
* Gets the patchPanelCompletionNotice.
*
* Gateway patch panel complete notification from implementation team.
*
* @return the patchPanelCompletionNotice
*/
public String getPatchPanelCompletionNotice() {
return patchPanelCompletionNotice;
}

/**
* Gets the port.
*
Expand Down Expand Up @@ -594,6 +596,17 @@ public Long getSpeedMbps() {
return speedMbps;
}

/**
* Gets the patchPanelCompletionNotice.
*
* Gateway patch panel complete notification from implementation team.
*
* @return the patchPanelCompletionNotice
*/
public String getPatchPanelCompletionNotice() {
return patchPanelCompletionNotice;
}

/**
* Gets the type.
*
Expand All @@ -609,7 +622,8 @@ public String getType() {
/**
* Gets the vlan.
*
* VLAN allocated for this gateway. Only set for type=connect gateways.
* VLAN configured for this gateway. If there is no vlan configured for the gateway, the vlan will be absent. This
* property will also be absent if this gateway's `crn` is in another account.
*
* @return the vlan
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2022.
* (C) Copyright IBM Corp. 2024.
*
* 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 @@ -17,11 +17,13 @@
import com.ibm.cloud.sdk.core.service.model.GenericModel;

/**
* GatewayCollection.
* List of gateways.
*/
public class GatewayCollection extends GenericModel {

protected List<Gateway> gateways;
protected List<GatewayCollectionGatewaysItem> gateways;

protected GatewayCollection() { }

/**
* Gets the gateways.
Expand All @@ -30,7 +32,7 @@ public class GatewayCollection extends GenericModel {
*
* @return the gateways
*/
public List<Gateway> getGateways() {
public List<GatewayCollectionGatewaysItem> getGateways() {
return gateways;
}
}
Expand Down
Loading