Example #1
0
 public SharedAccessSignature.SharedAccessSignatureACL GetACL(
     out ITPCfSQL.Azure.Enumerations.ContainerPublicReadAccess containerPublicAccess,
     Guid? LeaseId = null,
     int timeoutSeconds = 0,
     Guid? xmsclientrequestId = null
     )
 {
     return Internal.InternalMethods.GetContainerACL(
         this.AzureBlobService.AccountName, this.AzureBlobService.SharedKey, this.AzureBlobService.UseHTTPS,
         this.Name, out containerPublicAccess,
         LeaseId, timeoutSeconds, xmsclientrequestId);
 }
Example #2
0
 public void UpdateContainerACL(
     ITPCfSQL.Azure.Enumerations.ContainerPublicReadAccess containerPublicAccess,
     SharedAccessSignature.SharedAccessSignatureACL sasACL,
     Guid? LeaseId = null,
     int timeoutSeconds = 0,
     Guid? xmsclientrequestId = null
 )
 {
     Internal.InternalMethods.SetContainerACL(
         this.AzureBlobService.AccountName, this.AzureBlobService.SharedKey, this.AzureBlobService.UseHTTPS,
         this.Name, LeaseId, sasACL, containerPublicAccess,
         timeoutSeconds, xmsclientrequestId);
 }
Example #3
0
        public static Dictionary<string, string> UpdatePersistentVMRole(
            System.Security.Cryptography.X509Certificates.X509Certificate2 certificate,
            Guid subscriptionId,
            string serviceName,
            string deploymentName,
            ITPCfSQL.Azure.Management.PersistentVMRole vmRoleConfig)
        {
            Uri uri = new Uri(
                GetManagementURI() + "/" +
                subscriptionId.ToString() + "/" +
                "services" + "/" +
                "hostedservices" + "/" +
                serviceName + "/" +
                "deployments" + "/" +
                deploymentName + "/" +
                "Roles" + "/" +
                vmRoleConfig.RoleName);

            System.Net.HttpWebRequest Request = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(uri);
            Request.Method = "PUT";
            Request.Headers.Add(Constants.HEADER_VERSION, AZURE_VERSION);
            Request.ClientCertificates.Add(certificate);

            #region Add XML data
            Request.ContentType = "application/xml; charset=utf-8";

            System.Xml.Serialization.XmlSerializer ser = new System.Xml.Serialization.XmlSerializer(typeof(ITPCfSQL.Azure.Management.PersistentVMRole));
            ser.Serialize(Request.GetRequestStream(), vmRoleConfig);
            #endregion

            System.Net.HttpWebResponse response = (System.Net.HttpWebResponse)Request.GetResponse();
            if (response.StatusCode == System.Net.HttpStatusCode.Accepted)
            {
                Dictionary<string, string> dRes = new Dictionary<string, string>();
                foreach (string header in response.Headers)
                {
                    dRes.Add(header, response.Headers[header]);
                }

                return dRes;
            }
            else
                throw new Exceptions.UnexpectedResponseTypeCodeException(System.Net.HttpStatusCode.Accepted, response.StatusCode);
        }