Skip to content

feat(2022-10-25): updated the sdk as per the api spec released on 2022-10-25 #44

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 1 commit into from
Oct 31, 2022
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
479 changes: 332 additions & 147 deletions modules/examples/src/main/java/com/ibm/cloud/is/vpc/v1/VPCExamples.java

Large diffs are not rendered by default.

24 changes: 22 additions & 2 deletions modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/Vpc.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 3.55.1-b24c7487-20220831-201343
* IBM OpenAPI SDK Code Generator Version: 3.59.0-da92a51d-20221012-180509
*/

package com.ibm.cloud.is.vpc.v1;
Expand Down Expand Up @@ -478,6 +478,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Logger;

/**
* The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision and manage virtual server
Expand All @@ -486,6 +487,7 @@
* API Version: 2022-09-13
*/
public class Vpc extends BaseService {
private static final Logger LOGGER = Logger.getLogger(Vpc.class.getName());

/**
* Default service name used when configuring the `Vpc` client.
Expand Down Expand Up @@ -1012,8 +1014,11 @@ public ServiceCall<AddressPrefix> updateVpcAddressPrefix(UpdateVpcAddressPrefixO
*
* @param listVpcRoutesOptions the {@link ListVpcRoutesOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link RouteCollection}
* @deprecated this method is deprecated and may be removed in a future release
*/
@Deprecated
public ServiceCall<RouteCollection> listVpcRoutes(ListVpcRoutesOptions listVpcRoutesOptions) {
LOGGER.warning("A deprecated operation has been invoked: listVpcRoutes");
com.ibm.cloud.sdk.core.util.Validator.notNull(listVpcRoutesOptions,
"listVpcRoutesOptions cannot be null");
Map<String, String> pathParamsMap = new HashMap<String, String>();
Expand Down Expand Up @@ -1049,8 +1054,11 @@ public ServiceCall<RouteCollection> listVpcRoutes(ListVpcRoutesOptions listVpcRo
*
* @param createVpcRouteOptions the {@link CreateVpcRouteOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link Route}
* @deprecated this method is deprecated and may be removed in a future release
*/
@Deprecated
public ServiceCall<Route> createVpcRoute(CreateVpcRouteOptions createVpcRouteOptions) {
LOGGER.warning("A deprecated operation has been invoked: createVpcRoute");
com.ibm.cloud.sdk.core.util.Validator.notNull(createVpcRouteOptions,
"createVpcRouteOptions cannot be null");
Map<String, String> pathParamsMap = new HashMap<String, String>();
Expand Down Expand Up @@ -1088,8 +1096,11 @@ public ServiceCall<Route> createVpcRoute(CreateVpcRouteOptions createVpcRouteOpt
*
* @param deleteVpcRouteOptions the {@link DeleteVpcRouteOptions} containing the options for the call
* @return a {@link ServiceCall} with a void result
* @deprecated this method is deprecated and may be removed in a future release
*/
@Deprecated
public ServiceCall<Void> deleteVpcRoute(DeleteVpcRouteOptions deleteVpcRouteOptions) {
LOGGER.warning("A deprecated operation has been invoked: deleteVpcRoute");
com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpcRouteOptions,
"deleteVpcRouteOptions cannot be null");
Map<String, String> pathParamsMap = new HashMap<String, String>();
Expand All @@ -1113,8 +1124,11 @@ public ServiceCall<Void> deleteVpcRoute(DeleteVpcRouteOptions deleteVpcRouteOpti
*
* @param getVpcRouteOptions the {@link GetVpcRouteOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link Route}
* @deprecated this method is deprecated and may be removed in a future release
*/
@Deprecated
public ServiceCall<Route> getVpcRoute(GetVpcRouteOptions getVpcRouteOptions) {
LOGGER.warning("A deprecated operation has been invoked: getVpcRoute");
com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcRouteOptions,
"getVpcRouteOptions cannot be null");
Map<String, String> pathParamsMap = new HashMap<String, String>();
Expand All @@ -1141,8 +1155,11 @@ public ServiceCall<Route> getVpcRoute(GetVpcRouteOptions getVpcRouteOptions) {
*
* @param updateVpcRouteOptions the {@link UpdateVpcRouteOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link Route}
* @deprecated this method is deprecated and may be removed in a future release
*/
@Deprecated
public ServiceCall<Route> updateVpcRoute(UpdateVpcRouteOptions updateVpcRouteOptions) {
LOGGER.warning("A deprecated operation has been invoked: updateVpcRoute");
com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpcRouteOptions,
"updateVpcRouteOptions cannot be null");
Map<String, String> pathParamsMap = new HashMap<String, String>();
Expand Down Expand Up @@ -1233,6 +1250,9 @@ public ServiceCall<RoutingTable> createVpcRoutingTable(CreateVpcRoutingTableOpti
if (createVpcRoutingTableOptions.routeDirectLinkIngress() != null) {
contentJson.addProperty("route_direct_link_ingress", createVpcRoutingTableOptions.routeDirectLinkIngress());
}
if (createVpcRoutingTableOptions.routeInternetIngress() != null) {
contentJson.addProperty("route_internet_ingress", createVpcRoutingTableOptions.routeInternetIngress());
}
if (createVpcRoutingTableOptions.routeTransitGatewayIngress() != null) {
contentJson.addProperty("route_transit_gateway_ingress", createVpcRoutingTableOptions.routeTransitGatewayIngress());
}
Expand Down Expand Up @@ -2102,7 +2122,7 @@ public ServiceCall<Image> createImage(CreateImageOptions createImageOptions) {
*
* This request deletes an image. This operation cannot be reversed. A system-provided image is not allowed to be
* deleted. Additionally, an image cannot be deleted if it:
* - has a `status` of `tentative` or `deleting`
* - has a `status` of `deleting`
* - has a `status` of `pending` with a `status_reasons` code of `image_request_in_progress`
* - has `catalog_offering.managed` set to `true`.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public String getResourceType() {
/**
* Gets the supportedTrustedPlatformModuleModes.
*
* The supported trusted platform module (TPM) modes for this bare metal server profile.
* The supported trusted platform module modes for this bare metal server profile.
*
* @return the supportedTrustedPlatformModuleModes
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.ibm.cloud.sdk.core.service.model.GenericModel;

/**
* The supported trusted platform module (TPM) modes for this bare metal server profile.
* The supported trusted platform module modes for this bare metal server profile.
*/
public class BareMetalServerProfileSupportedTrustedPlatformModuleModes extends GenericModel {

Expand All @@ -30,9 +30,8 @@ public interface Type {
}

/**
* The mode for the trusted platform module (TPM):
* - `tpm_2`: Standard TPM 2 capabilities
* - `tpm_2_with_txt`: Standard TPM 2 with Intel Trusted Execution Technology (TXT)
* The trusted platform module (TPM) mode:
* - `tpm_2`: TPM 2.0
*
* The enumerated values for this property are expected to expand in the future. When processing this property, check
* for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the
Expand All @@ -41,8 +40,6 @@ public interface Type {
public interface Values {
/** tpm_2. */
String TPM_2 = "tpm_2";
/** tpm_2_with_txt. */
String TPM_2_WITH_TXT = "tpm_2_with_txt";
}

protected String type;
Expand All @@ -64,7 +61,7 @@ public String getType() {
/**
* Gets the values.
*
* The supported trusted platform module (TPM) modes.
* The supported trusted platform module modes.
*
* @return the values
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
public class BareMetalServerTrustedPlatformModule extends GenericModel {

/**
* The mode for the trusted platform module (TPM):
* - `tpm_2`: Standard TPM 2 capabilities
* - `tpm_2_with_txt`: Standard TPM 2 with Intel Trusted Execution Technology (TXT)
* The trusted platform module (TPM) mode:
* - `tpm_2`: TPM 2.0
*
* The enumerated values for this property are expected to expand in the future. When processing this property, check
* for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the
Expand All @@ -31,8 +30,6 @@ public class BareMetalServerTrustedPlatformModule extends GenericModel {
public interface Mode {
/** tpm_2. */
String TPM_2 = "tpm_2";
/** tpm_2_with_txt. */
String TPM_2_WITH_TXT = "tpm_2_with_txt";
}

protected Boolean enabled;
Expand All @@ -43,7 +40,7 @@ protected BareMetalServerTrustedPlatformModule() { }
/**
* Gets the enabled.
*
* Indicates whether the trusted platform module (TPM) is enabled. If enabled, `mode` will also be set.
* Indicates whether the trusted platform module is enabled.
*
* @return the enabled
*/
Expand All @@ -54,9 +51,8 @@ public Boolean isEnabled() {
/**
* Gets the mode.
*
* The mode for the trusted platform module (TPM):
* - `tpm_2`: Standard TPM 2 capabilities
* - `tpm_2_with_txt`: Standard TPM 2 with Intel Trusted Execution Technology (TXT)
* The trusted platform module (TPM) mode:
* - `tpm_2`: TPM 2.0
*
* The enumerated values for this property are expected to expand in the future. When processing this property, check
* for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ public String vpcId() {
/**
* Gets the cidr.
*
* The IPv4 range of the address prefix, expressed in CIDR format. The request must not overlap with any existing
* The IPv4 range of the address prefix, expressed in CIDR format. The range must not overlap with any existing
* address prefixes in the VPC or any of the following reserved address ranges:
*
* - `127.0.0.0/8` (IPv4 loopback addresses)
* - `161.26.0.0/16` (IBM services)
* - `166.8.0.0/14` (Cloud Service Endpoints)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
public class CreateVpcOptions extends GenericModel {

/**
* Indicates whether a default address prefix will be automatically created for each zone in this VPC. If `manual`,
* this VPC will be created with no default address prefixes.
* Indicates whether a [default address prefix](https://cloud.ibm.com/docs/vpc?topic=vpc-configuring-address-prefixes)
* will be automatically created for each zone in this VPC. If `manual`, this VPC will be created with no default
* address prefixes.
*
* Since address prefixes are managed identically regardless of whether they were automatically created, the value is
* not preserved as a VPC property.
Expand Down Expand Up @@ -140,8 +141,9 @@ public Builder newBuilder() {
/**
* Gets the addressPrefixManagement.
*
* Indicates whether a default address prefix will be automatically created for each zone in this VPC. If `manual`,
* this VPC will be created with no default address prefixes.
* Indicates whether a [default address prefix](https://cloud.ibm.com/docs/vpc?topic=vpc-configuring-address-prefixes)
* will be automatically created for each zone in this VPC. If `manual`, this VPC will be created with no default
* address prefixes.
*
* Since address prefixes are managed identically regardless of whether they were automatically created, the value is
* not preserved as a VPC property.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,9 @@ public String action() {
/**
* Gets the name.
*
* The user-defined name for this route. If unspecified, the name will be a hyphenated list of randomly-selected
* words. Names must be unique within the VPC routing table the route resides in.
* The user-defined name for this route. Names starting with `ibm-` are not allowed. If unspecified, the name will be
* a hyphenated list of randomly-selected words. Names must be unique within the VPC routing table the route resides
* in.
*
* @return the name
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class CreateVpcRoutingTableOptions extends GenericModel {
protected List<ResourceFilter> acceptRoutesFrom;
protected String name;
protected Boolean routeDirectLinkIngress;
protected Boolean routeInternetIngress;
protected Boolean routeTransitGatewayIngress;
protected Boolean routeVpcZoneIngress;
protected List<RoutePrototype> routes;
Expand All @@ -38,6 +39,7 @@ public static class Builder {
private List<ResourceFilter> acceptRoutesFrom;
private String name;
private Boolean routeDirectLinkIngress;
private Boolean routeInternetIngress;
private Boolean routeTransitGatewayIngress;
private Boolean routeVpcZoneIngress;
private List<RoutePrototype> routes;
Expand All @@ -52,6 +54,7 @@ private Builder(CreateVpcRoutingTableOptions createVpcRoutingTableOptions) {
this.acceptRoutesFrom = createVpcRoutingTableOptions.acceptRoutesFrom;
this.name = createVpcRoutingTableOptions.name;
this.routeDirectLinkIngress = createVpcRoutingTableOptions.routeDirectLinkIngress;
this.routeInternetIngress = createVpcRoutingTableOptions.routeInternetIngress;
this.routeTransitGatewayIngress = createVpcRoutingTableOptions.routeTransitGatewayIngress;
this.routeVpcZoneIngress = createVpcRoutingTableOptions.routeVpcZoneIngress;
this.routes = createVpcRoutingTableOptions.routes;
Expand Down Expand Up @@ -158,6 +161,17 @@ public Builder routeDirectLinkIngress(Boolean routeDirectLinkIngress) {
return this;
}

/**
* Set the routeInternetIngress.
*
* @param routeInternetIngress the routeInternetIngress
* @return the CreateVpcRoutingTableOptions builder
*/
public Builder routeInternetIngress(Boolean routeInternetIngress) {
this.routeInternetIngress = routeInternetIngress;
return this;
}

/**
* Set the routeTransitGatewayIngress.
*
Expand Down Expand Up @@ -202,6 +216,7 @@ protected CreateVpcRoutingTableOptions(Builder builder) {
acceptRoutesFrom = builder.acceptRoutesFrom;
name = builder.name;
routeDirectLinkIngress = builder.routeDirectLinkIngress;
routeInternetIngress = builder.routeInternetIngress;
routeTransitGatewayIngress = builder.routeTransitGatewayIngress;
routeVpcZoneIngress = builder.routeVpcZoneIngress;
routes = builder.routes;
Expand Down Expand Up @@ -257,36 +272,56 @@ public String name() {
* Gets the routeDirectLinkIngress.
*
* If set to `true`, this routing table will be used to route traffic that originates from [Direct
* Link](https://cloud.ibm.com/docs/dl/) to this VPC. For this to succeed, the VPC must not already have a routing
* table with this property set to `true`.
* Link](https://cloud.ibm.com/docs/dl) to this VPC. The VPC must not already have a routing table with this property
* set to `true`.
*
* Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of
* `deliver` are treated as `drop` unless the `next_hop` is an IP address bound to a network interface on a subnet in
* the route's `zone`. Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP
* address or a VPN gateway connection, the packet will be dropped.
*
* If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is
* enabled for this VPC, and this property is set to `true`, its incoming traffic will also be routed according to
* this routing table.
*
* @return the routeDirectLinkIngress
*/
public Boolean routeDirectLinkIngress() {
return routeDirectLinkIngress;
}

/**
* Gets the routeInternetIngress.
*
* If set to `true`, this routing table will be used to route traffic that originates from the internet. For this to
* succeed, the VPC must not already have a routing table with this property set to `true`.
*
* Incoming traffic will be routed according to the routing table with two exceptions:
* - Traffic destined for IP addresses associated with public gateways will not be
* subject to routes in this routing table.
* - Routes with an action of deliver are treated as drop unless the `next_hop` is an
* IP address bound to a network interface on a subnet in the route's `zone`.
* Therefore, if an incoming packet matches a route with a `next_hop` of an
* internet-bound IP address or a VPN gateway connection, the packet will be dropped.
*
* @return the routeInternetIngress
*/
public Boolean routeInternetIngress() {
return routeInternetIngress;
}

/**
* Gets the routeTransitGatewayIngress.
*
* If set to `true`, this routing table will be used to route traffic that originates from [Transit
* Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC. For this to succeed, the VPC must not already
* have a routing table with this property set to `true`.
* Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. The VPC must not already have a routing table
* with this property set to `true`.
*
* Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of
* `deliver` are treated as `drop` unless the `next_hop` is an IP address bound to a network interface on a subnet in
* the route's `zone`. Therefore, if an incoming packet matches a route with a `next_hop` of an internet-bound IP
* address or a VPN gateway connection, the packet will be dropped.
*
* If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is
* enabled for this VPC, and this property is set to `true`, its incoming traffic will also be routed according to
* this routing table.
*
* @return the routeTransitGatewayIngress
*/
public Boolean routeTransitGatewayIngress() {
Expand All @@ -297,7 +332,7 @@ public Boolean routeTransitGatewayIngress() {
* Gets the routeVpcZoneIngress.
*
* If set to `true`, this routing table will be used to route traffic that originates from subnets in other zones in
* this VPC. For this to succeed, the VPC must not already have a routing table with this property set to `true`.
* this VPC. The VPC must not already have a routing table with this property set to `true`.
*
* Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of
* `deliver` are treated as `drop` unless the `next_hop` is an IP address within the VPC's address prefix ranges.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,9 @@ public String action() {
/**
* Gets the name.
*
* The user-defined name for this route. If unspecified, the name will be a hyphenated list of randomly-selected
* words. Names must be unique within the VPC routing table the route resides in.
* The user-defined name for this route. Names starting with `ibm-` are not allowed. If unspecified, the name will be
* a hyphenated list of randomly-selected words. Names must be unique within the VPC routing table the route resides
* in.
*
* @return the name
*/
Expand Down
Loading