async def sample_get_endpoint(): # Create a client client = aiplatform_v1beta1.EndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetEndpointRequest(name="name_value", ) # Make the request response = await client.get_endpoint(request=request) # Handle the response print(response)
async def sample_list_endpoints(): # Create a client client = aiplatform_v1beta1.EndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListEndpointsRequest(parent="parent_value", ) # Make the request page_result = client.list_endpoints(request=request) # Handle the response async for response in page_result: print(response)
async def sample_update_endpoint(): # Create a client client = aiplatform_v1beta1.EndpointServiceAsyncClient() # Initialize request argument(s) endpoint = aiplatform_v1beta1.Endpoint() endpoint.display_name = "display_name_value" request = aiplatform_v1beta1.UpdateEndpointRequest(endpoint=endpoint, ) # Make the request response = await client.update_endpoint(request=request) # Handle the response print(response)
async def sample_delete_endpoint(): # Create a client client = aiplatform_v1beta1.EndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteEndpointRequest(name="name_value", ) # Make the request operation = client.delete_endpoint(request=request) print("Waiting for operation to complete...") response = await operation.result() # Handle the response print(response)
async def sample_undeploy_model(): # Create a client client = aiplatform_v1beta1.EndpointServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1beta1.UndeployModelRequest( endpoint="endpoint_value", deployed_model_id="deployed_model_id_value", ) # Make the request operation = client.undeploy_model(request=request) print("Waiting for operation to complete...") response = await operation.result() # Handle the response print(response)
async def sample_deploy_model(): # Create a client client = aiplatform_v1beta1.EndpointServiceAsyncClient() # Initialize request argument(s) deployed_model = aiplatform_v1beta1.DeployedModel() deployed_model.dedicated_resources.min_replica_count = 1803 deployed_model.model = "model_value" request = aiplatform_v1beta1.DeployModelRequest( endpoint="endpoint_value", deployed_model=deployed_model, ) # Make the request operation = client.deploy_model(request=request) print("Waiting for operation to complete...") response = await operation.result() # Handle the response print(response)