Service/SqlAzure/Management/Client.php

Show: inherited
Table of Contents

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

Package: Zend\Service\SqlAzure\Management

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Constant  URL_MANAGEMENT = "https://management.database.windows.net:8443"

Management service URL

Constant  OP_OPERATIONS = "operations"

Operations

Constant  OP_SERVERS = "servers"
Constant  OP_FIREWALLRULES = "firewallrules"

Properties

Propertyprotectedstring $_apiVersion = '1.0'

Current API version

Default value'1.0'Details
Type
string
Propertyprotectedstring $_certificatePassphrase = ''

Management certificate passphrase

Default value''Details
Type
string
Propertyprotectedstring $_certificatePath = ''

Management certificate path (.PEM)

Default value''Details
Type
string
Propertyprotected\Zend_Http_Client $_httpClientChannel = null

Zend_Http_Client channel used for communication with REST services

Default valuenullDetails
Type
\Zend_Http_Client
Propertyprotectedstring $_lastRequestId = null

Returns the last request ID

Default valuenullDetails
Type
string
Propertyprotected\Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract $_retryPolicy = null

Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract instance

Propertyprotectedstring $_subscriptionId = ''

Subscription ID

Default value''Details
Type
string

Methods

methodpublic__construct(string $subscriptionId, string $certificatePath, string $certificatePassphrase, \Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null) : void

Creates a new Zend_Service_SqlAzure_Management instance

Parameters
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

methodprotected_getErrorMessage(\Zend_Http_Response $response, string $alternativeError = 'Unknown error.') : string

Get error message from Zend_Http_Response

Parameters
Name Type Description
$response \Zend_Http_Response

Repsonse

$alternativeError string

Alternative error message

Returns
Type Description
string
methodprotected_parseResponse(\Zend_Http_Response $response = null) : object

Parse result from Zend_Http_Response

Parameters
Name Type Description
$response \Zend_Http_Response

Response from HTTP call

Returns
Type Description
object
Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodprotected_performRequest(string $path = '/', string $queryString = '', string $httpVerb = \Zend_Http_Client::GET, array $headers = array(), mixed $rawData = null) : \Zend_Http_Response

Perform request using Zend_Http_Client channel

Parameters
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

Returns
Type Description
\Zend_Http_Response
methodpubliccreateFirewallRule(string $serverName, string $ruleName, string $startIpAddress, string $endIpAddress) : \Zend_Service_SqlAzure_Management_FirewallRuleInstance

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
Name Type Description
$serverName string

Server name.

$ruleName string

Firewall rule name.

$startIpAddress string

Start IP address.

$endIpAddress string

End IP address.

Returns
Type Description
\Zend_Service_SqlAzure_Management_FirewallRuleInstance
Throws
Exception Description
\Zend_Service_SqlAzure_Management_Exception
methodpubliccreateFirewallRuleForMicrosoftServices(string $serverName, boolean $allowAccess) : void

Creates a firewall rule for Microsoft Services.

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

Parameters
Name Type Description
$serverName string

Server name.

$allowAccess boolean

Allow access from other Microsoft Services?

Throws
Exception Description
\Zend_Service_SqlAzure_Management_Exception
methodpubliccreateQueryStringFromArray(array $queryString) : string
static

Builds a query string from an array of elements

Parameters
Name Type Description
$queryString array

Array of elements

Returns
Type Description
string Assembled query string
methodpubliccreateServer(string $administratorLogin, string $administratorPassword, string $location) : \Zend_Service_SqlAzure_Management_ServerInstance

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

Parameters
Name Type Description
$administratorLogin string

Administrator login.

$administratorPassword string

Administrator password.

$location string

Location of the server.

Returns
Type Description
\Zend_Service_SqlAzure_Management_ServerInstance Server information.
Throws
Exception Description
\Zend_Service_SqlAzure_Management_Exception
methodpublicdeleteFirewallRule(string $serverName, string $ruleName) : void

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

Parameters
Name Type Description
$serverName string

Server name.

$ruleName string

Rule name.

Throws
Exception Description
\Zend_Service_SqlAzure_Management_Exception
methodpublicdropServer(string $serverName) : void

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

Parameters
Name Type Description
$serverName string

Server to drop.

Throws
Exception Description
\Zend_Service_SqlAzure_Management_Exception
methodpublicgetBaseUrl() : string

Get base URL for creating requests

Returns
Type Description
string
methodpublicgetHttpClientChannel() : \Zend_Http_Client_Adapter_Interface

Retrieve HTTP client channel

Returns
Type Description
\Zend_Http_Client_Adapter_Interface
methodpublicgetLastRequestId() : string

Returns the last request ID.

Returns
Type Description
string
methodpublicgetSubscriptionId() : string

Returns the Windows Azure subscription ID

Returns
Type Description
string
methodpubliclistFirewallRules(string $serverName) : Array

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
Name Type Description
$serverName string

Server name.

Returns
Type Description
Array of Zend_Service_SqlAzure_Management_FirewallRuleInstance.
Throws
Exception Description
\Zend_Service_SqlAzure_Management_Exception
methodpubliclistServers() : array

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

Returns
Type Description
array An array of Zend_Service_SqlAzure_Management_ServerInstance.
Throws
Exception Description
\Zend_Service_SqlAzure_Management_Exception
methodpublicsetAdministratorPassword(string $serverName, string $administratorPassword) : void

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

Parameters
Name Type Description
$serverName string

Server to set password for.

$administratorPassword string

Administrator password.

Throws
Exception Description
\Zend_Service_SqlAzure_Management_Exception
methodpublicsetHttpClientChannel(\Zend_Http_Client_Adapter_Interface | string $adapterInstance = 'Zend_Http_Client_Adapter_Socket') : void

Set the HTTP client channel to use

Parameters
Name Type Description
$adapterInstance \Zend_Http_Client_Adapter_Interface | string

Adapter instance or adapter class name.

methodpublicurlencode(string $value) : string
static

URL encode function

Parameters
Name Type Description
$value string

Value to encode

Returns
Type Description
string Encoded value
Documentation was generated by phpDocumentor 2.0.0a8.