Skip to content

Commit 53194f7

Browse files
authored
feat(release): Update SDK to use API released on 2024-07-02 (#64)
Signed-off-by: Deepak Selvakumar <[email protected]>
1 parent 5cbb219 commit 53194f7

File tree

5 files changed

+58944
-23693
lines changed

5 files changed

+58944
-23693
lines changed

examples/test_vpc_v1_examples.py

Lines changed: 138 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,7 @@ def test_list_images_example(self):
10091009
client=vpc_service,
10101010
limit=10,
10111011
visibility='private',
1012+
user_data_format='cloud_init',
10121013
)
10131014
while pager.has_next():
10141015
next_page = pager.get_next()
@@ -3596,6 +3597,7 @@ def test_create_share_example(self):
35963597
# end-create_share
35973598
print(json.dumps(share, indent=2))
35983599
data['shareId']=share['id']
3600+
data['shareCRN']=share['crn']
35993601
data['shareReplicaId']=share_replica['id']
36003602
data['shareReplicaETag']=response_replica.get_headers()['ETag']
36013603
assert share is not None
@@ -3605,6 +3607,36 @@ def test_create_share_example(self):
36053607
except ApiException as e:
36063608
pytest.fail(str(e))
36073609

3610+
@needscredentials
3611+
def test_create_accessor_share_example(self):
3612+
"""
3613+
create_share request example
3614+
"""
3615+
try:
3616+
print('\ncreate_share() result:')
3617+
# begin-create_share
3618+
3619+
share_identity = {
3620+
'crn': data["shareCRN"]
3621+
}
3622+
share_prototype_model = {
3623+
'origin_share': share_identity,
3624+
'name': 'my-accessor-share',
3625+
}
3626+
3627+
response = vpc_service.create_share(
3628+
share_prototype=share_prototype_model,
3629+
)
3630+
share = response.get_result()
3631+
3632+
# end-create_share
3633+
data['shareAccessorId']=share['id']
3634+
assert share is not None
3635+
3636+
3637+
except ApiException as e:
3638+
pytest.fail(str(e))
3639+
36083640
@needscredentials
36093641
def test_get_share_example(self):
36103642
"""
@@ -3658,6 +3690,74 @@ def test_update_share_example(self):
36583690
pytest.fail(str(e))
36593691

36603692
@needscredentials
3693+
def test_list_share_accessor_bindings_example(self):
3694+
"""
3695+
list_share_accessor_bindings request example
3696+
"""
3697+
try:
3698+
print('\nlist_share_accessor_bindings() result:')
3699+
3700+
# begin-list_share_accessor_bindings
3701+
3702+
all_results = []
3703+
pager = ShareAccessorBindingsPager(
3704+
client=vpc_service,
3705+
id=data['shareId'],
3706+
limit=10,
3707+
)
3708+
while pager.has_next():
3709+
next_page = pager.get_next()
3710+
assert next_page is not None
3711+
all_results.extend(next_page)
3712+
3713+
# end-list_share_accessor_bindings
3714+
data['shareAccessorBindingId'] = all_results[0]['id']
3715+
except ApiException as e:
3716+
pytest.fail(str(e))
3717+
3718+
@needscredentials
3719+
def test_get_share_accessor_binding_example(self):
3720+
"""
3721+
get_share_accessor_binding request example
3722+
"""
3723+
try:
3724+
print('\nget_share_accessor_binding() result:')
3725+
3726+
# begin-get_share_accessor_binding
3727+
3728+
response = vpc_service.get_share_accessor_binding(
3729+
share_id=data['shareId'],
3730+
id=data['shareAccessorBindingId'],
3731+
)
3732+
share_accessor_binding = response.get_result()
3733+
3734+
print(json.dumps(share_accessor_binding, indent=2))
3735+
3736+
# end-get_share_accessor_binding
3737+
assert share_accessor_binding is not None
3738+
except ApiException as e:
3739+
pytest.fail(str(e))
3740+
3741+
@needscredentials
3742+
def test_delete_share_accessor_binding_example(self):
3743+
"""
3744+
delete_share_accessor_binding request example
3745+
"""
3746+
try:
3747+
# begin-delete_share_accessor_binding
3748+
3749+
response = vpc_service.delete_share_accessor_binding(
3750+
share_id=data['shareId'],
3751+
id=data['shareAccessorBindingId'],
3752+
)
3753+
3754+
# end-delete_share_accessor_binding
3755+
print('\ndelete_share_accessor_binding() response status code: ',
3756+
response.get_status_code())
3757+
3758+
except ApiException as e:
3759+
pytest.fail(str(e))
3760+
@needscredentials
36613761
def test_failover_share_example(self):
36623762
"""
36633763
failover_share request example
@@ -4857,8 +4957,8 @@ def test_create_vpn_gateway_connection_example(self):
48574957

