Zend Framework  1.12
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Zend_Service_SqlAzure_Management_Client Class Reference

Public Member Functions

 __construct ($subscriptionId, $certificatePath, $certificatePassphrase, Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy=null)
 Creates a new Zend_Service_SqlAzure_Management instance.
 
 setHttpClientChannel ($adapterInstance= 'Zend_Http_Client_Adapter_Socket')
 Set the HTTP client channel to use.
 
 getHttpClientChannel ()
 Retrieve HTTP client channel.
 
 getSubscriptionId ()
 Returns the Windows Azure subscription ID.
 
 getLastRequestId ()
 Returns the last request ID.
 
 getBaseUrl ()
 Get base URL for creating requests.
 
 createServer ($administratorLogin, $administratorPassword, $location)
 The Create Server operation adds a new SQL Azure server to a subscription.
 
 listServers ()
 The Get Servers operation enumerates SQL Azure servers that are provisioned for a subscription.
 
 dropServer ($serverName)
 The Drop Server operation drops a SQL Azure server from a subscription.
 
 setAdministratorPassword ($serverName, $administratorPassword)
 The Set Server Administrator Password operation sets the administrative password of a SQL Azure server for a subscription.
 
 createFirewallRule ($serverName, $ruleName, $startIpAddress, $endIpAddress)
 The 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.
 
 listFirewallRules ($serverName)
 The Get Server Firewall Rules operation retrieves a list of all the firewall rules for a SQL Azure server that belongs to a subscription.
 
 deleteFirewallRule ($serverName, $ruleName)
 The Delete Server Firewall Rule operation deletes a firewall rule from a SQL Azure server that belongs to a subscription.
 
 createFirewallRuleForMicrosoftServices ($serverName, $allowAccess)
 Creates a firewall rule for Microsoft Services.
 

Static Public Member Functions

static urlencode ($value)
 URL encode function.
 
static createQueryStringFromArray ($queryString)
 Builds a query string from an array of elements.
 

Public Attributes

const URL_MANAGEMENT = "https://management.database.windows.net:8443"
 Management service URL.
 
const OP_OPERATIONS = "operations"
 Operations.
 
const OP_SERVERS = "servers"
 
const OP_FIREWALLRULES = "firewallrules"
 

Protected Member Functions

 _performRequest ($path= '/', $queryString= '', $httpVerb=Zend_Http_Client::GET, $headers=array(), $rawData=null)
 Perform request using Zend_Http_Client channel.
 
 _parseResponse (Zend_Http_Response $response=null)
 Parse result from Zend_Http_Response.
 
 _getErrorMessage (Zend_Http_Response $response, $alternativeError= 'Unknown error.')
 Get error message from Zend_Http_Response.
 

Protected Attributes

 $_apiVersion = '1.0'
 
 $_subscriptionId = ''
 
 $_certificatePath = ''
 
 $_certificatePassphrase = ''
 
 $_httpClientChannel = null
 
 $_retryPolicy = null
 
 $_lastRequestId = null
 

Constructor & Destructor Documentation

__construct (   $subscriptionId,
  $certificatePath,
  $certificatePassphrase,
Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract  $retryPolicy = null 
)

Creates a new Zend_Service_SqlAzure_Management instance.

Parameters
string$subscriptionIdSubscription ID
string$certificatePathManagement certificate path (.PEM)
string$certificatePassphraseManagement certificate passphrase
Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract$retryPolicyRetry policy to use when making requests

Member Function Documentation

_getErrorMessage ( Zend_Http_Response  $response,
  $alternativeError = 'Unknown error.' 
)
protected

Get error message from Zend_Http_Response.

Parameters
Zend_Http_Response$responseRepsonse
string$alternativeErrorAlternative error message
Returns
string
_parseResponse ( Zend_Http_Response  $response = null)
protected

Parse result from Zend_Http_Response.

Parameters
Zend_Http_Response$responseResponse from HTTP call
Returns
object
Exceptions
Zend_Service_WindowsAzure_Exception
_performRequest (   $path = '/',
  $queryString = '',
  $httpVerb = Zend_Http_Client::GET,
  $headers = array(),
  $rawData = null 
)
protected

Perform request using Zend_Http_Client channel.

