Skip to content

Commit 31dbb3c

Browse files
author
Jamie Hannaford
committed
Merge pull request #589 from rackspace/working
Merging working into master in preparation for minor version bump
2 parents 519a6d3 + 5cf4361 commit 31dbb3c

39 files changed

Lines changed: 1692 additions & 26 deletions

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ notifications:
3232
- shaunak.kashyap@rackspace.com
3333

3434
env:
35-
- secure: "bdrUeYb3nSGgBB+QtDZxUHVPw6B/wjb3KXLm8TgonWrQm4GPeWKK29qhmDnFZmQjwQPfuebe7wAk1ZxGoZKbEiELVpJJ+8XYVOt6W/6V53H31JL6FqiIE5+7qBwDe+9ziveM6GcTXHT1GI5mUeACIbeBDPZaNubIJH3U6MPim64="
35+
- secure: "bdrUeYb3nSGgBB+QtDZxUHVPw6B/wjb3KXLm8TgonWrQm4GPeWKK29qhmDnFZmQjwQPfuebe7wAk1ZxGoZKbEiELVpJJ+8XYVOt6W/6V53H31JL6FqiIE5+7qBwDe+9ziveM6GcTXHT1GI5mUeACIbeBDPZaNubIJH3U6MPim64="

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Requirements
1919
* PHP >=5.4
2020
* cURL extension for PHP
2121