48584958
vpn_gateway_connection = vpc_service.create_vpn_gateway_connection(
48594959
vpn_gateway_id=data['vpnGatewayId'],
4860-
vpn_gateway_connection_prototype=
4861-
vpn_gateway_connection_prototype_model).get_result()
4960+
vpn_gateway_connection_prototype=vpn_gateway_connection_prototype_model,
4961+
).get_result()
48624962

48634963
# end-create_vpn_gateway_connection
48644964

@@ -4916,115 +5016,114 @@ def test_update_vpn_gateway_connection_example(self):
49165016
pytest.fail(str(e))
49175017

49185018
@needscredentials
4919-
def test_add_vpn_gateway_connections_local_cidr_example(self):
5019+
def test_add_vpn_gateway_connection_local_cidr_example(self):
49205020
"""
4921-
add_vpn_gateway_connections_local_cidr request example
5021+
add_vpn_gateway_connection_local_cidr request example
49225022
"""
49235023
try:
4924-
# begin-add_vpn_gateway_connections_local_cidr
5024+
# begin-add_vpn_gateway_connection_local_cidr
49255025

49265026
response = vpc_service.add_vpn_gateway_connections_local_cidr(
49275027
vpn_gateway_id=data['vpnGatewayId'],
49285028
id=data['vpnGatewayConnectionId'],
4929-
cidr_prefix='192.134.0.0',
4930-
prefix_length='28')
5029+
cidr='192.144.0.0/28')
49315030

4932-
# end-add_vpn_gateway_connections_local_cidr
5031+
# end-add_vpn_gateway_connection_local_cidr
49335032
assert response is not None
49345033

49355034
except ApiException as e:
49365035
pytest.fail(str(e))
49375036

49385037
@needscredentials
4939-
def test_list_vpn_gateway_connections_local_cidrs_example(self):
5038+
def test_list_vpn_gateway_connection_local_cidrs_example(self):
49405039
"""
4941-
list_vpn_gateway_connections_local_cidrs request example
5040+
list_vpn_gateway_connection_local_cidrs request example
49425041
"""
49435042
try:
4944-
print('\nlist_vpn_gateway_connections_local_cidrs() result:')
4945-
# begin-list_vpn_gateway_connections_local_cidrs
5043+
print('\nlist_vpn_gateway_connection_local_cidrs() result:')
5044+
# begin-list_vpn_gateway_connection_local_cidrs
49465045

49475046
vpn_gateway_connection_local_cid_rs = vpc_service.list_vpn_gateway_connections_local_cidrs(
49485047
vpn_gateway_id=data['vpnGatewayId'], id=data['vpnGatewayConnectionId']).get_result()
49495048

4950-
# end-list_vpn_gateway_connections_local_cidrs
5049+
# end-list_vpn_gateway_connection_local_cidrs
49515050

49525051
assert vpn_gateway_connection_local_cid_rs is not None
49535052

49545053
except ApiException as e:
49555054
pytest.fail(str(e))
49565055

49575056
@needscredentials
4958-
def test_add_vpn_gateway_connections_peer_cidr_example(self):
5057+
def test_add_vpn_gateway_connection_peer_cidr_example(self):
49595058
"""
4960-
add_vpn_gateway_connections_peer_cidr request example
5059+
add_vpn_gateway_connection_peer_cidr request example
49615060
"""
49625061
try:
4963-
# begin-add_vpn_gateway_connections_peer_cidr
5062+
# begin-add_vpn_gateway_connection_peer_cidr
49645063

49655064
response = vpc_service.add_vpn_gateway_connections_peer_cidr(
49665065
vpn_gateway_id=data['vpnGatewayId'],
49675066
id=data['vpnGatewayConnectionId'],
49685067
cidr='192.144.0.0/28')
49695068

4970-
# end-add_vpn_gateway_connections_peer_cidr
5069+
# end-add_vpn_gateway_connection_peer_cidr
49715070
assert response is not None
49725071

49735072
except ApiException as e:
49745073
pytest.fail(str(e))
49755074

49765075
@needscredentials
4977-
def test_check_vpn_gateway_connections_local_cidr_example(self):
5076+
def test_check_vpn_gateway_connection_local_cidr_example(self):
49785077
"""
4979-
check_vpn_gateway_connections_local_cidr request example
5078+
check_vpn_gateway_connection_local_cidr request example
49805079
"""
49815080
try:
4982-
# begin-check_vpn_gateway_connections_local_cidr
5081+
# begin-check_vpn_gateway_connection_local_cidr
49835082

49845083
response = vpc_service.check_vpn_gateway_connections_local_cidr(
49855084
vpn_gateway_id=data['vpnGatewayId'],
49865085
id=data['vpnGatewayConnectionId'],
49875086
cidr='192.144.0.0/28')
49885087

4989-
# end-check_vpn_gateway_connections_local_cidr
5088+
# end-check_vpn_gateway_connection_local_cidr
49905089
assert response is not None
49915090

49925091
except ApiException as e:
49935092
pytest.fail(str(e))
49945093

