Permalink
Browse files

Merge pull request #607 from antonba/sm

Update release notes
  • Loading branch information...
2 parents 9aa6c66 + 7628b7c commit 130af9be9a545ace948484019de01f9c72eaa414 Abdelrahman Elogeel committed Aug 18, 2012
Showing with 82 additions and 21 deletions.
  1. +8 −3 Defaults.php
  2. +64 −18 README.md
  3. +10 −0 changelog.txt
View
@@ -32,8 +32,8 @@
const CHANNEL_GET_CONTAINER = 'get';
const CHANNEL_REST_CONTAINER = 'rest';
const PACKAGE_NAME = 'WindowsAzure';
-const PACKAGE_RELEASE_VERSION = '0.3.0';
-const PACKAGE_API_VERSION = '0.3.0';
+const PACKAGE_RELEASE_VERSION = '0.3.1';
+const PACKAGE_API_VERSION = '0.3.1';
const PACKAGE_RELEASE_STATE = 'beta';
const PACKAGE_API_STATE = 'beta';
const PACKAGE_MIN_PHP_VERSION = '5.3.0';
@@ -47,7 +47,12 @@
It is build as a thin REST call wrapper where each server call maps to a single method call within the library.
';
const PACKAGE_RELEASE_NOTES = '
-- Added Cloud Configuration Manager.
+- Added additional API support for Service Management:
+ * Operations on Hosted Services
+ > create, update, delete, list, get properties
+ * Operations on Deployments
+ > deployment: create, get, delete, swap, change configuration, update status, upgrade, rollback
+ > role instance: reboot, reimage
';
$dependencies = array(
array('required', 'HTTP_Request2', 'pear.php.net'),
View
@@ -30,23 +30,28 @@ Windows Azure tables, blobs, queues, service bus (queues and topics), service ru
* query and set the status of the current role
* REST API Version: 2011-03-08
* Service Management
- * create, update, delete, list, regenerate keys for storage accounts
- * create, update, delete, list affinity groups
+ * storage accounts: create, update, delete, list, regenerate keys
+ * affinity groups: create, update, delete, list, get properties
+ * locations: list
+ * hosted services: create, update, delete, list, get properties
+ * deployment: create, get, delete, swap, change configuration, update status, upgrade, rollback
+ * role instance: reboot, reimage
* REST API Version: 2011-10-01
# Getting Started
## Download Source Code
-> **Note**
->
-> The PHP Client Libraries for Windows Azure have a dependency on the [HTTP_Request2](http://pear.php.net/package/HTTP_Request2), [Mail_mime](http://pear.php.net/package/Mail_mime), and [Mail_mimeDecode](http://pear.php.net/package/Mail_mimeDecode) PEAR packages. The recommended way to resolve these dependencies is to install them using the [PEAR package manager](http://pear.php.net/manual/en/installation.php).
-
To get the source code from GitHub, type
git clone https://github.com/WindowsAzure/azure-sdk-for-php.git
cd ./azure-sdk-for-php
+> **Note**
+>
+> The PHP Client Libraries for Windows Azure have a dependency on the [HTTP_Request2](http://pear.php.net/package/HTTP_Request2), [Mail_mime](http://pear.php.net/package/Mail_mime), and [Mail_mimeDecode](http://pear.php.net/package/Mail_mimeDecode) PEAR packages. The recommended way to resolve these dependencies is to install them using the [PEAR package manager](http://pear.php.net/manual/en/installation.php).
+
+
##Install via Composer
1. Create a file named **composer.json** in the root of your project and add the following code to it:
@@ -73,6 +78,7 @@ To get the source code from GitHub, type
>
> On Windows, you will also need to add the Git executable to your PATH environment variable.
+
##Install as a PEAR package
To install the PHP Client Libraries for Windows Azure as a PEAR package, follow these steps:
@@ -83,7 +89,7 @@ To install the PHP Client Libraries for Windows Azure as a PEAR package, follow
pear channel-discover pear.windowsazure.com
3. Install the PEAR package:
- pear install pear.windowsazure.com/WindowsAzure-0.3.0
+ pear install pear.windowsazure.com/WindowsAzure-0.3.1
# Usage
@@ -554,25 +560,65 @@ To create the .cer certificate, execute this:
openssl x509 -inform pem -in mycert.pem -outform der -out mycert.cer
### List Available Locations
-
- $serviceManagementRestProxy->listLocations();
- $locations = $result->getLocations();
- foreach($locations as $location){
- echo $location->getName()."<br />";
- }
+```PHP
+$serviceManagementRestProxy->listLocations();
+$locations = $result->getLocations();
+foreach($locations as $location){
+ echo $location->getName()."<br />";
+}
+```
### Create a Storage Service
To create a storage service, you need a name for the service (between 3 and 24 lowercase characters and unique within Windows Azure), a label (a base-64 encoded name for the service, up to 100 characters), and either a location or an affinity group. Providing a description for the service is optional.
- $name = "mystorageservice";
- $label = base64_encode($name);
- $options = new CreateStorageServiceOptions();
- $options->setLocation('West US');
- $result = $serviceManagementRestProxy->createStorageService($name, $label, $options);
+```PHP
+$name = "mystorageservice";
+$label = base64_encode($name);
+$options = new CreateStorageServiceOptions();
+$options->setLocation('West US');
+
+$result = $serviceManagementRestProxy->createStorageService($name, $label, $options);
+```
+### Create a Cloud Service
+
+A cloud service is also known as a hosted service (from earlier versions of Windows Azure). The **createHostedServices** method allows you to create a new hosted service by providing a hosted service name (which must be unique in Windows Azure), a label (the base 64-endcoded hosted service name), and a **CreateServiceOptions** object which allows you to set the location *or* the affinity group for your service.
+
+```PHP
+$name = "myhostedservice";
+$label = base64_encode($name);
+$options = new CreateServiceOptions();
+$options->setLocation('West US');
+// Instead of setLocation, you can use setAffinityGroup to set an affinity group.
+
+$result = $serviceManagementRestProxy->createHostedService($name, $label, $options);
+```
+
+### Create a Deployment
+
+To make a new deployment to Azure you must store the package file in a Windows Azure Blob Storage account under the same subscription as the hosted service to which the package is being uploaded. You can create a deployment package with the [Windows Azure PowerShell cmdlets](https://www.windowsazure.com/en-us/develop/php/how-to-guides/powershell-cmdlets/), or with the [cspack commandline tool](http://msdn.microsoft.com/en-us/library/windowsazure/gg432988.aspx).
+
+```PHP
+$hostedServiceName = "myhostedservice";
+$deploymentName = "v1";
+$slot = DeploymentSlot::PRODUCTION;
+$packageUrl = "URL_for_.cspkg_file";
+$configuration = file_get_contents('path_to_.cscfg_file');
+$label = base64_encode($hostedServiceName);
+
+$result = $serviceManagementRestProxy->createDeployment($hostedServiceName,
+ $deploymentName,
+ $slot,
+ $packageUrl,
+ $configuration,
+ $label);
+
+$status = $serviceManagementRestProxy->getOperationStatus($result);
+echo "Operation status: ".$status->getStatus()."<br />";
+```
**For more examples please see the [Windows Azure PHP Developer Center](http://www.windowsazure.com/en-us/develop/php)**
View
@@ -1,3 +1,13 @@
+Windows Azure SDK For PHP 0.3.1, 2012-08-17
+-------------------------------------------
+- Added additional API support for Service Management:
+ * Operations on Hosted Services
+ > create, update, delete, list, get properties
+ * Operations on Deployments
+ > deployment: create, get, delete, swap, change configuration, update status, upgrade, rollback
+ > role instance: reboot, reimage
+
+
Windows Azure SDK For PHP 0.3.0, 2012-07-16
-------------------------------------------
- Added Cloud Configuration Manager

0 comments on commit 130af9b

Please sign in to comment.