diff --git a/test/integration/transit-gateway.v1.test.js b/test/integration/transit-gateway.v1.test.js index e3215f6..d2dd26c 100644 --- a/test/integration/transit-gateway.v1.test.js +++ b/test/integration/transit-gateway.v1.test.js @@ -51,6 +51,7 @@ let GRE_CONN_INSTANCE_ID; let UNBOUND_GRE_CONN_INSTANCE_ID; let CLASSIC_CONN_INSTANCE_ID; let VPN_CONN_INSTANCE_ID; +let DRS_CONN_INSTANCE_ID; let DL_CONN_INSTANCE_NAME; let VPC_CONN_INSTANCE_NAME; @@ -58,6 +59,7 @@ let GRE_CONN_INSTANCE_NAME; let UNBOUND_GRE_CONN_INSTANCE_NAME; let CLASSIC_CONN_INSTANCE_NAME; let VPN_CONN_INSTANCE_NAME; +let DRS_CONN_INSTANCE_NAME; const poll = async (fn, fnCondition, sec) => { let result; @@ -140,30 +142,51 @@ describe.skip('TransitGatewayApisV1', () => { const { result } = response || {}; const connections = result.connections; if (connections.length > 0) { - const connIDs = []; + const greIDs = []; + const drsIDs = []; + const otherIDs = []; for (let j = 0; j < connections.length; j++) { if (connections[j].status.includes('delet') === false) { const connID = connections[j].id; - // Delete GRE Connections first. - if ( - connections[j].networkType === 'gre_tunnel' || - connections[j].networkType === 'unbound_gre_tunnel' - ) { - const response = await transitGateway.deleteTransitGateway({ - id: connID, - }); - expect(response.status).toBe(204); + const connType = connections[j].network_type; + if (connType === 'gre_tunnel' || connType === 'unbound_gre_tunnel') { + greIDs.push(connID); + } else if (connType === 'dynamic_route_server') { + drsIDs.push(connID); } else { - connIDs.push(connID); + otherIDs.push(connID); } } } // Delete Connections from other types. - for (let k = 0; k < connIDs.length; k++) { - const response = await transitGateway.deleteTransitGateway({ - id: connIDs[k], - }); - expect(response.status).toBe(204); + for (const id of greIDs) { + try { + const response = await transitGateway.deleteTransitGatewayConnection({ + transitGatewayId: gateways[i].id, + id, + }); + expect(response.status).toBe(204); + } catch (e) {} + } + // Delete DRS before VPC + for (const id of drsIDs) { + try { + const response = await transitGateway.deleteTransitGatewayConnection({ + transitGatewayId: gateways[i].id, + id, + }); + expect(response.status).toBe(204); + } catch (e) {} + } + // Delete everything else (VPC, classic, DL, VPN...). + for (const id of otherIDs) { + try { + const response = await transitGateway.deleteTransitGatewayConnection({ + transitGatewayId: gateways[i].id, + id, + }); + expect(response.status).toBe(204); + } catch (e) {} } } // Remove empty gateways @@ -603,6 +626,62 @@ describe.skip('TransitGatewayApisV1', () => { } }); + test('successfully creates DRS connection', async done => { + const type = 'dynamic_route_server'; + const crn = config.DRS_CRN; + const stamp = Math.floor(Math.random() * 1000); + const connectionName = 'DRS-' + config.GATEWAY_CONNECTION_NAME + '_' + stamp; + const cidr = '192.168.200.0/24'; + + try { + const response = await transitGateway.createTransitGatewayConnection({ + transitGatewayId: GATEWAY_INSTANCE_ID, + networkType: type, + name: connectionName, + networkId: crn, + cidr, + }); + expect(response).toBeDefined(); + expect(response.status).toEqual(201); + + const { result } = response || {}; + + expect(result).toBeDefined(); + expect(result.name).toEqual(connectionName); + expect(result.network_id).toEqual(crn); + expect(result.network_type).toEqual(type); + expect(result.cidr).toEqual(cidr); + + DRS_CONN_INSTANCE_ID = result.id; + DRS_CONN_INSTANCE_NAME = result.name; + + done(); + } catch (err) { + done(err); + } + }); + + test('successfully wait for the DRS connection to report as attached', async done => { + try { + const result = await poll( + () => + transitGateway.getTransitGatewayConnection({ + transitGatewayId: GATEWAY_INSTANCE_ID, + id: DRS_CONN_INSTANCE_ID, + }), + result => result.status === 'attached', + 100 + ); + + expect(result).toBeDefined(); + expect(result.status).toEqual('attached'); + + done(); + } catch (err) { + done(err); + } + }); + test('successfully creates GRE connection', async done => { const type = 'gre_tunnel'; const testZone = { name: 'us-south-1' }; @@ -675,6 +754,23 @@ describe.skip('TransitGatewayApisV1', () => { done(); }); + + test('fail to create a DRS connection with bad CRN', async done => { + try { + await transitGateway.createTransitGatewayConnection({ + transitGatewayId: GATEWAY_INSTANCE_ID, + networkType: 'dynamic_route_server', + name: config.GATEWAY_CONNECTION_NAME, + networkId: 'bad_crn', + }); + done(); + } catch (err) { + expect(err.status).toEqual(400); + done(); + } + + done(); + }); }); test('successfully creates Unbound GRE connection', async done => { @@ -850,6 +946,28 @@ describe.skip('TransitGatewayApisV1', () => { } }); + test('sucessfully get DRS connection by id', async done => { + try { + const response = await transitGateway.getTransitGatewayConnection({ + transitGatewayId: GATEWAY_INSTANCE_ID, + id: DRS_CONN_INSTANCE_ID, + }); + + expect(response.status).toBe(200); + + const { result } = response || {}; + expect(result.id).toEqual(DRS_CONN_INSTANCE_ID); + expect(result.name).toEqual(DRS_CONN_INSTANCE_NAME); + expect(result.network_id).toEqual(config.DRS_CRN); + expect(result.network_type).toEqual('dynamic_route_server'); + expect(result.cidr).toEqual('192.168.200.0/24'); + + done(); + } catch (err) { + done(err); + } + }); + test('fail to get connection by instanceID', async done => { try { await transitGateway.getTransitGatewayConnection({ @@ -987,6 +1105,26 @@ describe.skip('TransitGatewayApisV1', () => { } }); + test('successfully update a DRS connection name by instance id', async done => { + DRS_CONN_INSTANCE_NAME = 'UPDATED-' + DRS_CONN_INSTANCE_NAME; + try { + const response = await transitGateway.updateTransitGatewayConnection({ + transitGatewayId: GATEWAY_INSTANCE_ID, + id: DRS_CONN_INSTANCE_ID, + name: DRS_CONN_INSTANCE_NAME, + }); + expect(response.status).toBe(200); + + const { result } = response || {}; + expect(result.id).toEqual(DRS_CONN_INSTANCE_ID); + expect(result.name).toEqual(DRS_CONN_INSTANCE_NAME); + + done(); + } catch (err) { + done(err); + } + }); + test('fail to update Connection by instance id', async done => { try { await transitGateway.updateTransitGatewayConnection({ @@ -1022,6 +1160,7 @@ describe.skip('TransitGatewayApisV1', () => { let foundGRE = false; let foundUnboundGRE = false; let foundClassic = false; + let foundDRS = false; for (let i = 0; i < connections.length; i++) { if (connections[i].id === CLASSIC_CONN_INSTANCE_ID) { expect(connections[i].name).toEqual(CLASSIC_CONN_INSTANCE_NAME); @@ -1041,6 +1180,10 @@ describe.skip('TransitGatewayApisV1', () => { } else if (connections[i].id === UNBOUND_GRE_CONN_INSTANCE_ID) { expect(connections[i].name).toEqual(UNBOUND_GRE_CONN_INSTANCE_NAME); foundUnboundGRE = true; + } else if (connections[i].id === DRS_CONN_INSTANCE_ID) { + expect(connections[i].name).toEqual(DRS_CONN_INSTANCE_NAME); + expect(connections[i].network_type).toEqual('dynamic_route_server'); + foundDRS = true; } } expect(foundVPN).toEqual(true); @@ -1049,6 +1192,7 @@ describe.skip('TransitGatewayApisV1', () => { expect(foundGRE).toEqual(true); expect(foundClassic).toEqual(true); expect(foundUnboundGRE).toEqual(true); + expect(foundDRS).toEqual(true); done(); } catch (err) { @@ -1353,6 +1497,40 @@ describe.skip('TransitGatewayApisV1', () => { } }); + test('successfully delete DRS connection by instanceID', async done => { + try { + const response = await transitGateway.deleteTransitGatewayConnection({ + transitGatewayId: GATEWAY_INSTANCE_ID, + id: DRS_CONN_INSTANCE_ID, + }); + + expect(response.status).toBe(204); + done(); + } catch (err) { + done(err); + } + }); + + test('successfully waits for the DRS connection to report as deleted', async done => { + try { + const result = await poll( + () => + transitGateway.getTransitGatewayConnection({ + transitGatewayId: GATEWAY_INSTANCE_ID, + id: DRS_CONN_INSTANCE_ID, + }), + result => result.status === 404, + 200 + ); + + expect(result).toBeDefined(); + expect(result.status).toBe(404); + done(); + } catch (err) { + done(err); + } + }); + test('successfully delete VPC connection by instanceID', async done => { try { const response = await transitGateway.deleteTransitGatewayConnection({ diff --git a/test/unit/transit-gateway-apis.v1.test.js b/test/unit/transit-gateway-apis.v1.test.js index a01e4b3..2342949 100644 --- a/test/unit/transit-gateway-apis.v1.test.js +++ b/test/unit/transit-gateway-apis.v1.test.js @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2025. + * (C) Copyright IBM Corp. 2026. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -150,9 +150,11 @@ describe('TransitGatewayApisV1', () => { // Construct the params object for operation listTransitGateways const limit = 50; const start = 'testString'; + const redundancyGroup = 'testString'; const listTransitGatewaysParams = { limit, start, + redundancyGroup, }; const listTransitGatewaysResult = transitGatewayApisService.listTransitGateways(listTransitGatewaysParams); @@ -172,6 +174,7 @@ describe('TransitGatewayApisV1', () => { expect(mockRequestOptions.qs.version).toEqual(transitGatewayApisServiceOptions.version); expect(mockRequestOptions.qs.limit).toEqual(limit); expect(mockRequestOptions.qs.start).toEqual(start); + expect(mockRequestOptions.qs.redundancy_group).toEqual(redundancyGroup); } test('should pass the right params to createRequest with enable and disable retries', () => { @@ -215,9 +218,9 @@ describe('TransitGatewayApisV1', () => { const serviceUrl = transitGatewayApisServiceOptions.url; const path = '/transit_gateways'; const mockPagerResponse1 = - '{"next":{"start":"1"},"transit_gateways":[{"connection_count":5,"connection_needs_attention":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","global":true,"gre_enhanced_route_propagation":true,"id":"0a06fb9b-820f-4c44-8a31-77f1f0806d28","location":"us-south","name":"my-transit-gateway-in-TransitGateway","resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}'; + '{"next":{"start":"1"},"transit_gateways":[{"connection_count":5,"connection_needs_attention":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","global":true,"gre_enhanced_route_propagation":true,"id":"0a06fb9b-820f-4c44-8a31-77f1f0806d28","location":"us-south","name":"my-transit-gateway-in-TransitGateway","redundancy_group":"rg-1","redundancy_group_id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}'; const mockPagerResponse2 = - '{"transit_gateways":[{"connection_count":5,"connection_needs_attention":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","global":true,"gre_enhanced_route_propagation":true,"id":"0a06fb9b-820f-4c44-8a31-77f1f0806d28","location":"us-south","name":"my-transit-gateway-in-TransitGateway","resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}'; + '{"transit_gateways":[{"connection_count":5,"connection_needs_attention":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:transit:dal03:a/57a7d05f36894e3cb9b46a43556d903e::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","global":true,"gre_enhanced_route_propagation":true,"id":"0a06fb9b-820f-4c44-8a31-77f1f0806d28","location":"us-south","name":"my-transit-gateway-in-TransitGateway","redundancy_group":"rg-1","redundancy_group_id":"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4","resource_group":{"href":"https://resource-manager.bluemix.net/v1/resource_groups/56969d6043e9465c883cb9f7363e78e8","id":"56969d6043e9465c883cb9f7363e78e8"},"status":"available","updated_at":"2019-01-01T12:00:00.000Z"}],"total_count":2,"limit":1}'; beforeEach(() => { unmock_createRequest(); @@ -236,6 +239,7 @@ describe('TransitGatewayApisV1', () => { test('getNext()', async () => { const params = { limit: 10, + redundancyGroup: 'testString', }; const allResults = []; const pager = new TransitGatewayApisV1.TransitGatewaysPager(transitGatewayApisService, params); @@ -251,6 +255,7 @@ describe('TransitGatewayApisV1', () => { test('getAll()', async () => { const params = { limit: 10, + redundancyGroup: 'testString', }; const pager = new TransitGatewayApisV1.TransitGatewaysPager(transitGatewayApisService, params); const allResults = await pager.getAll(); @@ -275,12 +280,14 @@ describe('TransitGatewayApisV1', () => { const name = 'my-transit-gateway-in-TransitGateway'; const global = true; const greEnhancedRoutePropagation = true; + const redundancyGroup = 'rg-1'; const resourceGroup = resourceGroupIdentityModel; const createTransitGatewayParams = { location, name, global, greEnhancedRoutePropagation, + redundancyGroup, resourceGroup, }; @@ -302,6 +309,7 @@ describe('TransitGatewayApisV1', () => { expect(mockRequestOptions.body.name).toEqual(name); expect(mockRequestOptions.body.global).toEqual(global); expect(mockRequestOptions.body.gre_enhanced_route_propagation).toEqual(greEnhancedRoutePropagation); + expect(mockRequestOptions.body.redundancy_group).toEqual(redundancyGroup); expect(mockRequestOptions.body.resource_group).toEqual(resourceGroup); expect(mockRequestOptions.qs.version).toEqual(transitGatewayApisServiceOptions.version); } @@ -544,11 +552,13 @@ describe('TransitGatewayApisV1', () => { const global = true; const greEnhancedRoutePropagation = true; const name = 'my-resource'; + const redundancyGroup = 'rg-1'; const updateTransitGatewayParams = { id, global, greEnhancedRoutePropagation, name, + redundancyGroup, }; const updateTransitGatewayResult = transitGatewayApisService.updateTransitGateway(updateTransitGatewayParams); @@ -568,6 +578,7 @@ describe('TransitGatewayApisV1', () => { expect(mockRequestOptions.body.global).toEqual(global); expect(mockRequestOptions.body.gre_enhanced_route_propagation).toEqual(greEnhancedRoutePropagation); expect(mockRequestOptions.body.name).toEqual(name); + expect(mockRequestOptions.body.redundancy_group).toEqual(redundancyGroup); expect(mockRequestOptions.qs.version).toEqual(transitGatewayApisServiceOptions.version); expect(mockRequestOptions.path.id).toEqual(id); } @@ -707,9 +718,9 @@ describe('TransitGatewayApisV1', () => { const serviceUrl = transitGatewayApisServiceOptions.url; const path = '/connections'; const mockPagerResponse1 = - '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}'; + '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","cidr":"198.19.174.0/23","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":1,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}'; const mockPagerResponse2 = - '{"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}'; + '{"total_count":2,"limit":1,"connections":[{"base_network_type":"classic","name":"Transit_Service_BWTN_SJ_DL","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","cidr":"198.19.174.0/23","created_at":"2019-01-01T12:00:00.000Z","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"network_account_id":"network_account_id","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","transit_gateway":{"crn":"crn:v1:bluemix:public:transit:us-south:a/123456::gateway:456f58c1-afe7-123a-0a0a-7f3d720f1a44","id":"456f58c1-afe7-123a-0a0a-7f3d720f1a44","name":"my-transit-gw100"},"tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":1,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}'; beforeEach(() => { unmock_createRequest(); @@ -853,9 +864,9 @@ describe('TransitGatewayApisV1', () => { const serviceUrl = transitGatewayApisServiceOptions.url; const path = '/transit_gateways/testString/connections'; const mockPagerResponse1 = - '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","base_network_type":"classic","cidr":"192.168.0.0/24","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_BWTN_SJ_DL","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}'; + '{"next":{"start":"1"},"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","base_network_type":"classic","cidr":"198.19.174.0/23","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_BWTN_SJ_DL","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":1,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}'; const mockPagerResponse2 = - '{"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","base_network_type":"classic","cidr":"192.168.0.0/24","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_BWTN_SJ_DL","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":13,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}'; + '{"total_count":2,"limit":1,"connections":[{"base_connection_id":"975f58c1-afe7-469a-9727-7f3d720f2d32","base_network_type":"classic","cidr":"198.19.174.0/23","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":64490,"local_gateway_ip":"192.168.100.1","local_tunnel_ip":"192.168.129.2","mtu":9000,"name":"Transit_Service_BWTN_SJ_DL","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","network_type":"vpc","prefix_filters":[{"action":"permit","before":"1a15dcab-7e40-45e1-b7c5-bc690eaa9782","created_at":"2019-01-01T12:00:00.000Z","ge":0,"id":"1a15dcab-7e30-45e1-b7c5-bc690eaa9865","le":32,"prefix":"192.168.100.0/24","updated_at":"2019-01-01T12:00:00.000Z"}],"prefix_filters_default":"permit","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.63.12","remote_tunnel_ip":"192.168.129.1","request_status":"pending","status":"attached","tunnels":[{"base_network_type":"classic","created_at":"2019-01-01T12:00:00.000Z","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","local_bgp_asn":1,"local_gateway_ip":"10.242.63.12","local_tunnel_ip":"192.168.100.20","mtu":9000,"name":"gre1","network_account_id":"network_account_id","network_id":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","remote_bgp_asn":65010,"remote_gateway_ip":"10.242.33.22","remote_tunnel_ip":"192.168.129.1","status":"attached","updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}],"updated_at":"2019-01-01T12:00:00.000Z","zone":{"name":"us-south-1"}}]}'; beforeEach(() => { unmock_createRequest(); @@ -936,7 +947,7 @@ describe('TransitGatewayApisV1', () => { const networkType = 'vpc'; const baseConnectionId = '975f58c1-afe7-469a-9727-7f3d720f2d32'; const baseNetworkType = 'classic'; - const cidr = '192.168.0.0/24'; + const cidr = '198.19.174.0/23'; const localGatewayIp = '192.168.100.1'; const localTunnelIp = '192.168.129.2'; const name = 'Transit_Service_BWTN_SJ_DL'; @@ -2936,4 +2947,242 @@ describe('TransitGatewayApisV1', () => { }); }); }); + + describe('listRedundancyGroups', () => { + describe('positive tests', () => { + function __listRedundancyGroupsTest() { + // Construct the params object for operation listRedundancyGroups + const name = 'testString'; + const listRedundancyGroupsParams = { + name, + }; + + const listRedundancyGroupsResult = transitGatewayApisService.listRedundancyGroups(listRedundancyGroupsParams); + + // all methods should return a Promise + expectToBePromise(listRedundancyGroupsResult); + + // assert that create request was called + expect(createRequestMock).toHaveBeenCalledTimes(1); + + const mockRequestOptions = getOptions(createRequestMock); + + checkUrlAndMethod(mockRequestOptions, '/redundancy_groups', 'GET'); + const expectedAccept = 'application/json'; + const expectedContentType = undefined; + checkMediaHeaders(createRequestMock, expectedAccept, expectedContentType); + expect(mockRequestOptions.qs.version).toEqual(transitGatewayApisServiceOptions.version); + expect(mockRequestOptions.qs.name).toEqual(name); + } + + test('should pass the right params to createRequest with enable and disable retries', () => { + // baseline test + __listRedundancyGroupsTest(); + + // enable retries and test again + createRequestMock.mockClear(); + transitGatewayApisService.enableRetries(); + __listRedundancyGroupsTest(); + + // disable retries and test again + createRequestMock.mockClear(); + transitGatewayApisService.disableRetries(); + __listRedundancyGroupsTest(); + }); + + test('should prioritize user-given headers', () => { + // parameters + const userAccept = 'fake/accept'; + const userContentType = 'fake/contentType'; + const listRedundancyGroupsParams = { + headers: { + Accept: userAccept, + 'Content-Type': userContentType, + }, + }; + + transitGatewayApisService.listRedundancyGroups(listRedundancyGroupsParams); + checkMediaHeaders(createRequestMock, userAccept, userContentType); + }); + + test('should not have any problems when no parameters are passed in', () => { + // invoke the method with no parameters + transitGatewayApisService.listRedundancyGroups({}); + checkForSuccessfulExecution(createRequestMock); + }); + }); + }); + + describe('getRedundancyGroup', () => { + describe('positive tests', () => { + function __getRedundancyGroupTest() { + // Construct the params object for operation getRedundancyGroup + const id = 'testString'; + const getRedundancyGroupParams = { + id, + }; + + const getRedundancyGroupResult = transitGatewayApisService.getRedundancyGroup(getRedundancyGroupParams); + + // all methods should return a Promise + expectToBePromise(getRedundancyGroupResult); + + // assert that create request was called + expect(createRequestMock).toHaveBeenCalledTimes(1); + + const mockRequestOptions = getOptions(createRequestMock); + + checkUrlAndMethod(mockRequestOptions, '/redundancy_groups/{id}', 'GET'); + const expectedAccept = 'application/json'; + const expectedContentType = undefined; + checkMediaHeaders(createRequestMock, expectedAccept, expectedContentType); + expect(mockRequestOptions.qs.version).toEqual(transitGatewayApisServiceOptions.version); + expect(mockRequestOptions.path.id).toEqual(id); + } + + test('should pass the right params to createRequest with enable and disable retries', () => { + // baseline test + __getRedundancyGroupTest(); + + // enable retries and test again + createRequestMock.mockClear(); + transitGatewayApisService.enableRetries(); + __getRedundancyGroupTest(); + + // disable retries and test again + createRequestMock.mockClear(); + transitGatewayApisService.disableRetries(); + __getRedundancyGroupTest(); + }); + + test('should prioritize user-given headers', () => { + // parameters + const id = 'testString'; + const userAccept = 'fake/accept'; + const userContentType = 'fake/contentType'; + const getRedundancyGroupParams = { + id, + headers: { + Accept: userAccept, + 'Content-Type': userContentType, + }, + }; + + transitGatewayApisService.getRedundancyGroup(getRedundancyGroupParams); + checkMediaHeaders(createRequestMock, userAccept, userContentType); + }); + }); + + describe('negative tests', () => { + test('should enforce required parameters', async () => { + let err; + try { + await transitGatewayApisService.getRedundancyGroup({}); + } catch (e) { + err = e; + } + + expect(err.message).toMatch(/Missing required parameters/); + }); + + test('should reject promise when required params are not given', async () => { + let err; + try { + await transitGatewayApisService.getRedundancyGroup(); + } catch (e) { + err = e; + } + + expect(err.message).toMatch(/Missing required parameters/); + }); + }); + }); + + describe('updateRedundancyGroup', () => { + describe('positive tests', () => { + function __updateRedundancyGroupTest() { + // Construct the params object for operation updateRedundancyGroup + const id = 'testString'; + const name = 'new-rg-name'; + const updateRedundancyGroupParams = { + id, + name, + }; + + const updateRedundancyGroupResult = transitGatewayApisService.updateRedundancyGroup(updateRedundancyGroupParams); + + // all methods should return a Promise + expectToBePromise(updateRedundancyGroupResult); + + // assert that create request was called + expect(createRequestMock).toHaveBeenCalledTimes(1); + + const mockRequestOptions = getOptions(createRequestMock); + + checkUrlAndMethod(mockRequestOptions, '/redundancy_groups/{id}', 'PATCH'); + const expectedAccept = 'application/json'; + const expectedContentType = 'application/merge-patch+json'; + checkMediaHeaders(createRequestMock, expectedAccept, expectedContentType); + expect(mockRequestOptions.body.name).toEqual(name); + expect(mockRequestOptions.qs.version).toEqual(transitGatewayApisServiceOptions.version); + expect(mockRequestOptions.path.id).toEqual(id); + } + + test('should pass the right params to createRequest with enable and disable retries', () => { + // baseline test + __updateRedundancyGroupTest(); + + // enable retries and test again + createRequestMock.mockClear(); + transitGatewayApisService.enableRetries(); + __updateRedundancyGroupTest(); + + // disable retries and test again + createRequestMock.mockClear(); + transitGatewayApisService.disableRetries(); + __updateRedundancyGroupTest(); + }); + + test('should prioritize user-given headers', () => { + // parameters + const id = 'testString'; + const userAccept = 'fake/accept'; + const userContentType = 'fake/contentType'; + const updateRedundancyGroupParams = { + id, + headers: { + Accept: userAccept, + 'Content-Type': userContentType, + }, + }; + + transitGatewayApisService.updateRedundancyGroup(updateRedundancyGroupParams); + checkMediaHeaders(createRequestMock, userAccept, userContentType); + }); + }); + + describe('negative tests', () => { + test('should enforce required parameters', async () => { + let err; + try { + await transitGatewayApisService.updateRedundancyGroup({}); + } catch (e) { + err = e; + } + + expect(err.message).toMatch(/Missing required parameters/); + }); + + test('should reject promise when required params are not given', async () => { + let err; + try { + await transitGatewayApisService.updateRedundancyGroup(); + } catch (e) { + err = e; + } + + expect(err.message).toMatch(/Missing required parameters/); + }); + }); + }); }); diff --git a/transit-gateway-apis/v1.ts b/transit-gateway-apis/v1.ts index e234932..685707f 100644 --- a/transit-gateway-apis/v1.ts +++ b/transit-gateway-apis/v1.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2025. + * (C) Copyright IBM Corp. 2026. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.107.1-41b0fbd0-20250825-080732 + * IBM OpenAPI SDK Code Generator Version: 3.112.0-f88e9264-20260220-115155 */ /* eslint-disable max-classes-per-file */ @@ -116,11 +116,17 @@ class TransitGatewayApisV1 extends BaseService { /** * Retrieves all Transit Gateways. * - * List all Transit Gateways in account the caller is authorized to view. + * List all Transit Gateways in the account the caller is authorized to view. Use the `limit` (integer, 1–100, default + * 50) and `start` (string token) parameters to page through results. Optionally filter by `redundancy_group` name. + * Each `TransitGateway` in the response includes: `id`, `name`, `crn`, `location`, + * `status` (pending, available, deleting, deleted, failed), `global` (boolean), + * `created_at`, `updated_at`, `resource_group`, and optionally `redundancy_group`, + * `redundancy_group_id`, `gre_enhanced_route_propagation`, and `connection_needs_attention`. * * @param {Object} [params] - The parameters to send to the service. * @param {number} [params.limit] - The maximum number of resources to return per page. * @param {string} [params.start] - A server supplied token determining which resource to start the page on. + * @param {string} [params.redundancyGroup] - Filter the list of transit gateways by redundancy group name. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -129,7 +135,7 @@ class TransitGatewayApisV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['limit', 'start', 'signal', 'headers']; + const _validParams = ['limit', 'start', 'redundancyGroup', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -139,6 +145,7 @@ class TransitGatewayApisV1 extends BaseService { 'version': this.version, 'limit': _params.limit, 'start': _params.start, + 'redundancy_group': _params.redundancyGroup, }; const sdkHeaders = getSdkHeaders(TransitGatewayApisV1.DEFAULT_SERVICE_NAME, 'v1', 'listTransitGateways'); @@ -171,7 +178,11 @@ class TransitGatewayApisV1 extends BaseService { /** * Creates a Transit Gateway. * - * Create a Transit Gateway based on the supplied input template. + * Create a Transit Gateway based on the supplied input template. Required fields: `name` (string, 1–60 chars), + * `location` (IBM Cloud region, e.g. us-south). Optional fields: `global` (boolean, enables cross-region routing), + * `resource_group` (object with `id`), `redundancy_group` (string, name of the redundancy group to join), + * `gre_enhanced_route_propagation` (boolean). Returns a `TransitGateway` object. Initial `status` will be `pending` + * while provisioning. * * @param {Object} params - The parameters to send to the service. * @param {string} params.location - Location of Transit Gateway Services. @@ -181,6 +192,10 @@ class TransitGatewayApisV1 extends BaseService { * @param {boolean} [params.greEnhancedRoutePropagation] - Allow route propagation across all GREs connected to the * same transit gateway. This affects connections on the gateway of type `redundant_gre`, `unbound_gre_tunnel` and * `gre_tunnel`. + * @param {string} [params.redundancyGroup] - Include the global transit gateway in this redundancy group. When set, + * this transit gateway will be redundant to other transit gateways in this redundancy group. If this redundancy group + * doesn't exist in the account, it will be created. This property can only be set for global transit gateways and the + * transit gateway cannot be in a location already used by a global transit gateway in this redundancy group. * @param {ResourceGroupIdentity} [params.resourceGroup] - The resource group to use. If unspecified, the account's * [default resource group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers @@ -191,7 +206,7 @@ class TransitGatewayApisV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['location', 'name']; - const _validParams = ['location', 'name', 'global', 'greEnhancedRoutePropagation', 'resourceGroup', 'signal', 'headers']; + const _validParams = ['location', 'name', 'global', 'greEnhancedRoutePropagation', 'redundancyGroup', 'resourceGroup', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -202,6 +217,7 @@ class TransitGatewayApisV1 extends BaseService { 'name': _params.name, 'global': _params.global, 'gre_enhanced_route_propagation': _params.greEnhancedRoutePropagation, + 'redundancy_group': _params.redundancyGroup, 'resource_group': _params.resourceGroup, }; @@ -241,8 +257,8 @@ class TransitGatewayApisV1 extends BaseService { /** * Deletes specified Transit Gateway. * - * This request deletes a Transit Gateway. This operation cannot be reversed. For this request to succeed, the Transit - * Gateway must not contain connections. + * Delete a Transit Gateway specified by its `id` path parameter. This operation cannot be reversed. The gateway must + * have no attached connections before it can be deleted; remove all connections first. * * @param {Object} params - The parameters to send to the service. * @param {string} params.id - The Transit Gateway identifier. @@ -298,7 +314,10 @@ class TransitGatewayApisV1 extends BaseService { /** * Retrieves specified Transit Gateway. * - * This request retrieves a single Transit Gateway specified by the identifier in the URL. + * Retrieve a single Transit Gateway specified by its `id` path parameter. Returns a `TransitGateway` object + * containing: `id`, `name`, `crn`, `location`, + * `status`, `global`, `created_at`, `updated_at`, `resource_group`, and optionally + * `redundancy_group`, `redundancy_group_id`, `gre_enhanced_route_propagation`, and `connection_needs_attention`. * * @param {Object} params - The parameters to send to the service. * @param {string} params.id - The Transit Gateway identifier. @@ -355,15 +374,22 @@ class TransitGatewayApisV1 extends BaseService { /** * Updates specified Transit Gateway. * - * This request updates a Transit Gateway's name and/or global flag. + * Update a Transit Gateway specified by its `id` path parameter. Updatable fields: `name` (string), `global` + * (boolean), `redundancy_group` (string, assigns the gateway to a redundancy group), `gre_enhanced_route_propagation` + * (boolean). Returns the updated `TransitGateway` object. * * @param {Object} params - The parameters to send to the service. * @param {string} params.id - The Transit Gateway identifier. - * @param {boolean} [params.global] - Allow global routing for a Transit Gateway. + * @param {boolean} [params.global] - Allow global routing for a Transit Gateway. This property cannot be changed if + * the transit gateway has redundancy_group set. * @param {boolean} [params.greEnhancedRoutePropagation] - Allow route propagation across all GREs connected to the * same transit gateway. This affects connections on the gateway of type `redundant_gre`, `unbound_gre_tunnel` and * `gre_tunnel`. It takes a few minutes for the change to take effect. * @param {string} [params.name] - A human readable name for a resource. + * @param {string} [params.redundancyGroup] - Create a new redundancy group with this name and add the gateway to it. + * This property is only valid when the gateway is global (or `global` is set to `true` in the same request), the + * gateway is not already a member of a redundancy group, and no redundancy group with this name already exists in the + * account. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -372,7 +398,7 @@ class TransitGatewayApisV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['id']; - const _validParams = ['id', 'global', 'greEnhancedRoutePropagation', 'name', 'signal', 'headers']; + const _validParams = ['id', 'global', 'greEnhancedRoutePropagation', 'name', 'redundancyGroup', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -382,6 +408,7 @@ class TransitGatewayApisV1 extends BaseService { 'global': _params.global, 'gre_enhanced_route_propagation': _params.greEnhancedRoutePropagation, 'name': _params.name, + 'redundancy_group': _params.redundancyGroup, }; const query = { @@ -428,7 +455,11 @@ class TransitGatewayApisV1 extends BaseService { /** * Retrieves all connections. * - * List all transit gateway connections associated with this account. + * List all transit gateway connections associated with this account. Results can be filtered by `network_id` or + * `network_type`. Use the `limit` and `start` parameters to page through large result sets. The response includes a + * `TransitConnection` object for each connection, containing fields such as `id`, `name`, `network_type`, + * `status`, `created_at`, `updated_at`, and optionally `prefix_filters`, `request_status`, and `transit_gateway` + * reference. * * @param {Object} [params] - The parameters to send to the service. * @param {number} [params.limit] - The maximum number of resources to return per page. @@ -569,29 +600,32 @@ class TransitGatewayApisV1 extends BaseService { * @param {string} [params.baseNetworkType] - The type of network the Unbound GRE tunnel is targeting. This field is * required for network type `unbound_gre_tunnel` and must be set to `classic`. For a `redundant_gre` network type, * the value is required and can be either VPC or Classic. This field is required to be unspecified for network type - * `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `gre_tunnel` connections. - * @param {string} [params.cidr] - network_type 'vpn_gateway' connections use 'cidr' to specify the CIDR to use for - * the VPN GRE tunnels. + * `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `gre_tunnel` + * connections. + * @param {string} [params.cidr] - network_type `vpn_gateway` and `dynamic_route_server`connections use `cidr` to + * specify the CIDR to use for the VPN gateway / Dynamic route server GRE tunnels. * - * This field is required for network type `vpn_gateway` connections. + * This field is optional for network type `vpn_gateway` and `dynamic_route_server` connections. If unspecified, the + * default value is 198.19.174.0/23. * * This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, `power_virtual_server`, * `gre_tunnel`, `unbound_gre_tunnel`, and `redundant_gre` connections. * @param {string} [params.localGatewayIp] - Local gateway IP address. This field is required for network type * `gre_tunnel` and `unbound_gre_tunnel` connections. This field is required to be unspecified for network type - * `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `redundant_gre` connections. + * `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `redundant_gre` + * connections. * @param {string} [params.localTunnelIp] - Local tunnel IP address. The local_tunnel_ip and remote_tunnel_ip * addresses must be in the same /30 network. Neither can be the network nor broadcast addresses. * * This field is required for network type `gre_tunnel` and `unbound_gre_tunnel` connections. * * This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, `power_virtual_server`, - * `vpn_gateway` and `redundant_gre` connections. + * `vpn_gateway`, `dynamic_route_server` and `redundant_gre` connections. * @param {string} [params.name] - The user-defined name for this transit gateway connection. Network type `vpc` * connections are defaulted to the name of the VPC. Network type `classic` connections are named `classic`. * * This field is required for network type `power_virtual_server`, `directlink`, `gre_tunnel`, `unbound_gre_tunnel`, - * `vpn_gateway` and `redundant_gre` connections. + * `vpn_gateway`, `dynamic_route_server` and `redundant_gre` connections. * * This field is optional for network type `classic`, `vpc` connections. * @param {string} [params.networkAccountId] - The ID of the account which owns the network that is being connected. @@ -599,22 +633,22 @@ class TransitGatewayApisV1 extends BaseService { * `unbound_gre_tunnel` when the associated_network_type is `classic` or network_type is `redundant_gre` and the GRE * tunnel is in a different account than the gateway. * @param {string} [params.networkId] - The ID of the network being connected via this connection. For network types - * `vpc`,`power_virtual_server`, `directlink` and `vpn_gateway` this is the CRN of the VPC / PowerVS / VDC / Direct - * Link / VPN gateway respectively. This field is required for network type `vpc`, `power_virtual_server`, - * `vpn_gateway`, and `directlink` connections. It is also required for `redundant_gre` connections when the - * base_network_type is set to VPC. This field is required to be unspecified for network type `classic`, `gre_tunnel` - * and `unbound_gre_tunnel` connections. + * `vpc`, `vpn_gateway`, `dynamic_route_server`, `power_virtual_server` and `directlink` this is the CRN of the VPC / + * VPN / Dynamic Route Server / PowerVS / Direct Link gateway respectively. This field is required for network type + * `vpc`, `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `directlink` connections. It is also + * required for `redundant_gre` connections when the base_network_type is set to VPC. This field is required to be + * unspecified for network type `classic`, `gre_tunnel` and `unbound_gre_tunnel` connections. * @param {TransitGatewayConnectionPrefixFilter[]} [params.prefixFilters] - Array of prefix route filters for a * transit gateway connection. Prefix filters can be specified for netowrk type `vpc`, `classic`, * `power_virtual_server` and `directlink` connections. They are not allowed for type `gre_tunnel` connections. This * is order dependent with those first in the array being applied first, and those at the end of the array being * applied last, or just before applying the default. This field is optional for network type `classic`, `vpc`, * `directlink`, and `power_virtual_server` connections. This field is required to be unspecified for network type - * `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway` and `redundant_gre` connections. + * `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway`, `dynamic_route_server` and `redundant_gre` connections. * @param {string} [params.prefixFiltersDefault] - Default setting of permit or deny which applies to any routes that * don't match a specified filter. This field is optional for network type `classic`, `vpc`, `directlink`, and * `power_virtual_server` connections. This field is required to be unspecified for network type `gre_tunnel`, - * `unbound_gre_tunnel`, `vpn_gateway` and `redundant_gre` connections. + * `unbound_gre_tunnel`, `vpn_gateway`, `dynamic_route_server` and `redundant_gre` connections. * @param {number} [params.remoteBgpAsn] - Remote network BGP ASN. The following ASN values are reserved and * unavailable 0, 13884, 36351, 64512, 64513, 65100, 65200-65234, 65402-65433, 65500, 65516, 65519, 65521, 65531 and * 4201065000-4201065999. If `remote_bgp_asn` is omitted on gre_tunnel or unbound_gre_tunnel connection create @@ -623,17 +657,18 @@ class TransitGatewayApisV1 extends BaseService { * This field is optional for network type `gre_tunnel` and `unbound_gre_tunnel` connections. * * This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, `power_virtual_server`, - * `vpn_gateway` and `gre_tunnel` connections. + * `vpn_gateway`, `dynamic_route_server` and `gre_tunnel` connections. * @param {string} [params.remoteGatewayIp] - Remote gateway IP address. This field is required for network type * `gre_tunnel` and `unbound_gre_tunnel` connections. This field is required to be unspecified for network type - * `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `redundant_gre` connections. + * `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `redundant_gre` + * connections. * @param {string} [params.remoteTunnelIp] - Remote tunnel IP address. The local_tunnel_ip and remote_tunnel_ip * addresses must be in the same /30 network. Neither can be the network nor broadcast addresses. * * This field is required for network type `gre_tunnel` and `unbound_gre_tunnel` connections. * * This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, `power_virtual_server`, - * `vpn_gateway` and `redundant_gre` connections. + * `vpn_gateway`, `dynamic_route_server` and `redundant_gre` connections. * @param {TransitGatewayTunnelTemplate[]} [params.tunnels] - Array of GRE tunnels for a transit gateway * `redundant_gre` connections. This field is required for `redundant_gre` connections. * @param {ZoneIdentity} [params.zone] - Specify the connection's location. The specified availability zone must @@ -644,8 +679,8 @@ class TransitGatewayApisV1 extends BaseService { * * This field is optional for network type `vpn_gateway` connections. * - * This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, `power_virtual_server` - * and `redundant_gre` connections. + * This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, `power_virtual_server`, + * `redundant_gre` and `dynamic_route_server` connections. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -2021,6 +2056,183 @@ class TransitGatewayApisV1 extends BaseService { }), }; + return this.createRequest(parameters); + } + /************************* + * redundancyGroups + ************************/ + + /** + * Lists all redundancy groups in the account. + * + * List all redundancy groups for the account. + * + * @param {Object} [params] - The parameters to send to the service. + * @param {string} [params.name] - Filter the list of redundancy groups by name. + * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers + * @returns {Promise>} + */ + public listRedundancyGroups( + params?: TransitGatewayApisV1.ListRedundancyGroupsParams + ): Promise> { + const _params = { ...params }; + const _requiredParams = []; + const _validParams = ['name', 'signal', 'headers']; + const _validationErrors = validateParams(_params, _requiredParams, _validParams); + if (_validationErrors) { + return Promise.reject(_validationErrors); + } + + const query = { + 'version': this.version, + 'name': _params.name, + }; + + const sdkHeaders = getSdkHeaders(TransitGatewayApisV1.DEFAULT_SERVICE_NAME, 'v1', 'listRedundancyGroups'); + + const parameters = { + options: { + url: '/redundancy_groups', + method: 'GET', + qs: query, + }, + defaultOptions: extend(true, {}, this.baseOptions, { + headers: extend( + true, + sdkHeaders, + this.baseOptions.headers, + { + 'Accept': 'application/json', + }, + _params.headers + ), + axiosOptions: { + signal: _params.signal, + }, + }), + }; + + return this.createRequest(parameters); + } + + /** + * Retrieves specified redundancy group. + * + * Retrieves a single redundancy group specified by the identifier in the URL. + * + * @param {Object} params - The parameters to send to the service. + * @param {string} params.id - The redundancy group identifier. + * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers + * @returns {Promise>} + */ + public getRedundancyGroup( + params: TransitGatewayApisV1.GetRedundancyGroupParams + ): Promise> { + const _params = { ...params }; + const _requiredParams = ['id']; + const _validParams = ['id', 'signal', 'headers']; + const _validationErrors = validateParams(_params, _requiredParams, _validParams); + if (_validationErrors) { + return Promise.reject(_validationErrors); + } + + const query = { + 'version': this.version, + }; + + const path = { + 'id': _params.id, + }; + + const sdkHeaders = getSdkHeaders(TransitGatewayApisV1.DEFAULT_SERVICE_NAME, 'v1', 'getRedundancyGroup'); + + const parameters = { + options: { + url: '/redundancy_groups/{id}', + method: 'GET', + qs: query, + path, + }, + defaultOptions: extend(true, {}, this.baseOptions, { + headers: extend( + true, + sdkHeaders, + this.baseOptions.headers, + { + 'Accept': 'application/json', + }, + _params.headers + ), + axiosOptions: { + signal: _params.signal, + }, + }), + }; + + return this.createRequest(parameters); + } + + /** + * Updates a redundancy group. + * + * Update a redundancy group. + * + * @param {Object} params - The parameters to send to the service. + * @param {string} params.id - The redundancy group identifier. + * @param {string} [params.name] - The new name for the redundancy group. + * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers + * @returns {Promise>} + */ + public updateRedundancyGroup( + params: TransitGatewayApisV1.UpdateRedundancyGroupParams + ): Promise> { + const _params = { ...params }; + const _requiredParams = ['id']; + const _validParams = ['id', 'name', 'signal', 'headers']; + const _validationErrors = validateParams(_params, _requiredParams, _validParams); + if (_validationErrors) { + return Promise.reject(_validationErrors); + } + + const body = { + 'name': _params.name, + }; + + const query = { + 'version': this.version, + }; + + const path = { + 'id': _params.id, + }; + + const sdkHeaders = getSdkHeaders(TransitGatewayApisV1.DEFAULT_SERVICE_NAME, 'v1', 'updateRedundancyGroup'); + + const parameters = { + options: { + url: '/redundancy_groups/{id}', + method: 'PATCH', + body, + qs: query, + path, + }, + defaultOptions: extend(true, {}, this.baseOptions, { + headers: extend( + true, + sdkHeaders, + this.baseOptions.headers, + { + 'Accept': 'application/json', + 'Content-Type': 'application/merge-patch+json', + }, + _params.headers + ), + axiosOptions: { + signal: _params.signal, + }, + }), + }; + return this.createRequest(parameters); } } @@ -2072,6 +2284,8 @@ namespace TransitGatewayApisV1 { limit?: number; /** A server supplied token determining which resource to start the page on. */ start?: string; + /** Filter the list of transit gateways by redundancy group name. */ + redundancyGroup?: string; } /** Parameters for the `createTransitGateway` operation. */ @@ -2086,6 +2300,12 @@ namespace TransitGatewayApisV1 { * the gateway of type `redundant_gre`, `unbound_gre_tunnel` and `gre_tunnel`. */ greEnhancedRoutePropagation?: boolean; + /** Include the global transit gateway in this redundancy group. When set, this transit gateway will be + * redundant to other transit gateways in this redundancy group. If this redundancy group doesn't exist in the + * account, it will be created. This property can only be set for global transit gateways and the transit gateway + * cannot be in a location already used by a global transit gateway in this redundancy group. + */ + redundancyGroup?: string; /** The resource group to use. If unspecified, the account's [default resource * group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. */ @@ -2108,7 +2328,9 @@ namespace TransitGatewayApisV1 { export interface UpdateTransitGatewayParams extends DefaultParams { /** The Transit Gateway identifier. */ id: string; - /** Allow global routing for a Transit Gateway. */ + /** Allow global routing for a Transit Gateway. This property cannot be changed if the transit gateway has + * redundancy_group set. + */ global?: boolean; /** Allow route propagation across all GREs connected to the same transit gateway. This affects connections on * the gateway of type `redundant_gre`, `unbound_gre_tunnel` and `gre_tunnel`. It takes a few minutes for the @@ -2117,6 +2339,11 @@ namespace TransitGatewayApisV1 { greEnhancedRoutePropagation?: boolean; /** A human readable name for a resource. */ name?: string; + /** Create a new redundancy group with this name and add the gateway to it. This property is only valid when the + * gateway is global (or `global` is set to `true` in the same request), the gateway is not already a member of a + * redundancy group, and no redundancy group with this name already exists in the account. + */ + redundancyGroup?: string; } /** Parameters for the `listConnections` operation. */ @@ -2162,12 +2389,14 @@ namespace TransitGatewayApisV1 { /** The type of network the Unbound GRE tunnel is targeting. This field is required for network type * `unbound_gre_tunnel` and must be set to `classic`. For a `redundant_gre` network type, the value is required * and can be either VPC or Classic. This field is required to be unspecified for network type `classic`, - * `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `gre_tunnel` connections. + * `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `gre_tunnel` connections. */ baseNetworkType?: CreateTransitGatewayConnectionConstants.BaseNetworkType | string; - /** network_type 'vpn_gateway' connections use 'cidr' to specify the CIDR to use for the VPN GRE tunnels. + /** network_type `vpn_gateway` and `dynamic_route_server`connections use `cidr` to specify the CIDR to use for + * the VPN gateway / Dynamic route server GRE tunnels. * - * This field is required for network type `vpn_gateway` connections. + * This field is optional for network type `vpn_gateway` and `dynamic_route_server` connections. If unspecified, + * the default value is 198.19.174.0/23. * * This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, * `power_virtual_server`, `gre_tunnel`, `unbound_gre_tunnel`, and `redundant_gre` connections. @@ -2175,7 +2404,7 @@ namespace TransitGatewayApisV1 { cidr?: string; /** Local gateway IP address. This field is required for network type `gre_tunnel` and `unbound_gre_tunnel` * connections. This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, - * `power_virtual_server`, `vpn_gateway` and `redundant_gre` connections. + * `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `redundant_gre` connections. */ localGatewayIp?: string; /** Local tunnel IP address. The local_tunnel_ip and remote_tunnel_ip addresses must be in the same /30 network. @@ -2184,14 +2413,14 @@ namespace TransitGatewayApisV1 { * This field is required for network type `gre_tunnel` and `unbound_gre_tunnel` connections. * * This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, - * `power_virtual_server`, `vpn_gateway` and `redundant_gre` connections. + * `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `redundant_gre` connections. */ localTunnelIp?: string; /** The user-defined name for this transit gateway connection. Network type `vpc` connections are defaulted to * the name of the VPC. Network type `classic` connections are named `classic`. * * This field is required for network type `power_virtual_server`, `directlink`, `gre_tunnel`, - * `unbound_gre_tunnel`, `vpn_gateway` and `redundant_gre` connections. + * `unbound_gre_tunnel`, `vpn_gateway`, `dynamic_route_server` and `redundant_gre` connections. * * This field is optional for network type `classic`, `vpc` connections. */ @@ -2202,12 +2431,12 @@ namespace TransitGatewayApisV1 { * account than the gateway. */ networkAccountId?: string; - /** The ID of the network being connected via this connection. For network types `vpc`,`power_virtual_server`, - * `directlink` and `vpn_gateway` this is the CRN of the VPC / PowerVS / VDC / Direct Link / VPN gateway - * respectively. This field is required for network type `vpc`, `power_virtual_server`, `vpn_gateway`, and - * `directlink` connections. It is also required for `redundant_gre` connections when the base_network_type is set - * to VPC. This field is required to be unspecified for network type `classic`, `gre_tunnel` and - * `unbound_gre_tunnel` connections. + /** The ID of the network being connected via this connection. For network types `vpc`, `vpn_gateway`, + * `dynamic_route_server`, `power_virtual_server` and `directlink` this is the CRN of the VPC / VPN / Dynamic Route + * Server / PowerVS / Direct Link gateway respectively. This field is required for network type `vpc`, + * `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `directlink` connections. It is also required + * for `redundant_gre` connections when the base_network_type is set to VPC. This field is required to be + * unspecified for network type `classic`, `gre_tunnel` and `unbound_gre_tunnel` connections. */ networkId?: string; /** Array of prefix route filters for a transit gateway connection. Prefix filters can be specified for netowrk @@ -2215,14 +2444,14 @@ namespace TransitGatewayApisV1 { * `gre_tunnel` connections. This is order dependent with those first in the array being applied first, and those * at the end of the array being applied last, or just before applying the default. This field is optional for * network type `classic`, `vpc`, `directlink`, and `power_virtual_server` connections. This field is required to - * be unspecified for network type `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway` and `redundant_gre` - * connections. + * be unspecified for network type `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway`, `dynamic_route_server` and + * `redundant_gre` connections. */ prefixFilters?: TransitGatewayConnectionPrefixFilter[]; /** Default setting of permit or deny which applies to any routes that don't match a specified filter. This * field is optional for network type `classic`, `vpc`, `directlink`, and `power_virtual_server` connections. This - * field is required to be unspecified for network type `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway` and - * `redundant_gre` connections. + * field is required to be unspecified for network type `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway`, + * `dynamic_route_server` and `redundant_gre` connections. */ prefixFiltersDefault?: CreateTransitGatewayConnectionConstants.PrefixFiltersDefault | string; /** Remote network BGP ASN. The following ASN values are reserved and unavailable 0, 13884, 36351, 64512, 64513, @@ -2233,12 +2462,12 @@ namespace TransitGatewayApisV1 { * This field is optional for network type `gre_tunnel` and `unbound_gre_tunnel` connections. * * This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, - * `power_virtual_server`, `vpn_gateway` and `gre_tunnel` connections. + * `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `gre_tunnel` connections. */ remoteBgpAsn?: number; /** Remote gateway IP address. This field is required for network type `gre_tunnel` and `unbound_gre_tunnel` * connections. This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, - * `power_virtual_server`, `vpn_gateway` and `redundant_gre` connections. + * `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `redundant_gre` connections. */ remoteGatewayIp?: string; /** Remote tunnel IP address. The local_tunnel_ip and remote_tunnel_ip addresses must be in the same /30 @@ -2247,7 +2476,7 @@ namespace TransitGatewayApisV1 { * This field is required for network type `gre_tunnel` and `unbound_gre_tunnel` connections. * * This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, - * `power_virtual_server`, `vpn_gateway` and `redundant_gre` connections. + * `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `redundant_gre` connections. */ remoteTunnelIp?: string; /** Array of GRE tunnels for a transit gateway `redundant_gre` connections. This field is required for @@ -2261,8 +2490,8 @@ namespace TransitGatewayApisV1 { * * This field is optional for network type `vpn_gateway` connections. * - * This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, `power_virtual_server` - * and `redundant_gre` connections. + * This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, + * `power_virtual_server`, `redundant_gre` and `dynamic_route_server` connections. */ zone?: ZoneIdentity; } @@ -2279,13 +2508,14 @@ namespace TransitGatewayApisV1 { POWER_VIRTUAL_SERVER = 'power_virtual_server', REDUNDANT_GRE = 'redundant_gre', VPN_GATEWAY = 'vpn_gateway', + DYNAMIC_ROUTE_SERVER = 'dynamic_route_server', } - /** The type of network the Unbound GRE tunnel is targeting. This field is required for network type `unbound_gre_tunnel` and must be set to `classic`. For a `redundant_gre` network type, the value is required and can be either VPC or Classic. This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `gre_tunnel` connections. */ + /** The type of network the Unbound GRE tunnel is targeting. This field is required for network type `unbound_gre_tunnel` and must be set to `classic`. For a `redundant_gre` network type, the value is required and can be either VPC or Classic. This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `gre_tunnel` connections. */ export enum BaseNetworkType { CLASSIC = 'classic', VPC = 'vpc', } - /** Default setting of permit or deny which applies to any routes that don't match a specified filter. This field is optional for network type `classic`, `vpc`, `directlink`, and `power_virtual_server` connections. This field is required to be unspecified for network type `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway` and `redundant_gre` connections. */ + /** Default setting of permit or deny which applies to any routes that don't match a specified filter. This field is optional for network type `classic`, `vpc`, `directlink`, and `power_virtual_server` connections. This field is required to be unspecified for network type `gre_tunnel`, `unbound_gre_tunnel`, `vpn_gateway`, `dynamic_route_server` and `redundant_gre` connections. */ export enum PrefixFiltersDefault { PERMIT = 'permit', DENY = 'deny', @@ -2588,6 +2818,26 @@ namespace TransitGatewayApisV1 { id: string; } + /** Parameters for the `listRedundancyGroups` operation. */ + export interface ListRedundancyGroupsParams extends DefaultParams { + /** Filter the list of redundancy groups by name. */ + name?: string; + } + + /** Parameters for the `getRedundancyGroup` operation. */ + export interface GetRedundancyGroupParams extends DefaultParams { + /** The redundancy group identifier. */ + id: string; + } + + /** Parameters for the `updateRedundancyGroup` operation. */ + export interface UpdateRedundancyGroupParams extends DefaultParams { + /** The redundancy group identifier. */ + id: string; + /** The new name for the redundancy group. */ + name?: string; + } + /************************* * model interfaces ************************/ @@ -2710,6 +2960,28 @@ namespace TransitGatewayApisV1 { } } + /** + * A redundancy group. + */ + export interface RedundancyGroup { + /** The date and time that this redundancy group was created. */ + created_at: string; + /** The unique identifier for this redundancy group. */ + id: string; + /** The redundancy group name. */ + name: string; + /** The date and time that this redundancy group was last updated. */ + updated_at?: string; + } + + /** + * A list of redundancy groups. + */ + export interface RedundancyGroupCollection { + /** Collection of redundancy groups. */ + redundancy_groups: RedundancyGroup[]; + } + /** * The resource group to use. If unspecified, the account's [default resource * group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. @@ -2773,13 +3045,13 @@ namespace TransitGatewayApisV1 { */ export interface RouteReportConnection { /** Array of connection's bgps. */ - bgps?: RouteReportConnectionBgp[]; + bgps: RouteReportConnectionBgp[]; /** connection ID. */ id?: string; /** connection name. */ name?: string; /** Array of connection's routes. */ - routes?: RouteReportConnectionRoute[]; + routes: RouteReportConnectionRoute[]; /** connection type. */ type?: string; } @@ -2821,7 +3093,7 @@ namespace TransitGatewayApisV1 { */ export interface RouteReportOverlappingRouteGroup { /** Array of overlapping connection/prefix pairs. */ - routes?: RouteReportOverlappingRoute[]; + routes: RouteReportOverlappingRoute[]; } /** @@ -2841,7 +3113,7 @@ namespace TransitGatewayApisV1 { /** The name of the location. */ name: string; /** Array of supported connection types. */ - supported_connection_types?: string[]; + supported_connection_types: string[]; /** The type of the location, determining is this a multi-zone region, a single data center, or a point of * presence. The list of enumerated values for this property may expand in the future. Code and processes using * this field must tolerate unexpected values. @@ -2899,9 +3171,9 @@ namespace TransitGatewayApisV1 { /** The user-defined name for this transit gateway connection. */ name: string; /** The ID of the network being connected via this connection. This field is required for some types, such as - * `vpc`, `power_virtual_server`, `directlink`, `vpn_gateway` and `redundant_gre`. For network types `vpc`, - * `redundant_gre`, `power_virtual_server` and `directlink` this is the CRN of the VPC / PowerVS / VDC / Direct - * Link gateway respectively. + * `vpc`, `power_virtual_server`, `directlink`, `vpn_gateway`, `dynamic_route_server` and `redundant_gre`. For + * network types `vpc`, `vpn_gateway`, `dynamic_route_server`, `power_virtual_server` and `directlink` this is the + * CRN of the VPC / VPN / Dynamic Route Server / PowerVS / Direct Link gateway respectively. */ network_id?: string; /** Defines what type of network is connected via this connection. The list of enumerated values for this @@ -2917,6 +3189,10 @@ namespace TransitGatewayApisV1 { * `gre_tunnel` connections. */ base_connection_id?: string; + /** network_type `vpn_gateway` and `dynamic_route_server` connections use `cidr` to specify the CIDR to use for + * the `VPN gateway / Dynamic route server` GRE tunnels. + */ + cidr?: string; /** The date and time that this connection was created. */ created_at: string; /** Local network BGP ASN. This field only applies to network type `gre_tunnel` and `unbound_gre_tunnel` @@ -2971,7 +3247,7 @@ namespace TransitGatewayApisV1 { status: TransitConnection.Constants.Status | string; /** Transit gateway reference. */ transit_gateway: TransitGatewayReference; - /** Collection of all tunnels for `redundant_gre` and `vpn_gateway` connections. */ + /** Collection of all tunnels for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. */ tunnels?: TransitGatewayTunnel[]; /** The date and time that this connection was last updated. */ updated_at: string; @@ -2984,7 +3260,6 @@ namespace TransitGatewayApisV1 { export enum BaseNetworkType { CLASSIC = 'classic', VPC = 'vpc', - VPN = 'vpn', } /** Defines what type of network is connected via this connection. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. */ export enum NetworkType { @@ -2996,6 +3271,7 @@ namespace TransitGatewayApisV1 { POWER_VIRTUAL_SERVER = 'power_virtual_server', REDUNDANT_GRE = 'redundant_gre', VPN_GATEWAY = 'vpn_gateway', + DYNAMIC_ROUTE_SERVER = 'dynamic_route_server', } /** Default setting of permit or deny which applies to any routes that don't match a specified filter. This field does not apply to the `redundant_gre` network types. */ export enum PrefixFiltersDefault { @@ -3063,6 +3339,12 @@ namespace TransitGatewayApisV1 { location: string; /** A human readable name for the transit gateway. */ name: string; + /** The redundancy group for this global transit gateway. The global transit gateways in this redundancy group + * will be redundant to each other. + */ + redundancy_group?: string; + /** The unique identifier of the redundancy group for this global transit gateway. */ + redundancy_group_id?: string; /** The resource group to use. If unspecified, the account's [default resource * group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. */ @@ -3136,10 +3418,12 @@ namespace TransitGatewayApisV1 { /** The type of network the Unbound GRE tunnel is targeting. This field is required for network type * `unbound_gre_tunnel` and must be set to `classic`. For a `redundant_gre` network type, the value is required * and can be either VPC or Classic. This field is required to be unspecified for network type `classic`, - * `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `gre_tunnel` connections. + * `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `gre_tunnel` connections. */ base_network_type?: TransitGatewayConnectionCust.Constants.BaseNetworkType | string; - /** network_type 'vpn_gateway' connections use 'cidr' to specify the CIDR to use for the VPN GRE tunnels. */ + /** network_type `vpn_gateway` and `dynamic_route_server` connections use `cidr` to specify the CIDR to use for + * the `VPN gateway / Dynamic route server` GRE tunnels. + */ cidr?: string; /** The date and time that this connection was created. */ created_at: string; @@ -3163,7 +3447,7 @@ namespace TransitGatewayApisV1 { * the name of the VPC. Network type `classic` connections are named `classic`. * * This field is required for network type `power_virtual_server`, `directlink`, `gre_tunnel`, - * `unbound_gre_tunnel`, `vpn_gateway` and `redundant_gre` connections. + * `unbound_gre_tunnel`, `vpn_gateway`, `dynamic_route_server` and `redundant_gre` connections. * * This field is optional for network type `classic`, `vpc` connections. */ @@ -3172,12 +3456,12 @@ namespace TransitGatewayApisV1 { * IBM Cloud account than the gateway. */ network_account_id?: string; - /** The ID of the network being connected via this connection. For network types `vpc`,`power_virtual_server`, - * `directlink` and `vpn_gateway` this is the CRN of the VPC / PowerVS / VDC / Direct Link / VPN gateway - * respectively. This field is required for network type `vpc`, `power_virtual_server`, `vpn_gateway`, and - * `directlink` connections. It is also required for `redundant_gre` connections when the base_network_type is set - * to VPC. This field is required to be unspecified for network type `classic`, `gre_tunnel` and - * `unbound_gre_tunnel` connections. + /** The ID of the network being connected via this connection. For network types `vpc`, `vpn_gateway`, + * `dynamic_route_server`, `power_virtual_server` and `directlink` this is the CRN of the VPC / VPN / Dynamic Route + * Server / PowerVS / Direct Link gateway respectively. This field is required for network type `vpc`, + * `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `directlink` connections. It is also required + * for `redundant_gre` connections when the base_network_type is set to VPC. This field is required to be + * unspecified for network type `classic`, `gre_tunnel` and `unbound_gre_tunnel` connections. */ network_id?: string; /** Defines what type of network is connected via this connection. */ @@ -3212,7 +3496,7 @@ namespace TransitGatewayApisV1 { * future. Code and processes using this field must tolerate unexpected values. */ status: TransitGatewayConnectionCust.Constants.Status | string; - /** Collection of all tunnels for `redundant_gre` and `vpn_gateway` connections. */ + /** Collection of all tunnels for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. */ tunnels?: TransitGatewayTunnel[]; /** The date and time that this connection was last updated. */ updated_at: string; @@ -3224,11 +3508,10 @@ namespace TransitGatewayApisV1 { } export namespace TransitGatewayConnectionCust { export namespace Constants { - /** The type of network the Unbound GRE tunnel is targeting. This field is required for network type `unbound_gre_tunnel` and must be set to `classic`. For a `redundant_gre` network type, the value is required and can be either VPC or Classic. This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway` and `gre_tunnel` connections. */ + /** The type of network the Unbound GRE tunnel is targeting. This field is required for network type `unbound_gre_tunnel` and must be set to `classic`. For a `redundant_gre` network type, the value is required and can be either VPC or Classic. This field is required to be unspecified for network type `classic`, `directlink`, `vpc`, `power_virtual_server`, `vpn_gateway`, `dynamic_route_server` and `gre_tunnel` connections. */ export enum BaseNetworkType { CLASSIC = 'classic', VPC = 'vpc', - VPN = 'vpn', } /** Defines what type of network is connected via this connection. */ export enum NetworkType { @@ -3240,6 +3523,7 @@ namespace TransitGatewayApisV1 { POWER_VIRTUAL_SERVER = 'power_virtual_server', REDUNDANT_GRE = 'redundant_gre', VPN_GATEWAY = 'vpn_gateway', + DYNAMIC_ROUTE_SERVER = 'dynamic_route_server', } /** Default setting of permit or deny which applies to any routes that don't match a specified filter. This field does not apply to the `redundant_gre` network type. */ export enum PrefixFiltersDefault { @@ -3406,7 +3690,6 @@ namespace TransitGatewayApisV1 { export enum BaseNetworkType { CLASSIC = 'classic', VPC = 'vpc', - VPN = 'vpn', } /** Tunnel's current configuration state. The list of enumerated values for this property may expand in the future. Code and processes using this field must tolerate unexpected values. */ export enum Status { @@ -3423,10 +3706,10 @@ namespace TransitGatewayApisV1 { } /** - * Collection of all tunnels for `redundant_gre` and `vpn_gateway` connections. + * Collection of all tunnels for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. */ export interface TransitGatewayTunnelCollection { - /** Collection of all tunnels for `redundant_gre` and `vpn_gateway` connections. */ + /** Collection of all tunnels for `redundant_gre`, `vpn_gateway` and `dynamic_route_server` connections. */ tunnels: TransitGatewayTunnel[]; }