22-
**Note**: Since PHP 5.3 has reached [end of life](http://php.net/eol.php) and is no longer officially supported, we are moving to 5.4 as a minimum requirement. If upgrading is not an option and you still need a stable version of the SDK for 5.3, please follow [this guide](http://docs.php-opencloud.com/en/latest/using-php-5.3).
22+
**Note**: Since PHP 5.3 has reached [end of life](http://php.net/eol.php) and is no longer officially supported, we are moving to 5.4 as a minimum requirement. If upgrading is not an option and you still need a stable version of the SDK for 5.3, please follow [this guide](http://docs.php-opencloud.com/en/latest/using-php-5.3.html).
2323

2424
Installation
2525
------------

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
},
2828
"require": {
2929
"php" : ">=5.4",
30-
"guzzle/guzzle" : "~3.8",
31-
"psr/log": "~1.0"
30+
"guzzle/http" : "~3.8",
31+
"psr/log": "~1.0",
32+
"mikemccabe/json-patch-php": "~0.1"
3233
},
3334
"require-dev" : {
3435
"phpunit/phpunit": "4.3.*",

doc/services/object-store/migrating-containers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ Requirements
3737
3838
use Guzzle\Plugin\Backoff\BackoffPlugin;
3939
40-
// set timeout in secs
41-
$timeout = 10;
40+
// maximum number of retries
41+
$maxRetries = 10;
4242
4343
// set HTTP error codes
4444
$httpErrors = array(500, 503, 408);
4545
46-
$backoffPlugin = BackoffPlugin::getExponentialBackoff($timeout, $httpErrors);
46+
$backoffPlugin = BackoffPlugin::getExponentialBackoff($maxRetries, $httpErrors);
4747
$client->addSubscriber($backoffPlugin);
4848
4949

doc/services/object-store/objects.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ Get content of file
259259
.. code-block:: php
260260
261261
/** @param $content Guzzle\Http\EntityBody */
262-
$content = $object->getContainer();
262+
$content = $object->getContent();
263263
264264
265265
Get type of file

docs/userguide/CDN/README.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# CDN
2+
3+
**CDN** is a service that you can use to manage your CDN-enabled domains and the origins and assets associated with those domains.
4+
5+
## Concepts
6+
7+
To use the CDN service effectively, you should understand the following key concepts:
8+
9+
* **Content delivery network**: A content delivery network (CDN) is a system of multiple computers that contains copies of data stored at various network nodes. A CDN is designed to improve performance of publicly distributed assets. Assets can be anything from website content, to web application components, to media such as videos, ads, and interactive experiences.  CDNs decrease the load time of these assets by caching them on edge servers, also called points of presence (PoPs).  Edge servers are distributed around the globe, meaning requests only travel to a local location to grab assets, rather than to and from a data center based far from the end user.
10+
11+
* **Edge node**: CDN providers have many points of presence (PoP) servers around the world. These servers are known as edge nodes. These edge nodes cache the content and serve it directly to customers, thus reducing transit time to a customers location.
12+
13+
* **Edge server**: An edge server is the same as an edge node.
14+
15+
* **Origin**: An origin is an address (IP or domain) from which the CDN provider pulls content. A service can have multiple origins.
16+
17+
* **Flavor**: A flavor is a configuration option. A flavor enables you to choose from a generic setting that is powered by one or more CDN providers.
18+
19+
* **Service**: A service represents your web application that has its content cached to the edge nodes.
20+
21+
* **Status**: The status indicates the current state of the service. The time it takes for a service configuration to be distributed amongst a CDN provider cache can vary.
22+
23+
* **Purge**: Purging removes content from the edge servers - thus invalidating the content - so that it can be refreshed from your origin servers.
24+
25+
* **Caching rule**: A caching rule provides you with fine-grained control over the time-to-live (TTL) of an object. When the TTL expires for an object, the edge node pulls the object from the origin again.
26+
27+
* **Restriction**: A restriction enables you to define rules about who can or cannot access content from the cache. Examples of a restriction are allowing requests only from certain domains, geographies, or IP addresses.
28+
29+
## Getting started
30+
31+
### 1. Instantiate an OpenStack or Rackspace client.
32+
33+
To use the CDN service, you must first instantiate a `OpenStack` or `Rackspace` client object.
34+
35+
* If you are working with an OpenStack cloud, instantiate an `OpenCloud\OpenStack` client as follows:
36+
37+
```php
38+
use OpenCloud\OpenStack;
39+
40+
$client = new OpenStack('<OPENSTACK CLOUD IDENTITY ENDPOINT URL>', array(
41+
'username' => '<YOUR OPENSTACK CLOUD ACCOUNT USERNAME>',
42+
'password' => '<YOUR OPENSTACK CLOUD ACCOUNT PASSWORD>'
43+
));
44+
```
45+
46+
* If you are working with the Rackspace cloud, instantiate a `OpenCloud\Rackspace` client as follows:
47+
48+
```php
49+
use OpenCloud\Rackspace;
50+
51+
$client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, array(
52+
'username' => '<YOUR RACKSPACE CLOUD ACCOUNT USERNAME>',
53+
'apiKey' => '<YOUR RACKSPACE CLOUD ACCOUNT API KEY>'
54+
));
55+
```
56+
57+
### 2. Obtain a CDN service object from the client.
58+
All CDN operations are done via an _CDN service object_. To
59+
instantiate this object, call the `cdnService` method on the `$client`
60+
object. This method takes one argument:
61+
62+
| Position | Description | Data type | Required? | Default value | Example value |
63+
| -------- | ----------- | ----------| --------- | ------------- | ------------- |
64+
| 1 | Name of the service, as it appears in the service catalog | String | No | `null`; automatically determined when possible | `rackCDN` |
65+
66+
67+
```php
68+
$cdnService = $client->cdnService();
69+
```
70+
71+
### 3. Create a service (to represent your web application).
72+
```php
73+
$service = $cdnService->createService(array(
74+
'name' => 'acme_site',
75+
'domains' => array(
76+
array(
77+
'domain' => 'www.acme.com'
78+
),
79+
array(
80+
'domain' => 'acme.com'
81+
)
82+
),
83+
'origins' => array(
84+
array(
85+
'origin' => 'origin.acme.com'
86+
)
87+
),
88+
'flavorId' => 'cdn'
89+
));
90+
```
91+
92+
[ [Get the executable PHP script for this example](/samples/CDN/create-service.php) ]
93+
94+
## Next steps
95+
96+
Once you have created a service, there is more you can do with it. See [complete user guide for CDN](USERGUIDE.md).

0 commit comments

Comments
 (0)