Skip to content

Commit 7a1af48

Browse files
Merge pull request #20 from IBM/upd-dl
fix: deprecated the bgp_base_cidr in direct link
2 parents 03d97b6 + d5280b5 commit 7a1af48

File tree

3 files changed

+49
-38
lines changed

3 files changed

+49
-38
lines changed

direct-link/v1.ts

Lines changed: 46 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,20 +1517,25 @@ namespace DirectLinkV1 {
15171517
export interface Gateway {
15181518
/** Customer BGP ASN. */
15191519
bgp_asn: number;
1520-
/** BGP base CIDR. */
1520+
/** (DEPRECATED) BGP base CIDR is deprecated and no longer recognized the Direct Link APIs.
1521+
*
1522+
* See bgp_cer_cidr and bgp_ibm_cidr fields instead for IP related information.
1523+
*
1524+
* Deprecated field bgp_base_cidr will be removed from the API specificiation after 15-MAR-2021.
1525+
*/
15211526
bgp_base_cidr?: string;
15221527
/** BGP customer edge router CIDR. */
15231528
bgp_cer_cidr?: string;
15241529
/** IBM BGP ASN. */
15251530
bgp_ibm_asn?: number;
15261531
/** BGP IBM CIDR. */
15271532
bgp_ibm_cidr?: string;
1528-
/** Gateway BGP status.
1529-
*
1530-
* The list of enumerated values for this property may expand in the future. Code and processes using this field
1531-
* must tolerate unexpected values.
1533+
/** Gateway BGP status. The list of enumerated values for this property may expand in the future. Code and
1534+
* processes using this field must tolerate unexpected values.
15321535
*/
15331536
bgp_status?: string;
1537+
/** Carrier name. Only set for type=dedicated gateways. */
1538+
carrier_name?: string;
15341539
/** Changes pending approval for provider managed Direct Link Connect gateways. */
15351540
change_request?: GatewayChangeRequest;
15361541
/** Reason for completion notice rejection. Only included on type=dedicated gateways with a rejected completion
@@ -1543,14 +1548,14 @@ namespace DirectLinkV1 {
15431548
crn: string;
15441549
/** Cross connect router. Only included on type=dedicated gateways. */
15451550
cross_connect_router?: string;
1551+
/** Customer name. Only set for type=dedicated gateways. */
1552+
customer_name?: string;
15461553
/** Gateways with global routing (`true`) can connect to networks outside their associated region. */
15471554
global: boolean;
15481555
/** The unique identifier of this gateway. */
15491556
id: string;
1550-
/** Gateway link status. Only included on type=dedicated gateways.
1551-
*
1552-
* The list of enumerated values for this property may expand in the future. Code and processes using this field
1553-
* must tolerate unexpected values.
1557+
/** Gateway link status. Only included on type=dedicated gateways. The list of enumerated values for this
1558+
* property may expand in the future. Code and processes using this field must tolerate unexpected values.
15541559
*/
15551560
link_status?: string;
15561561
/** Gateway location long name. */
@@ -1567,10 +1572,8 @@ namespace DirectLinkV1 {
15671572
metered: boolean;
15681573
/** The unique user-defined name for this gateway. */
15691574
name: string;
1570-
/** Gateway operational status.
1571-
*
1572-
* The list of enumerated values for this property may expand in the future. Code and processes using this field
1573-
* must tolerate unexpected values.
1575+
/** Gateway operational status. The list of enumerated values for this property may expand in the future. Code
1576+
* and processes using this field must tolerate unexpected values.
15741577
*/
15751578
operational_status: string;
15761579
/** gateway port for type=connect gateways. */
@@ -1581,10 +1584,8 @@ namespace DirectLinkV1 {
15811584
resource_group?: ResourceGroupReference;
15821585
/** Gateway speed in megabits per second. */
15831586
speed_mbps: number;
1584-
/** Gateway type.
1585-
*
1586-
* The list of enumerated values for this property may expand in the future. Code and processes using this field
1587-
* must tolerate unexpected values.
1587+
/** Gateway type. The list of enumerated values for this property may expand in the future. Code and processes
1588+
* using this field must tolerate unexpected values.
15881589
*/
15891590
type: string;
15901591
/** VLAN allocated for this gateway. Only set for type=connect gateways. */
@@ -1629,11 +1630,9 @@ namespace DirectLinkV1 {
16291630
sak_expiry_time?: number;
16301631
/** Packets without MACsec headers are not dropped when security_policy is `should_secure`. */
16311632
security_policy?: string;
1632-
/** Current status of MACsec on the device for this gateway. Status 'unknown' is returned during gateway
1633-
* creation and deletion. Status `key_error` indicates Direct Link was unable to retrieve key materials for one of
1634-
* the specified. This usually due to inadequate service to service authorization. Verify the key exists and
1635-
* verify a service to service policy exists authorization the Direct Link service to access its key material.
1636-
* Correct any problems and respecify the desired key. If the problem persists contact IBM support.
1633+
/** Current status of MACsec on this gateway.
1634+
*
1635+
* Status 'unknown' is returned during gateway creation and deletion.
16371636
*/
16381637
status: string;
16391638
/** replay protection window size. */
@@ -1663,8 +1662,6 @@ namespace DirectLinkV1 {
16631662
*/
16641663
active?: boolean;
16651664
/** Fallback connectivity association key.
1666-
*
1667-
* The `fallback_cak` crn cannot match the `primary_cak` crn.
16681665
*
16691666
* MACsec keys must be type=standard with key name lengths between 2 to 64 inclusive and contain only characters
16701667
* [a-fA-F0-9].
@@ -1688,7 +1685,7 @@ namespace DirectLinkV1 {
16881685
window_size?: number;
16891686
}
16901687

1691-
/** Fallback connectivity association key. The `fallback_cak` crn cannot match the `primary_cak` crn. MACsec keys must be type=standard with key name lengths between 2 to 64 inclusive and contain only characters [a-fA-F0-9]. The key material must be exactly 64 characters in length and contain only [a-fA-F0-9]. To clear the optional `fallback_cak` field patch its crn to `""`. A gateway's `fallback_cak` crn cannot match its `primary_cak` crn. */
1688+
/** Fallback connectivity association key. MACsec keys must be type=standard with key name lengths between 2 to 64 inclusive and contain only characters [a-fA-F0-9]. The key material must be exactly 64 characters in length and contain only [a-fA-F0-9]. To clear the optional `fallback_cak` field patch its crn to `""`. A gateway's `fallback_cak` crn cannot match its `primary_cak` crn. */
16921689
export interface GatewayMacsecConfigPatchTemplateFallbackCak {
16931690
/** connectivity association key crn. */
16941691
crn: string;
@@ -1777,14 +1774,32 @@ namespace DirectLinkV1 {
17771774
export interface GatewayTemplate {
17781775
/** BGP ASN. */
17791776
bgp_asn: number;
1780-
/** BGP base CIDR. */
1781-
bgp_base_cidr: string;
1782-
/** BGP customer edge router CIDR. Specify a value within `bgp_base_cidr`. If `bgp_base_cidr` is
1783-
* 169.254.0.0/16 this field can be ommitted and a CIDR will be selected automatically.
1777+
/** (DEPRECATED) BGP base CIDR.
1778+
*
1779+
* Field is deprecated. See bgp_ibm_cidr and bgp_cer_cidr for details on how to create a gateway using either
1780+
* automatic or explicit IP assignment. Any bgp_base_cidr value set will be ignored.
1781+
*
1782+
* Deprecated field bgp_base_cidr will be removed from the API specificiation after 15-MAR-2021.
1783+
*/
1784+
bgp_base_cidr?: string;
1785+
/** BGP customer edge router CIDR.
1786+
*
1787+
* For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will automatically select values for
1788+
* bgp_cer_cidr and bgp_ibm_cidr.
1789+
*
1790+
* For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value must reside in one of
1791+
* "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and
1792+
* bgp_ibm_cidr must have matching network and subnet mask values.
17841793
*/
17851794
bgp_cer_cidr?: string;
1786-
/** BGP IBM CIDR. Specify a value within `bgp_base_cidr`. If `bgp_base_cidr` is 169.254.0.0/16 this field can
1787-
* be ommitted and a CIDR will be selected automatically.
1795+
/** BGP IBM CIDR.
1796+
*
1797+
* For auto IP assignment, omit bgp_cer_cidr and bgp_ibm_cidr. IBM will automatically select values for
1798+
* bgp_cer_cidr and bgp_ibm_cidr.
1799+
*
1800+
* For explicit IP assignment set a valid bgp_cer_cidr and bgp_ibm_cidr CIDR, the value must reside in one of
1801+
* "10.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "169.254.0.0/16" or an owned public CIDR. bgp_cer_cidr and
1802+
* bgp_ibm_cidr must have matching network and subnet mask values.
17881803
*/
17891804
bgp_ibm_cidr?: string;
17901805
/** Gateways with global routing (`true`) can connect to networks outside their associated region. */

test/integration/transit-gateway.v1.test.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ describe('TransitGatewayApisV1', () => {
204204
await transitGateway.updateTransitGateway(params);
205205
} catch (err) {
206206
expect(err.status).toEqual(404);
207-
expect(err.message).toEqual('The gateway was not found.');
208207
done();
209208
}
210209

@@ -234,7 +233,6 @@ describe('TransitGatewayApisV1', () => {
234233
await transitGateway.getTransitGateway({ id: '111' });
235234
} catch (err) {
236235
expect(err.status).toEqual(404);
237-
expect(err.message).toEqual('The gateway was not found.');
238236
done();
239237
}
240238
done();
@@ -484,7 +482,6 @@ describe('TransitGatewayApisV1', () => {
484482
});
485483
} catch (err) {
486484
expect(err.status).toEqual(404);
487-
expect(err.message).toEqual('The gateway was not found.');
488485
done();
489486
}
490487

@@ -532,7 +529,6 @@ describe('TransitGatewayApisV1', () => {
532529
});
533530
} catch (err) {
534531
expect(err.status).toEqual(404);
535-
expect(err.message).toEqual('The location was not found.');
536532
done();
537533
}
538534

test/unit/direct-link.v1.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ describe('DirectLinkV1', () => {
202202
// GatewayTemplateGatewayTypeDedicatedTemplate
203203
const gatewayTemplateModel = {
204204
bgp_asn: 64999,
205-
bgp_base_cidr: '10.254.30.76/30',
206-
bgp_cer_cidr: '10.254.30.78/30',
207-
bgp_ibm_cidr: '10.254.30.77/30',
205+
bgp_base_cidr: 'testString',
206+
bgp_cer_cidr: '169.254.0.10/30',
207+
bgp_ibm_cidr: '169.254.0.9/30',
208208
global: true,
209209
metered: false,
210210
name: 'myGateway',

0 commit comments

Comments
 (0)