Skip to content

feat(Autoscale): Update VPC SDK adding Autoscale and NLB features #10

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# to be ready for development work in the local sandbox.
# example: "make setup"

setup: deps dev_deps install_project
setup: deps dev_deps install

deps:
pip install -r requirements.txt

dev_deps:
pip install -r requirements-dev.txt

install_project:
install:
pip install -e .

unit-test:
Expand Down
13,482 changes: 6,809 additions & 6,673 deletions ibm_vpc/vpc_classic_v1.py

Large diffs are not rendered by default.

39,441 changes: 23,287 additions & 16,154 deletions ibm_vpc/vpc_v1.py

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions test/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,21 @@ def loadConfigFile():
def createGen1Service():
loadConfigFile()
service = VpcClassicV1.new_instance()
headers = {
'Accept': 'application/json'
}
service.set_default_headers(headers)
print('Setup complete.')
return service

@pytest.fixture(scope="session")
def createGen2Service():
loadConfigFile()
service = VpcV1.new_instance()
headers = {
'Accept': 'application/json'
}
service.set_default_headers(headers)
print('Setup complete.')
return service

Expand Down
25 changes: 18 additions & 7 deletions test/integration/test_gen1.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def test_get_sg(self, createGen1Service):

def test_update_sg_network_interface(self, createGen1Service):
sg_network_interface = add_security_group_network_interface(createGen1Service, store['created_sg_id'], store['network_interface_id'])
assertGetPatchResponse(sg_network_interface)
assertCreateResponse(sg_network_interface)
store['created_sg_network_interface_id'] = sg_network_interface.get_result()['id']
def test_list_sg_network_interface(self, createGen1Service):
sg_network_interface = list_security_group_network_interfaces(createGen1Service, store['created_sg_id'])
Expand All @@ -335,8 +335,7 @@ def test_get_sg_network_interface(self, createGen1Service):
assertGetPatchResponse(sg_network_interface)
def test_delete_sg_network_interface(self, createGen1Service):
sg_network_interface = remove_security_group_network_interface(createGen1Service, store['created_sg_id'], store['created_sg_network_interface_id'])
assert sg_network_interface.status_code == 200

assertDeleteResponse(sg_network_interface)

def test_create_sg_rule(self, createGen1Service):
sg_rule = create_security_group_rule(createGen1Service, store['created_sg_id'])
Expand Down Expand Up @@ -370,19 +369,23 @@ def test_get_sg_network_interface(self, createGen1Service):

class TestVPCRoutes():
def test_create_route(self, createGen1Service):
pytest.skip("No env")
route = create_vpc_route(createGen1Service, store['created_vpc'], store['zone'])
assertCreateResponse(route)
store['created_route'] = route.get_result()['id']
def test_list_routes(self, createGen1Service):
routes = list_vpc_routes(createGen1Service, store['created_vpc'], store['zone'])
routes = list_vpc_routes(createGen1Service, store['created_vpc'])
assertListResponse(routes, 'routes')
def test_get_route(self, createGen1Service):
pytest.skip("No env")
route = get_vpc_route(createGen1Service, store['created_vpc'], store['created_route'])
assertGetPatchResponse(route)
def test_update_route(self, createGen1Service):
pytest.skip("No env")
route = update_vpc_route(createGen1Service, store['created_vpc'], store['created_route'])
assertGetPatchResponse(route)
def test_delete_route(self, createGen1Service):
pytest.skip("No env")
route = delete_vpc_route(createGen1Service, store['created_vpc'], store['created_route'])
assertDeleteResponse(route)

Expand Down Expand Up @@ -586,7 +589,7 @@ def test_update_pool(self, createGen1Service):
assertGetPatchResponse(pool)
def test_put_pool_member(self, createGen1Service):
member = replace_load_balancer_pool_members(createGen1Service, store['created_load_balancer'], store['created_lb_pool'])
assert member.status_code == 200
assert member.status_code == 202
def test_create_pool_member(self, createGen1Service):
member = create_load_balancer_pool_member(createGen1Service, store['created_load_balancer'], store['created_lb_pool'])
assert member.status_code == 201
Expand Down Expand Up @@ -2512,6 +2515,14 @@ def list_vpc_routes(service, vpc_id, zone_name):
response = service.list_vpc_routes(vpc_id, zone_name=zone_name)
return response

#--------------------------------------------------------
# list_vpc_routes()
#--------------------------------------------------------

def list_vpc_routes(service, vpc_id):
response = service.list_vpc_routes(vpc_id)
return response

#--------------------------------------------------------
# create_vpc_route()
#--------------------------------------------------------
Expand All @@ -2525,20 +2536,20 @@ def create_vpc_route(service, vpc_id, zone):
# Construct a dict representation of a RouteNextHopPrototypeRouteNextHopIP model
route_next_hop_prototype_model = {}
route_next_hop_prototype_model['address'] = '7.7.7.7'
route_next_hop_prototype_model['address'] = '197.7.0.0'

destination = '10.168.10.0/24'
destination = '101.168.0.0/30'
zone = zone_identity_model
name = generate_name('route')
next_hop=route_next_hop_prototype_model

response = service.create_vpc_route(
vpc_id,
destination,
next_hop,
zone,
name=name,
)

return response

#--------------------------------------------------------
Expand Down
Loading