async def sample_create_instance(): # Create a client client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) instance = spanner_admin_instance_v1.Instance() instance.name = "name_value" instance.config = "config_value" instance.display_name = "display_name_value" request = spanner_admin_instance_v1.CreateInstanceRequest( parent="parent_value", instance_id="instance_id_value", instance=instance, ) # Make the request operation = client.create_instance(request=request) print("Waiting for operation to complete...") response = await operation.result() # Handle the response print(response)
async def sample_delete_instance(): # Create a client client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_instance_v1.DeleteInstanceRequest( name="name_value", ) # Make the request await client.delete_instance(request=request)
async def sample_get_iam_policy(): # Create a client client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest(resource="resource_value", ) # Make the request response = await client.get_iam_policy(request=request) # Handle the response print(response)
async def sample_get_instance(): # Create a client client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_instance_v1.GetInstanceRequest(name="name_value", ) # Make the request response = await client.get_instance(request=request) # Handle the response print(response)
async def sample_list_instance_configs(): # Create a client client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) request = spanner_admin_instance_v1.ListInstanceConfigsRequest( parent="parent_value", ) # Make the request page_result = client.list_instance_configs(request=request) # Handle the response async for response in page_result: print(response)
async def sample_test_iam_permissions(): # Create a client client = spanner_admin_instance_v1.InstanceAdminAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) # Make the request response = await client.test_iam_permissions(request=request) # Handle the response print(response)