@@ -32,6 +32,62 @@ def v1_storage_buckets_insert():
3232 return render_template ('buckets-insert-generic.jinja.json' , bucket_name = bucket_name ), 200 , {'Content-Type' : 'application/json' }
3333 return '{"msg": "Disallowed"}' , 401 , {'Content-Type' : 'application/json' }
3434
35+ @app .route ('/compute/v1/projects/testing-project/global/networks' , methods = ['GET' ])
36+ def projects_testing_project_global_networks ():
37+ return render_template ('route_27_template.json' ), 200 , {'Content-Type' : 'application/json' }
38+
39+ @app .route ('/compute/v1/projects/<project_name>/global/networks' , methods = ['POST' ])
40+ def compute_networks_insert (project_name : str ):
41+ # Validate the incoming query
42+ body = request .get_json ()
43+ operation_id = '1000000000001'
44+ operation_name = 'operation-100000000001-10000000001-10000001-10000001'
45+ network_name = body ['name' ]
46+ target_link = f'https://www.googleapis.com/compute/v1/projects/{ project_name } /global/networks/{ network_name } ' ,
47+ if not body or 'name' not in body :
48+ return '{"msg": "Invalid request body"}' , 400 , {'Content-Type' : 'application/json' }
49+ if not project_name :
50+ return '{"msg": "Invalid request: project not supplied"}' , 400 , {'Content-Type' : 'application/json' }
51+ if project_name == 'mutable-project' and network_name == 'auto-test-01' :
52+ return render_template (
53+ 'global-operation.jinja.json' ,
54+ target_link = target_link ,
55+ operation_id = operation_id ,
56+ operation_name = operation_name ,
57+ project_name = project_name ,
58+ kind = 'compute#operation' ,
59+ operation_type = 'insert' ,
60+ progress = 0
61+ ), 200 , {'Content-Type' : 'application/json' }
62+ return '{"msg": "Disallowed"}' , 401 , {'Content-Type' : 'application/json' }
63+
64+ @app .route ('/compute/v1/projects/<project_name>/global/operations/<operation_name>' , methods = ['GET' ])
65+ def projects_testing_project_global_operation_detail (project_name : str , operation_name : str ):
66+ if project_name == 'mutable-project' and 'operation-100000000001-10000000001-10000001-10000001' :
67+ operation_id = '1000000000001'
68+ network_name = 'auto-test-01'
69+ target_link = f'https://www.googleapis.com/compute/v1/projects/{ project_name } /global/networks/{ network_name } '
70+ return render_template (
71+ 'global-operation.jinja.json' ,
72+ target_link = target_link ,
73+ operation_id = operation_id ,
74+ operation_name = operation_name ,
75+ project_name = project_name ,
76+ kind = 'compute#operation' ,
77+ operation_type = 'insert' ,
78+ progress = 100 ,
79+ end_time = '2025-07-05T19:43:34.491-07:00' ,
80+ ), 200 , {'Content-Type' : 'application/json' }
81+ return '{"msg": "Disallowed"}' , 401 , {'Content-Type' : 'application/json' }
82+
83+ @app .route ('/compute/v1/projects/<project_name>/global/networks/<network_name>' , methods = ['GET' ])
84+ def projects_testing_project_global_network_detail (project_name : str , network_name : str ):
85+ return render_template (
86+ 'networks-insert-generic-mature.jinja.json' ,
87+ project_name = project_name ,
88+ network_name = network_name
89+ ), 200 , {'Content-Type' : 'application/json' }
90+
3591@app .route ('/v1/projects/testing-project-three/locations/global/keyRings/testing-three/cryptoKeys' , methods = ['GET' ])
3692def v1_projects_testing_project_three_locations_global_keyRings_testing_three_cryptoKeys ():
3793 return render_template ('route_1_template.json' ), 200 , {'Content-Type' : 'application/json' }
@@ -188,9 +244,6 @@ def projects_testing_project_zones_australia_southeast1_a_disks():
188244def projects_testing_project_zones_australia_southeast1_b_disks ():
189245 return render_template ('route_26_template.json' ), 200 , {'Content-Type' : 'application/json' }
190246
191- @app .route ('/compute/v1/projects/testing-project/global/networks' , methods = ['GET' ])
192- def projects_testing_project_global_networks ():
193- return render_template ('route_27_template.json' ), 200 , {'Content-Type' : 'application/json' }
194247
195248@app .route ('/compute/v1/projects/testing-project/regions/australia-southeast1/subnetworks' , methods = ['GET' ])
196249def projects_testing_project_regions_australia_southeast1_subnetworks ():
0 commit comments