Parameters
string$pathPath
string$queryStringQuery string
string$httpVerbHTTP verb the request will use
array$headersx-ms headers to add
mixed$rawDataOptional RAW HTTP data to be sent over the wire
Returns
Zend_Http_Response
createFirewallRule (   $serverName,
  $ruleName,
  $startIpAddress,
  $endIpAddress 
)

The 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.

Parameters
string$serverNameServer name.
string$ruleNameFirewall rule name.
string$startIpAddressStart IP address.
string$endIpAddressEnd IP address.
Returns
Zend_Service_SqlAzure_Management_FirewallRuleInstance
Exceptions
Zend_Service_SqlAzure_Management_Exception
createFirewallRuleForMicrosoftServices (   $serverName,
  $allowAccess 
)

Creates a firewall rule for Microsoft Services.

This is required if access to SQL Azure is required from other services like Windows Azure.

Parameters
string$serverNameServer name.
boolean$allowAccessAllow access from other Microsoft Services?
Exceptions
Zend_Service_SqlAzure_Management_Exception
static createQueryStringFromArray (   $queryString)
static

Builds a query string from an array of elements.

Parameters
arrayArray of elements
Returns
string Assembled query string
createServer (   $administratorLogin,
  $administratorPassword,
  $location 
)

The Create Server operation adds a new SQL Azure server to a subscription.

Parameters
string$administratorLoginAdministrator login.
string$administratorPasswordAdministrator password.
string$locationLocation of the server.
Returns
Zend_Service_SqlAzure_Management_ServerInstance Server information.
Exceptions
Zend_Service_SqlAzure_Management_Exception
deleteFirewallRule (   $serverName,
  $ruleName 
)

The Delete Server Firewall Rule operation deletes a firewall rule from a SQL Azure server that belongs to a subscription.

Parameters
string$serverNameServer name.
string$ruleNameRule name.
Exceptions
Zend_Service_SqlAzure_Management_Exception
dropServer (   $serverName)

The Drop Server operation drops a SQL Azure server from a subscription.

Parameters
string$serverNameServer to drop.
Exceptions
Zend_Service_SqlAzure_Management_Exception
getBaseUrl ( )

Get base URL for creating requests.

Returns
string
getHttpClientChannel ( )

Retrieve HTTP client channel.

Returns
Zend_Http_Client_Adapter_Interface
getLastRequestId ( )

Returns the last request ID.

Returns
string
getSubscriptionId ( )

Returns the Windows Azure subscription ID.

Returns
string
listFirewallRules (   $serverName)

The Get Server Firewall Rules operation retrieves a list of all the firewall rules for a SQL Azure server that belongs to a subscription.

Parameters
string$serverNameServer name.
Returns
Array of Zend_Service_SqlAzure_Management_FirewallRuleInstance.
Exceptions
Zend_Service_SqlAzure_Management_Exception
listServers ( )

The Get Servers operation enumerates SQL Azure servers that are provisioned for a subscription.

Returns
array An array of Zend_Service_SqlAzure_Management_ServerInstance.
Exceptions
Zend_Service_SqlAzure_Management_Exception
setAdministratorPassword (   $serverName,
  $administratorPassword 
)

The Set Server Administrator Password operation sets the administrative password of a SQL Azure server for a subscription.

Parameters
string$serverNameServer to set password for.
string$administratorPasswordAdministrator password.
Exceptions
Zend_Service_SqlAzure_Management_Exception
setHttpClientChannel (   $adapterInstance = 'Zend_Http_Client_Adapter_Socket')

Set the HTTP client channel to use.

Parameters
Zend_Http_Client_Adapter_Interface | string$adapterInstanceAdapter instance or adapter class name.
static urlencode (   $value)
static

URL encode function.

Parameters
string$valueValue to encode
Returns
string Encoded value

Member Data Documentation

$_apiVersion = '1.0'
protected
$_certificatePassphrase = ''
protected
$_certificatePath = ''
protected
$_httpClientChannel = null
protected
$_lastRequestId = null
protected
$_retryPolicy = null
protected
$_subscriptionId = ''
protected
const OP_FIREWALLRULES = "firewallrules"
const OP_OPERATIONS = "operations"

Operations.

const OP_SERVERS = "servers"
const URL_MANAGEMENT = "https://management.database.windows.net:8443"

Management service URL.