Exemplo n.º 1
0
        /// <summary>
        /// Gets the specified <see cref="CloudJobSchedule"/>.
        /// </summary>
        /// <param name="jobScheduleId">The id of the job schedule to get.</param>
        /// <param name="detailLevel">A <see cref="DetailLevel"/> used for controlling which properties are retrieved from the service.</param>
        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/> and <paramref name="detailLevel"/>.</param>
        /// <returns>A <see cref="CloudJobSchedule"/> containing information about the specified Azure Batch job schedule.</returns>
        /// <remarks>This is a blocking operation. For a non-blocking equivalent, see <see cref="GetJobScheduleAsync"/>.</remarks>
        public CloudJobSchedule GetJobSchedule(string jobScheduleId, DetailLevel detailLevel = null, IEnumerable <BatchClientBehavior> additionalBehaviors = null)
        {
            using (System.Threading.Tasks.Task <CloudJobSchedule> asyncTask = this.GetJobScheduleAsync(jobScheduleId, detailLevel, additionalBehaviors))
            {
                CloudJobSchedule result = asyncTask.WaitAndUnaggregateException(this.CustomBehaviors, additionalBehaviors);

                return(result);
            }
        }
Exemplo n.º 2
0
        public bool MoveNext()  // for IEnumerator and IEnumerator<T>
        {
            using (System.Threading.Tasks.Task <bool> asyncTask = MoveNextAsync())
            {
                bool result = asyncTask.WaitAndUnaggregateException();

                return(result);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets the settings required for remote login to a compute node.
        /// </summary>
        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/>.</param>
        /// <remarks>
        /// <para>This is a blocking operation. For a non-blocking equivalent, see <see cref="Microsoft.Azure.Batch.ComputeNode.GetRemoteLoginSettingsAsync"/>.</para>
        /// <para>This method can be invoked only if the pool is created with a <see cref="Microsoft.Azure.Batch.VirtualMachineConfiguration"/> property.
        /// If this method is invoked on pools created with <see cref="Microsoft.Azure.Batch.CloudServiceConfiguration" />, then Batch service returns 409 (Conflict).
        /// For pools with a <see cref="Microsoft.Azure.Batch.CloudServiceConfiguration" /> property, one of the GetRDPFileAsync/GetRDPFile methods must be used.</para>
        /// </remarks>
        public RemoteLoginSettings GetRemoteLoginSettings(IEnumerable <BatchClientBehavior> additionalBehaviors = null)
        {
            using (System.Threading.Tasks.Task <RemoteLoginSettings> asyncTask = GetRemoteLoginSettingsAsync(additionalBehaviors))
            {
                RemoteLoginSettings rls = asyncTask.WaitAndUnaggregateException(this.CustomBehaviors, additionalBehaviors);

                return(rls);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Gets the specified <see cref="NodeFile"/> from the <see cref="CloudTask"/>'s directory on its compute node.
        /// </summary>
        /// <param name="fileName">The name of the file to retrieve.</param>
        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/>.</param>
        /// <returns>A <see cref="NodeFile"/> representing the specified file.</returns>
        /// <remarks>This is a blocking operation. For a non-blocking equivalent, see <see cref="GetNodeFileAsync"/>.</remarks>
        public NodeFile GetNodeFile(string fileName, IEnumerable <BatchClientBehavior> additionalBehaviors = null)
        {
            using (System.Threading.Tasks.Task <NodeFile> asyncTask = this.GetNodeFileAsync(fileName, additionalBehaviors))
            {
                NodeFile file = asyncTask.WaitAndUnaggregateException(this.CustomBehaviors, additionalBehaviors);

                return(file);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Gets information about the specified application.
        /// </summary>
        /// <param name="applicationId">The id of the application to get.</param>
        /// <param name="detailLevel">A <see cref="DetailLevel"/> used for controlling which properties are retrieved from the service.</param>
        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/> and <paramref name="detailLevel"/>.</param>
        /// <returns>An <see cref="ApplicationSummary"/> containing information about the specified application.</returns>
        /// <remarks>This is a blocking operation. For a non-blocking equivalent, see <see cref="GetApplicationSummaryAsync"/>.</remarks>
        public ApplicationSummary GetApplicationSummary(string applicationId, DetailLevel detailLevel = null, IEnumerable <BatchClientBehavior> additionalBehaviors = null)
        {
            using (System.Threading.Tasks.Task <ApplicationSummary> asyncTask = GetApplicationSummaryAsync(applicationId, detailLevel, additionalBehaviors))
            {
                ApplicationSummary applicationSummary = asyncTask.WaitAndUnaggregateException(this.CustomBehaviors, additionalBehaviors);

                return(applicationSummary);
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Gets the specified <see cref="CloudTask"/>.
        /// </summary>
        /// <param name="taskId">The id of the task to get.</param>
        /// <param name="detailLevel">A <see cref="DetailLevel"/> used for controlling which properties are retrieved from the service.</param>
        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/> and <paramref name="detailLevel"/>.</param>
        /// <returns>A <see cref="CloudTask"/> containing information about the specified Azure Batch task.</returns>
        /// <remarks>This is a blocking operation. For a non-blocking equivalent, see <see cref="GetTaskAsync"/>.</remarks>
        public CloudTask GetTask(
            string taskId,
            DetailLevel detailLevel = null,
            IEnumerable <BatchClientBehavior> additionalBehaviors = null)
        {
            using (System.Threading.Tasks.Task <CloudTask> asyncTask = GetTaskAsync(taskId, detailLevel, additionalBehaviors))
            {
                CloudTask cloudTask = asyncTask.WaitAndUnaggregateException(this.CustomBehaviors, additionalBehaviors);

                return(cloudTask);
            }
        }