0

I am starting a Comprehend Medical Job Request using the StartEntitiesDetectionV2JobRequest function. In the documentation it says "To get the status of a job, use this(JobId) identifier with the DescribeEntitiesDetectionV2Job operation", however there is no operation called DescribeEntitiesDetectionV2Job, only DescribeEntitiesDetectionV2JobRequest and DescribeEntitiesDetectionV2JobResponse.

How can I call DescribeEntitiesDetectionV2JobResponse (or any other function) to get the status of the job?

I was thinking something like this would work:

ComprehendMedicalAsyncJobProperties jobProperties = new ComprehendMedicalAsyncJobProperties()
                {
                    DataAccessRoleArn = "arn:aws:iam::1129587198257:role/role_name",
                    InputDataConfig = input,
                    OutputDataConfig = output
                };


                DescribeEntitiesDetectionV2JobResponse requestResponse = new DescribeEntitiesDetectionV2JobResponse()
                {
                    ComprehendMedicalAsyncJobProperties = jobProperties
                };
while(requestResponse.HttpStatusCode!=(*something that would indicate that the job is completed here*))
                {
                    Thread.Sleep(500);
                }
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470

1 Answers1

0
InputDataConfig input = new InputDataConfig()
                    {
                        S3Bucket = "your_bucket_here",
                        S3Key = "subdirectory_name"
                    };
                    OutputDataConfig output = new OutputDataConfig()
                    {
                        S3Bucket = "your_bucket_here",
                        S3Key = "subdirectory_name"
                    };

                    StartEntitiesDetectionV2JobRequest request = new StartEntitiesDetectionV2JobRequest()
                    {
                        InputDataConfig = input,
                        JobName = "job_name_example",
                        LanguageCode = "en",
                        OutputDataConfig = output,
                        DataAccessRoleArn = "arn:aws:iam::12312512512:role/acces_role_name_here"
                    };
                    StartEntitiesDetectionV2JobResponse comprehendResult = comprehendClient.StartEntitiesDetectionV2JobAsync(request).GetAwaiter().GetResult();

                    DescribeEntitiesDetectionV2JobRequest entitiesDetectionV2JobRequest = new DescribeEntitiesDetectionV2JobRequest()
                    {
                        JobId = comprehendResult.JobId
                    };

                    DescribeEntitiesDetectionV2JobResponse comprehendResult2 = comprehendClient.DescribeEntitiesDetectionV2JobAsync(entitiesDetectionV2JobRequest).GetAwaiter().GetResult();