/// <summary>
 /// Initializes a new instance of the <see cref="OutputFileBlobContainerDestination"/> class.
 /// </summary>
 /// <param name='containerUrl'>The URL of the container within Azure Blob Storage to which to upload the file(s).</param>
 /// <param name='identityReference'>The reference to the user assigned identity to use to access Azure Blob Storage specified by containerUrl</param>
 /// <param name='path'>The destination blob or virtual directory within the Azure Storage container to which to upload the file(s).</param>
 public OutputFileBlobContainerDestination(
     string containerUrl,
     ComputeNodeIdentityReference identityReference,
     string path = default(string))
     : this(containerUrl, path)
 {
     IdentityReference = identityReference;
 }
 internal PSComputeNodeIdentityReference(Microsoft.Azure.Batch.ComputeNodeIdentityReference omObject)
 {
     if ((omObject == null))
     {
         throw new System.ArgumentNullException("omObject");
     }
     this.omObject = omObject;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AzureBlobFileSystemConfiguration"/> class.
 /// </summary>
 /// <param name='accountName'>The Azure Storage account name.</param>
 /// <param name='containerName'>The Azure Blob Storage Container name.</param>
 /// <param name='relativeMountPath'>The relative path on the compute node where the file system will be mounted.</param>
 /// <param name='identityReference'>The managed identity to use to authenticate with Azure Storage.</param>
 /// <param name='blobfuseOptions'>Additional command line options to pass to the mount command.</param>
 public AzureBlobFileSystemConfiguration(
     string accountName,
     string containerName,
     string relativeMountPath,
     ComputeNodeIdentityReference identityReference,
     string blobfuseOptions = default(string)) : this(accountName, containerName, relativeMountPath, blobfuseOptions: blobfuseOptions)
 {
     IdentityReference = identityReference;
 }
Example #4
0
 public PSContainerRegistry(string userName = null, string password = null, string registryServer = null, PSComputeNodeIdentityReference identityReference = default(PSComputeNodeIdentityReference))
 {
     Microsoft.Azure.Batch.ComputeNodeIdentityReference identityReferenceOmObject = null;
     if ((identityReference != null))
     {
         identityReferenceOmObject = identityReference.omObject;
     }
     this.omObject = new Microsoft.Azure.Batch.ContainerRegistry(userName, password, registryServer, identityReferenceOmObject);
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OutputFileBlobContainerDestination"/> class.
 /// </summary>
 /// <param name='containerUrl'>The URL of the container within Azure Blob Storage to which to upload the file(s).</param>
 /// <param name='identityReference'>The reference to the user assigned identity to use to access Azure Blob Storage specified by containerUrl</param>
 /// <param name='path'>The destination blob or virtual directory within the Azure Storage container to which to upload the file(s).</param>
 public OutputFileBlobContainerDestination(
     string containerUrl,
     ComputeNodeIdentityReference identityReference,
     string path = default(string))
 {
     this.ContainerUrl      = containerUrl;
     this.IdentityReference = identityReference;
     this.Path = path;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ContainerRegistry"/> class.
 /// </summary>
 /// <param name='userName'>The user name to log into the registry server.</param>
 /// <param name='password'>The password to log into the registry server.</param>
 /// <param name='registryServer'>The registry URL.</param>
 /// <param name='identityReference'>The reference to the user assigned identity to use to access an Azure Container Registry instead of username
 /// and password.</param>
 public ContainerRegistry(
     string userName       = default(string),
     string password       = default(string),
     string registryServer = default(string),
     ComputeNodeIdentityReference identityReference = default(ComputeNodeIdentityReference))
 {
     this.UserName          = userName;
     this.Password          = password;
     this.RegistryServer    = registryServer;
     this.IdentityReference = identityReference;
 }
        /// <summary>
        /// Upload Azure Batch service log files from the specified compute node.
        /// </summary>
        /// <param name="containerUrl">
        /// The URL of the container within Azure Blob Storage to which to upload the Batch Service log file(s). The URL must include a Shared Access Signature (SAS) granting write permissions to the container.
        /// </param>
        /// <param name="identityReference">A managed identity to use for writing to the container.</param>
        /// <param name="startTime">
        /// The start of the time range from which to upload Batch Service log file(s). Any log file containing a log message in the time range will be uploaded.
        /// This means that the operation might retrieve more logs than have been requested since the entire log file is always uploaded.
        /// </param>
        /// <param name="endTime">
        /// The end of the time range from which to upload Batch Service log file(s). Any log file containing a log message in the time range will be uploaded.
        /// This means that the operation might retrieve more logs than have been requested since the entire log file is always uploaded. If this is omitted, the default is the current time.
        /// </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>
        /// <remarks>
        /// This is for gathering Azure Batch service log files in an automated fashion from nodes if you are experiencing an error and wish to escalate to Azure support.
        /// The Azure Batch service log files should be shared with Azure support to aid in debugging issues with the Batch service.
        /// </remarks>
        /// <returns>The result of uploading the batch service logs.</returns>
        public UploadBatchServiceLogsResult UploadComputeNodeBatchServiceLogs(
            string containerUrl,
            ComputeNodeIdentityReference identityReference,
            DateTime startTime,
            DateTime?endTime = null,
            IEnumerable <BatchClientBehavior> additionalBehaviors = null)
        {
            var asyncTask = this.UploadComputeNodeBatchServiceLogsAsync(
                containerUrl,
                identityReference,
                startTime,
                endTime,
                additionalBehaviors);

            return(asyncTask.WaitAndUnaggregateException(this.CustomBehaviors, additionalBehaviors));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ResourceFile"/> class.
 /// </summary>
 /// <param name='httpUrl'>The URL of the file to download.</param>
 /// <param name='fileMode'>The file permission mode attribute in octal format.</param>
 /// <param name='filePath'>The location on the compute node to which to download the file(s), relative to the task's working directory.</param>
 /// <param name='storageContainerUrl'>The URL of the blob container within Azure Blob Storage.</param>
 /// <param name='autoStorageContainerName'>The storage container name in the auto storage account.</param>
 /// <param name='blobPrefix'>The blob prefix to use when downloading blobs from an Azure Storage container. Only the blobs whose names begin
 /// with the specified prefix will be downloaded.</param>
 /// <param name='identityReference'>The reference to the user assigned identity to use to access Azure Blob Storage specified by storageContainerUrl
 /// or httpUrl</param>
 internal ResourceFile(
     string httpUrl                  = default(string),
     string fileMode                 = default(string),
     string filePath                 = default(string),
     string storageContainerUrl      = default(string),
     string autoStorageContainerName = default(string),
     string blobPrefix               = default(string),
     ComputeNodeIdentityReference identityReference = default(ComputeNodeIdentityReference))
 {
     this.HttpUrl                  = httpUrl;
     this.FileMode                 = fileMode;
     this.FilePath                 = filePath;
     this.StorageContainerUrl      = storageContainerUrl;
     this.AutoStorageContainerName = autoStorageContainerName;
     this.BlobPrefix               = blobPrefix;
     this.IdentityReference        = identityReference;
 }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AzureBlobFileSystemConfiguration"/> class.
 /// </summary>
 /// <param name='accountName'>The Azure Storage account name.</param>
 /// <param name='containerName'>The Azure Blob Storage Container name.</param>
 /// <param name='relativeMountPath'>The relative path on the compute node where the file system will be mounted.</param>
 /// <param name='accountKey'>The Azure Storage Account key. This property is mutually exclusive with <see cref="SasKey"/>.</param>
 /// <param name='sasKey'>The Azure Storage SAS token. This property is mutually exclusive with <see cref="AccountKey"/>.</param>
 /// <param name='blobfuseOptions'>Additional command line options to pass to the mount command.</param>
 /// <param name='identityReference'>The reference to the user assigned identity to use to access containerName</param>
 internal AzureBlobFileSystemConfiguration(
     string accountName,
     string containerName,
     string relativeMountPath,
     string accountKey      = default(string),
     string sasKey          = default(string),
     string blobfuseOptions = default(string),
     ComputeNodeIdentityReference identityReference = default(ComputeNodeIdentityReference))
 {
     this.propertyContainer = new PropertyContainer();
     this.AccountName       = accountName;
     this.ContainerName     = containerName;
     this.RelativeMountPath = relativeMountPath;
     this.AccountKey        = accountKey;
     this.SasKey            = sasKey;
     this.BlobfuseOptions   = blobfuseOptions;
     this.IdentityReference = identityReference;
 }
        /// <summary>
        /// Upload Azure Batch service log files from the compute node.
        /// </summary>
        /// <param name="containerUrl">
        /// The URL of the container within Azure Blob Storage to which to upload the Batch Service log file(s). The URL must include a Shared Access Signature (SAS) granting write permissions to the container.
        /// </param>
        /// <param name="identityReference">A managed identity to use for writing to the container.</param>
        /// <param name="startTime">
        /// The start of the time range from which to upload Batch Service log file(s). Any log file containing a log message in the time range will be uploaded.
        /// This means that the operation might retrieve more logs than have been requested since the entire log file is always uploaded.
        /// </param>
        /// <param name="endTime">
        /// The end of the time range from which to upload Batch Service log file(s). Any log file containing a log message in the time range will be uploaded.
        /// This means that the operation might retrieve more logs than have been requested since the entire log file is always uploaded. If this is omitted, the default is the current time.
        /// </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>
        /// <param name="cancellationToken">A <see cref="CancellationToken"/> for controlling the lifetime of the asynchronous operation.</param>
        /// <returns>A <see cref="System.Threading.Tasks.Task"/> that represents the asynchronous operation.</returns>
        /// <remarks>
        /// This is for gathering Azure Batch service log files in an automated fashion from nodes if you are experiencing an error and wish to escalate to Azure support.
        /// The Azure Batch service log files should be shared with Azure support to aid in debugging issues with the Batch service.
        /// </remarks>
        public System.Threading.Tasks.Task <UploadBatchServiceLogsResult> UploadComputeNodeBatchServiceLogsAsync(
            string containerUrl,
            ComputeNodeIdentityReference identityReference,
            DateTime startTime,
            DateTime?endTime = null,
            IEnumerable <BatchClientBehavior> additionalBehaviors = null,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            // craft the behavior manager for this call
            BehaviorManager bhMgr = new BehaviorManager(this.CustomBehaviors, additionalBehaviors);

            return(this.parentBatchClient.PoolOperations.UploadComputeNodeBatchServiceLogsAsyncImpl(
                       this.parentPoolId,
                       this.Id,
                       containerUrl,
                       startTime,
                       endTime,
                       identityReference,
                       bhMgr,
                       cancellationToken));
        }
 public PSComputeNodeIdentityReference()
 {
     this.omObject = new Microsoft.Azure.Batch.ComputeNodeIdentityReference();
 }
 /// <summary>
 /// Creates a new <see cref="ResourceFile"/> from the specified Azure Storage container URL.
 /// </summary>
 /// <param name='storageContainerUrl'>The URL of the blob container within Azure Blob Storage.</param>
 /// <param name='identityReference'>The identity to use for accessing the container in Azure Storage</param>
 /// <param name='filePath'>The location on the compute node to which to download the file(s), relative to the task's working directory.</param>
 /// <param name='blobPrefix'>The blob prefix to use when downloading blobs from an Azure Storage container. Only the blobs whose names begin
 /// with the specified prefix will be downloaded.</param>
 /// <param name='fileMode'>The file permission mode attribute in octal format.</param>
 /// <returns>A <see cref="ResourceFile"/> from the specified Azure Storage container URL.</returns>
 public static ResourceFile FromStorageContainerUrl(string storageContainerUrl, ComputeNodeIdentityReference identityReference, string filePath = null, string blobPrefix = null, string fileMode = null)
 {
     return(new ResourceFile(storageContainerUrl: storageContainerUrl, filePath: filePath, blobPrefix: blobPrefix, fileMode: fileMode, identityReference: identityReference));
 }
 /// <summary>
 /// Creates a new <see cref="ResourceFile"/> from the specified HTTP URL.
 /// </summary>
 /// <param name='httpUrl'>The URL of the file to download.</param>
 /// <param name='identityReference'>The identity to use for accessing the file in Azure Storage</param>
 /// <param name='filePath'>The location on the compute node to which to download the file(s), relative to the task's working directory.</param>
 /// <param name='fileMode'>The file permission mode attribute in octal format.</param>
 /// <returns>A <see cref="ResourceFile"/> from the specified HTTP URL.</returns>
 public static ResourceFile FromUrl(string httpUrl, ComputeNodeIdentityReference identityReference, string filePath, string fileMode = null)
 {
     return(new ResourceFile(httpUrl: httpUrl, filePath: filePath, fileMode: fileMode, identityReference: identityReference));
 }