Exemplo n.º 1
0
        /// <summary>
        /// Reports the status of dataflow WorkItems leased by a worker.
        /// Documentation https://developers.google.com/dataflow/v1b3/reference/workItems/reportStatus
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated dataflow service.</param>
        /// <param name="projectId">The project which owns the WorkItem's job.</param>
        /// <param name="location">The location which contains the WorkItem's job.</param>
        /// <param name="jobId">The job which the WorkItem is part of.</param>
        /// <param name="body">A valid dataflow v1b3 body.</param>
        /// <returns>ReportWorkItemStatusResponseResponse</returns>
        public static ReportWorkItemStatusResponse ReportStatus(dataflowService service, string projectId, string location, string jobId, ReportWorkItemStatusRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (projectId == null)
                {
                    throw new ArgumentNullException(projectId);
                }
                if (location == null)
                {
                    throw new ArgumentNullException(location);
                }
                if (jobId == null)
                {
                    throw new ArgumentNullException(jobId);
                }

                // Make the request.
                return(service.WorkItems.ReportStatus(body, projectId, location, jobId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request WorkItems.ReportStatus failed.", ex);
            }
        }
        /// <summary>
        /// Creates a dataflow job from a template.
        /// Documentation https://developers.google.com/dataflow/v1b3/reference/templates/create
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated dataflow service.</param>
        /// <param name="projectId">The project which owns the job.</param>
        /// <param name="body">A valid dataflow v1b3 body.</param>
        /// <returns>JobResponse</returns>
        public static Job Create(dataflowService service, string projectId, CreateJobFromTemplateRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (projectId == null)
                {
                    throw new ArgumentNullException(projectId);
                }

                // Make the request.
                return(service.Templates.Create(body, projectId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Templates.Create failed.", ex);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get encoded debug configuration for component. Not cacheable.
        /// Documentation https://developers.google.com/dataflow/v1b3/reference/debug/getConfig
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated dataflow service.</param>
        /// <param name="projectId">The project id.</param>
        /// <param name="jobId">The job id.</param>
        /// <param name="body">A valid dataflow v1b3 body.</param>
        /// <returns>GetDebugConfigResponseResponse</returns>
        public static GetDebugConfigResponse GetConfig(dataflowService service, string projectId, string jobId, GetDebugConfigRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (projectId == null)
                {
                    throw new ArgumentNullException(projectId);
                }
                if (jobId == null)
                {
                    throw new ArgumentNullException(jobId);
                }

                // Make the request.
                return(service.Debug.GetConfig(body, projectId, jobId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Debug.GetConfig failed.", ex);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Request the job status.
        /// Documentation https://developers.google.com/dataflow/v1b3/reference/messages/list
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated dataflow service.</param>
        /// <param name="projectId">A project id.</param>
        /// <param name="location">The location which contains the job specified by job_id.</param>
        /// <param name="jobId">The job to get messages about.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>ListJobMessagesResponseResponse</returns>
        public static ListJobMessagesResponse List(dataflowService service, string projectId, string location, string jobId, MessagesListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (projectId == null)
                {
                    throw new ArgumentNullException(projectId);
                }
                if (location == null)
                {
                    throw new ArgumentNullException(location);
                }
                if (jobId == null)
                {
                    throw new ArgumentNullException(jobId);
                }

                // Building the initial request.
                var request = service.Messages.List(projectId, location, jobId);

                // Applying optional parameters to the request.
                request = (MessagesResource.ListRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Messages.List failed.", ex);
            }
        }