49955094
@needscredentials
4996-
def test_list_vpn_gateway_connections_peer_cidrs_example(self):
5095+
def test_list_vpn_gateway_connection_peer_cidrs_example(self):
49975096
"""
4998-
list_vpn_gateway_connections_peer_cidrs request example
5097+
list_vpn_gateway_connection_peer_cidrs request example
49995098
"""
50005099
try:
5001-
print('\nlist_vpn_gateway_connections_peer_cidrs() result:')
5002-
# begin-list_vpn_gateway_connections_peer_cidrs
5100+
print('\nlist_vpn_gateway_connection_peer_cidrs() result:')
5101+
# begin-list_vpn_gateway_connection_peer_cidrs
50035102

50045103
vpn_gateway_connection_peer_cid_rs = vpc_service.list_vpn_gateway_connections_peer_cidrs(
50055104
vpn_gateway_id=data['vpnGatewayId'], id=data['vpnGatewayConnectionId']).get_result()
50065105

5007-
# end-list_vpn_gateway_connections_peer_cidrs
5106+
# end-list_vpn_gateway_connection_peer_cidrs
50085107

50095108
assert vpn_gateway_connection_peer_cid_rs is not None
50105109

50115110
except ApiException as e:
50125111
pytest.fail(str(e))
50135112

50145113
@needscredentials
5015-
def test_check_vpn_gateway_connections_peer_cidr_example(self):
5114+
def test_check_vpn_gateway_connection_peer_cidr_example(self):
50165115
"""
5017-
check_vpn_gateway_connections_peer_cidr request example
5116+
check_vpn_gateway_connection_peer_cidr request example
50185117
"""
50195118
try:
5020-
# begin-check_vpn_gateway_connections_peer_cidr
5119+
# begin-check_vpn_gateway_connection_peer_cidr
50215120

50225121
response = vpc_service.check_vpn_gateway_connections_peer_cidr(
50235122
vpn_gateway_id=data['vpnGatewayId'],
50245123
id=data['vpnGatewayConnectionId'],
50255124
cidr='192.144.0.0/28')
50265125

5027-
# end-check_vpn_gateway_connections_peer_cidr
5126+
# end-check_vpn_gateway_connection_peer_cidr
50285127
assert response is not None
50295128

50305129
except ApiException as e:
@@ -6522,6 +6621,7 @@ def test_create_bare_metal_server_example(self):
65226621
'name': data['zone'],
65236622
}
65246623
bare_metal_server_prototype_model = {
6624+
'bandwidth': 10000,
65256625
'initialization': bare_metal_server_initialization_prototype_model,
65266626
'primary_network_interface':
65276627
bare_metal_server_primary_network_interface_prototype_model,
@@ -7452,38 +7552,38 @@ def test_delete_flow_log_collector_example(self):
74527552
pytest.fail(str(e))
74537553

74547554
@needscredentials
7455-
def test_remove_vpn_gateway_connections_peer_cidr_example(self):
7555+
def test_remove_vpn_gateway_connection_peer_cidr_example(self):
74567556
"""
7457-
remove_vpn_gateway_connections_peer_cidr request example
7557+
remove_vpn_gateway_connection_peer_cidr request example
74587558
"""
74597559
try:
7460-
# begin-remove_vpn_gateway_connections_peer_cidr
7560+
# begin-remove_vpn_gateway_connection_peer_cidr
74617561

74627562
response = vpc_service.remove_vpn_gateway_connections_peer_cidr(
74637563
vpn_gateway_id=data['vpnGatewayId'],
74647564
id=data['vpnGatewayConnectionId'],
74657565
cidr='192.144.0.0/28')
74667566

7467-
# end-remove_vpn_gateway_connections_peer_cidr
7567+
# end-remove_vpn_gateway_connection_peer_cidr
74687568
assert response is not None
74697569

74707570
except ApiException as e:
74717571
pytest.fail(str(e))
74727572

74737573
@needscredentials
7474-
def test_remove_vpn_gateway_connections_local_cidr_example(self):
7574+
def test_remove_vpn_gateway_connection_local_cidr_example(self):
74757575
"""
7476-
remove_vpn_gateway_connections_local_cidr request example
7576+
remove_vpn_gateway_connection_local_cidr request example
74777577
"""
74787578
try:
7479-
# begin-remove_vpn_gateway_connections_local_cidr
7579+
# begin-remove_vpn_gateway_connection_local_cidr
74807580

74817581
response = vpc_service.remove_vpn_gateway_connections_local_cidr(
74827582
vpn_gateway_id=data['vpnGatewayId'],
74837583
id=data['vpnGatewayConnectionId'],
74847584
cidr='192.144.0.0/28')
74857585

7486-
# end-remove_vpn_gateway_connections_local_cidr
7586+
# end-remove_vpn_gateway_connection_local_cidr
74877587
assert response is not None
74887588

74897589
except ApiException as e:

0 commit comments

Comments
 (0)