Service/SqlAzure/Management/Client.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Service_WindowsAzure
- Subpackage
- Management
- Version
- $Id$
\Zend_Service_SqlAzure_Management_Client
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties

string $_certificatePassphrase = ''Management certificate passphrase
''Details- Type
- string

\Zend_Http_Client $_httpClientChannel = nullZend_Http_Client channel used for communication with REST services
nullDetails- Type
- \Zend_Http_Client

\Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract $_retryPolicy = nullZend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract instance
nullDetails
Methods

__construct(string $subscriptionId, string $certificatePath, string $certificatePassphrase, \Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null) : voidCreates a new Zend_Service_SqlAzure_Management instance
| Name | Type | Description |
|---|---|---|
| $subscriptionId | string | Subscription ID |
| $certificatePath | string | Management certificate path (.PEM) |
| $certificatePassphrase | string | Management certificate passphrase |
| $retryPolicy | \Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract | Retry policy to use when making requests |

_getErrorMessage(\Zend_Http_Response $response, string $alternativeError = 'Unknown error.') : stringGet error message from Zend_Http_Response
| Name | Type | Description |
|---|---|---|
| $response | \Zend_Http_Response | Repsonse |
| $alternativeError | string | Alternative error message |
| Type | Description |
|---|---|
| string |

_parseResponse(\Zend_Http_Response $response = null) : objectParse result from Zend_Http_Response
| Name | Type | Description |
|---|---|---|
| $response | \Zend_Http_Response | Response from HTTP call |
| Type | Description |
|---|---|
| object |
| Exception | Description |
|---|---|
| \Zend_Service_WindowsAzure_Exception |

_performRequest(string $path = '/', string $queryString = '', string $httpVerb = \Zend_Http_Client::GET, array $headers = array(), mixed $rawData = null) : \Zend_Http_ResponsePerform request using Zend_Http_Client channel
| Name | Type | Description |
|---|---|---|
| $path | string | Path |
| $queryString | string | Query string |
| $httpVerb | string | HTTP verb the request will use |
| $headers | array | x-ms headers to add |
| $rawData | mixed | Optional RAW HTTP data to be sent over the wire |
| Type | Description |
|---|---|
| \Zend_Http_Response |

createFirewallRule(string $serverName, string $ruleName, string $startIpAddress, string $endIpAddress) : \Zend_Service_SqlAzure_Management_FirewallRuleInstanceThe Set Server Firewall Rule operation updates an existing firewall rule or adds a new firewall rule for a SQL Azure server that belongs to a subscription.
| Name | Type | Description |
|---|---|---|
| $serverName | string | Server name. |
| $ruleName | string | Firewall rule name. |
| $startIpAddress | string | Start IP address. |
| $endIpAddress | string | End IP address. |
| Type | Description |
|---|---|
| \Zend_Service_SqlAzure_Management_FirewallRuleInstance |
| Exception | Description |
|---|---|
| \Zend_Service_SqlAzure_Management_Exception |

createFirewallRuleForMicrosoftServices(string $serverName, boolean $allowAccess) : voidCreates a firewall rule for Microsoft Services.
This is required if access to SQL Azure is required from other services like Windows Azure.
| Name | Type | Description |
|---|---|---|
| $serverName | string | Server name. |
| $allowAccess | boolean | Allow access from other Microsoft Services? |
| Exception | Description |
|---|---|
| \Zend_Service_SqlAzure_Management_Exception |

createQueryStringFromArray(array $queryString) : stringBuilds a query string from an array of elements
| Name | Type | Description |
|---|---|---|
| $queryString | array | Array of elements |
| Type | Description |
|---|---|
| string | Assembled query string |

createServer(string $administratorLogin, string $administratorPassword, string $location) : \Zend_Service_SqlAzure_Management_ServerInstanceThe Create Server operation adds a new SQL Azure server to a subscription.
| Name | Type | Description |
|---|---|---|
| $administratorLogin | string | Administrator login. |
| $administratorPassword | string | Administrator password. |
| $location | string | Location of the server. |
| Type | Description |
|---|---|
| \Zend_Service_SqlAzure_Management_ServerInstance | Server information. |
| Exception | Description |
|---|---|
| \Zend_Service_SqlAzure_Management_Exception |

deleteFirewallRule(string $serverName, string $ruleName) : voidThe Delete Server Firewall Rule operation deletes a firewall rule from a SQL Azure server that belongs to a subscription.
| Name | Type | Description |
|---|---|---|
| $serverName | string | Server name. |
| $ruleName | string | Rule name. |
| Exception | Description |
|---|---|
| \Zend_Service_SqlAzure_Management_Exception |

dropServer(string $serverName) : voidThe Drop Server operation drops a SQL Azure server from a subscription.
| Name | Type | Description |
|---|---|---|
| $serverName | string | Server to drop. |
| Exception | Description |
|---|---|
| \Zend_Service_SqlAzure_Management_Exception |

getHttpClientChannel() : \Zend_Http_Client_Adapter_InterfaceRetrieve HTTP client channel
| Type | Description |
|---|---|
| \Zend_Http_Client_Adapter_Interface |

getSubscriptionId() : stringReturns the Windows Azure subscription ID
| Type | Description |
|---|---|
| string |

listFirewallRules(string $serverName) : ArrayThe Get Server Firewall Rules operation retrieves a list of all the firewall rules for a SQL Azure server that belongs to a subscription.
| Name | Type | Description |
|---|---|---|
| $serverName | string | Server name. |
| Type | Description |
|---|---|
| Array | of Zend_Service_SqlAzure_Management_FirewallRuleInstance. |
| Exception | Description |
|---|---|
| \Zend_Service_SqlAzure_Management_Exception |

listServers() : arrayThe Get Servers operation enumerates SQL Azure servers that are provisioned for a subscription.
| Type | Description |
|---|---|
| array | An array of Zend_Service_SqlAzure_Management_ServerInstance. |
| Exception | Description |
|---|---|
| \Zend_Service_SqlAzure_Management_Exception |

setAdministratorPassword(string $serverName, string $administratorPassword) : voidThe Set Server Administrator Password operation sets the administrative password of a SQL Azure server for a subscription.
| Name | Type | Description |
|---|---|---|
| $serverName | string | Server to set password for. |
| $administratorPassword | string | Administrator password. |
| Exception | Description |
|---|---|
| \Zend_Service_SqlAzure_Management_Exception |

setHttpClientChannel(\Zend_Http_Client_Adapter_Interface | string $adapterInstance = 'Zend_Http_Client_Adapter_Socket') : voidSet the HTTP client channel to use
| Name | Type | Description |
|---|---|---|
| $adapterInstance | \Zend_Http_Client_Adapter_Interface | string | Adapter instance or adapter class name. |