async def sample_create_hyperparameter_tuning_job(): # Create a client client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) hyperparameter_tuning_job = aiplatform_v1.HyperparameterTuningJob() hyperparameter_tuning_job.display_name = "display_name_value" hyperparameter_tuning_job.study_spec.metrics.metric_id = "metric_id_value" hyperparameter_tuning_job.study_spec.metrics.goal = "MINIMIZE" hyperparameter_tuning_job.study_spec.parameters.double_value_spec.min_value = 0.96 hyperparameter_tuning_job.study_spec.parameters.double_value_spec.max_value = 0.962 hyperparameter_tuning_job.study_spec.parameters.parameter_id = "parameter_id_value" hyperparameter_tuning_job.max_trial_count = 1609 hyperparameter_tuning_job.parallel_trial_count = 2128 hyperparameter_tuning_job.trial_job_spec.worker_pool_specs.container_spec.image_uri = "image_uri_value" request = aiplatform_v1.CreateHyperparameterTuningJobRequest( parent="parent_value", hyperparameter_tuning_job=hyperparameter_tuning_job, ) # Make the request response = await client.create_hyperparameter_tuning_job(request=request) # Handle the response print(response)
async def sample_cancel_data_labeling_job(): # Create a client client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CancelDataLabelingJobRequest(name="name_value", ) # Make the request await client.cancel_data_labeling_job(request=request)
async def sample_cancel_batch_prediction_job(): # Create a client client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CancelBatchPredictionJobRequest( name="name_value", ) # Make the request await client.cancel_batch_prediction_job(request=request)
async def sample_pause_model_deployment_monitoring_job(): # Create a client client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.PauseModelDeploymentMonitoringJobRequest( name="name_value", ) # Make the request await client.pause_model_deployment_monitoring_job(request=request)
async def sample_cancel_hyperparameter_tuning_job(): # Create a client client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CancelHyperparameterTuningJobRequest( name="name_value", ) # Make the request await client.cancel_hyperparameter_tuning_job(request=request)
async def sample_get_custom_job(): # Create a client client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetCustomJobRequest(name="name_value", ) # Make the request response = await client.get_custom_job(request=request) # Handle the response print(response)
async def sample_list_custom_jobs(): # Create a client client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListCustomJobsRequest(parent="parent_value", ) # Make the request page_result = client.list_custom_jobs(request=request) # Handle the response async for response in page_result: print(response)
async def sample_get_model_deployment_monitoring_job(): # Create a client client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetModelDeploymentMonitoringJobRequest( name="name_value", ) # Make the request response = await client.get_model_deployment_monitoring_job(request=request ) # Handle the response print(response)
async def sample_delete_custom_job(): # Create a client client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteCustomJobRequest(name="name_value", ) # Make the request operation = client.delete_custom_job(request=request) print("Waiting for operation to complete...") response = await operation.result() # Handle the response print(response)
async def sample_search_model_deployment_monitoring_stats_anomalies(): # Create a client client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest( model_deployment_monitoring_job="model_deployment_monitoring_job_value", deployed_model_id="deployed_model_id_value", ) # Make the request page_result = client.search_model_deployment_monitoring_stats_anomalies( request=request) # Handle the response async for response in page_result: print(response)
async def sample_create_model_deployment_monitoring_job(): # Create a client client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) model_deployment_monitoring_job = aiplatform_v1.ModelDeploymentMonitoringJob() model_deployment_monitoring_job.display_name = "display_name_value" model_deployment_monitoring_job.endpoint = "endpoint_value" request = aiplatform_v1.CreateModelDeploymentMonitoringJobRequest( parent="parent_value", model_deployment_monitoring_job=model_deployment_monitoring_job, ) # Make the request response = await client.create_model_deployment_monitoring_job(request=request) # Handle the response print(response)
async def sample_create_custom_job(): # Create a client client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) custom_job = aiplatform_v1.CustomJob() custom_job.display_name = "display_name_value" custom_job.job_spec.worker_pool_specs.container_spec.image_uri = "image_uri_value" request = aiplatform_v1.CreateCustomJobRequest( parent="parent_value", custom_job=custom_job, ) # Make the request response = await client.create_custom_job(request=request) # Handle the response print(response)
async def sample_update_model_deployment_monitoring_job(): # Create a client client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) model_deployment_monitoring_job = aiplatform_v1.ModelDeploymentMonitoringJob( ) model_deployment_monitoring_job.display_name = "display_name_value" model_deployment_monitoring_job.endpoint = "endpoint_value" request = aiplatform_v1.UpdateModelDeploymentMonitoringJobRequest( model_deployment_monitoring_job=model_deployment_monitoring_job, ) # Make the request operation = client.update_model_deployment_monitoring_job(request=request) print("Waiting for operation to complete...") response = await operation.result() # Handle the response print(response)
async def sample_create_data_labeling_job(): # Create a client client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) data_labeling_job = aiplatform_v1.DataLabelingJob() data_labeling_job.display_name = "display_name_value" data_labeling_job.datasets = ['datasets_value_1', 'datasets_value_2'] data_labeling_job.labeler_count = 1375 data_labeling_job.instruction_uri = "instruction_uri_value" data_labeling_job.inputs_schema_uri = "inputs_schema_uri_value" data_labeling_job.inputs.null_value = "NULL_VALUE" request = aiplatform_v1.CreateDataLabelingJobRequest( parent="parent_value", data_labeling_job=data_labeling_job, ) # Make the request response = await client.create_data_labeling_job(request=request) # Handle the response print(response)
async def sample_create_batch_prediction_job(): # Create a client client = aiplatform_v1.JobServiceAsyncClient() # Initialize request argument(s) batch_prediction_job = aiplatform_v1.BatchPredictionJob() batch_prediction_job.display_name = "display_name_value" batch_prediction_job.input_config.gcs_source.uris = [ 'uris_value_1', 'uris_value_2' ] batch_prediction_job.input_config.instances_format = "instances_format_value" batch_prediction_job.output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" batch_prediction_job.output_config.predictions_format = "predictions_format_value" request = aiplatform_v1.CreateBatchPredictionJobRequest( parent="parent_value", batch_prediction_job=batch_prediction_job, ) # Make the request response = await client.create_batch_prediction_job(request=request) # Handle the response print(response)