Use ListTrainingJobs with an AWS SDK - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use ListTrainingJobs with an AWS SDK

The following code examples show how to use ListTrainingJobs.

Rust
SDK for Rust
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

async fn show_jobs(client: &Client) -> Result<(), Error> { let job_details = client.list_training_jobs().send().await?; println!("Jobs:"); for j in job_details.training_job_summaries() { let name = j.training_job_name().unwrap_or("Unknown"); let creation_time = j.creation_time().expect("creation time").to_chrono_utc()?; let training_end_time = j .training_end_time() .expect("Training end time") .to_chrono_utc()?; let status = j.training_job_status().expect("training status"); let duration = training_end_time - creation_time; println!(" Name: {}", name); println!( " Creation date/time: {}", creation_time.format("%Y-%m-%d@%H:%M:%S") ); println!(" Duration (seconds): {}", duration.num_seconds()); println!(" Status: {:?}", status); println!(); } Ok(()) }
SAP ABAP
SDK for SAP ABAP
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

TRY. oo_result = lo_sgm->listtrainingjobs( " oo_result is returned for testing purposes. " iv_namecontains = iv_name_contains iv_maxresults = iv_max_results ). MESSAGE 'Retrieved list of training jobs.' TYPE 'I'. CATCH /aws1/cx_rt_service_generic INTO DATA(lo_exception). DATA(lv_error) = |"{ lo_exception->av_err_code }" - { lo_exception->av_err_msg }|. MESSAGE lv_error TYPE 'E'. ENDTRY.