This repository has been archived by the owner on Dec 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from VamshikShetty/05-vrf-patch
Add patch to make vrf param required
- Loading branch information
Showing
9 changed files
with
80 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import com.equinix.openapi.ApiClient; | ||
import com.equinix.openapi.ApiException; | ||
import com.equinix.openapi.Configuration; | ||
import com.equinix.openapi.auth.ApiKeyAuth; | ||
import com.equinix.openapi.metal.v1.api.IpAddressesApi; | ||
import com.equinix.openapi.metal.v1.model.IPReservationRequestInput; | ||
import com.equinix.openapi.metal.v1.model.RequestIPReservationRequest; | ||
|
||
import java.util.UUID; | ||
|
||
public class ReserveIpAddresses { | ||
public static void main(String[] args) { | ||
ApiClient defaultClient = Configuration.getDefaultApiClient(); | ||
|
||
// Spec is maintaing base path hence dont have to set it explicitly | ||
// defaultClient.setBasePath("<Metal API base path>"); | ||
|
||
// Configure API key authorization: x_auth_token | ||
ApiKeyAuth x_auth_token = (ApiKeyAuth) defaultClient.getAuthentication("x_auth_token"); | ||
x_auth_token.setApiKey(args[0]); | ||
|
||
IpAddressesApi ipAddressesApiInst = new IpAddressesApi(defaultClient); | ||
try { | ||
|
||
UUID uuid = UUID.fromString(args[1]); | ||
IPReservationRequestInput iPReservationRequestInput = new IPReservationRequestInput(); | ||
iPReservationRequestInput.setType("public_ipv4"); | ||
iPReservationRequestInput.setQuantity(4); | ||
iPReservationRequestInput.setMetro("DA"); | ||
RequestIPReservationRequest requestIPReservationRequest = new RequestIPReservationRequest(iPReservationRequestInput); | ||
|
||
System.out.println(ipAddressesApiInst.requestIPReservation(uuid, requestIPReservationRequest)); | ||
} catch (ApiException e) { | ||
System.out.println(String.format("Response HTTP status code : %s", e.getCode())); | ||
System.out.println(String.format("Response HTTP headers : %s", e.getResponseHeaders())); | ||
System.out.println(String.format("Response HTTP body : %s", e.getResponseBody())); | ||
System.out.println(String.format("Exception message : %s", e.getMessage())); | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
patches/spec.fetched.json/05-reserveIp-oneof-vrf-required.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff --git a/spec/oas3.patched.json b/spec/oas3.patched.json | ||
index 26cc226..c74f6f9 100644 | ||
--- a/spec/oas3.patched.json | ||
+++ b/spec/oas3.patched.json | ||
@@ -4745,7 +4745,11 @@ | ||
"vrf": { | ||
"$ref": "#/components/schemas/Vrf" | ||
} | ||
- } | ||
+ }, | ||
+ "required": [ | ||
+ "vrf" | ||
+ ], | ||
+ "type": "object" | ||
}, | ||
"VrfIpReservationCreateInput": { | ||
"properties": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters