Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
e959b01
Allow using PUT (default) or PATCH as update method depending on prop…
ycombinator Dec 18, 2014
87d3116
Setting memory limit needed for code coverage generation.
ycombinator Dec 19, 2014
601e18c
Parameterize type of service in catalog so it can be specified when b…
ycombinator Dec 19, 2014
733ddd6
Adding tests and implementation for the CDN service.
ycombinator Dec 19, 2014
f156f47
Whitespace fixes.
ycombinator Dec 19, 2014
bde9c66
Fixing docblock for Flavor class.
ycombinator Dec 19, 2014
95eada8
Looping over object properties while changing them is a bad idea!
ycombinator Dec 23, 2014
6d65fca
Use the maximum pagination limit supported by the API, unless client …
ycombinator Dec 23, 2014
f963aef
Do not use the top-level property in the create JSON.
ycombinator Dec 23, 2014
020f7b3
Adding smoke tests for CDN.
ycombinator Dec 23, 2014
1b0eef9
Adding code samples.
ycombinator Dec 23, 2014
07d62a0
Adding Getting Started Guide for CDN service.
ycombinator Dec 25, 2014
8f54c4e
Adding another property alias.
ycombinator Dec 25, 2014
260f68f
Clarifying definition.
ycombinator Dec 25, 2014
038e2da
Disambiguating "service" by providing additional context.
ycombinator Dec 25, 2014
f525941
Fixing link.
ycombinator Dec 25, 2014
157ea27
Adding Complete User Guide for CDN service.
ycombinator Dec 25, 2014
ad71565
Whitespace lint fixes.
ycombinator Dec 25, 2014
1c59c45
Removing limits.
ycombinator Dec 25, 2014
ffb915d
Fixing formatting.
ycombinator Dec 26, 2014
92cbf98
Fixing typo.
ycombinator Dec 26, 2014
ee47135
Changing syntax to be PHP5.3-compliant.
ycombinator Dec 26, 2014
5804006
Fixing link.
ycombinator Dec 26, 2014
72182f3
Adding section on service assets.
ycombinator Dec 26, 2014
8b179f6
Fixing typo in variable name.
ycombinator Dec 26, 2014
5f4976e
Fixing case in variable names.
ycombinator Dec 26, 2014
f45dc27
Fixing method name.
ycombinator Dec 26, 2014
36336cb
Adding support for GET / and GET /ping APIs.
ycombinator Dec 30, 2014
f2fe5ab
Adding errors property to Service resource.
ycombinator Dec 30, 2014
138e096
Remove Accept request header for APIs that don't return responses.
ycombinator Dec 30, 2014
cae80de
Force addition of trailing slash to URL in order to make GET / work.
ycombinator Dec 30, 2014
97f8037
Adding smoke tests for GET / and GET /ping APIs.
ycombinator Dec 30, 2014
9686882
Wait for service to return to a status where further changes can be m…
ycombinator Dec 30, 2014
a9de5fc
Removing trailing space to make the linter happy.
ycombinator Dec 30, 2014
3386d76
Adding ID property (primary key; generated) to Service resource.
ycombinator Dec 31, 2014
67da4ed
Expanding on arguments.
ycombinator Jan 2, 2015
e29681e
Moving @see annotations to new line.
ycombinator Jan 2, 2015
b7b020e
Doing the same things with fewer lines of code.
ycombinator Jan 2, 2015
70be88b
Refactoring to remove single-use local variable.
ycombinator Jan 2, 2015
5dc7b41
Condensing single-element array literals to single line.
ycombinator Jan 2, 2015
8908d8a
Fixing typo in method names.
ycombinator Jan 2, 2015
9acbae5
Using better ID placeholder names.
ycombinator Jan 2, 2015
e16e9a0
Fixing formatting issues due to missing backticks.
ycombinator Jan 2, 2015
7f1b971
Trimming whitespace.
ycombinator Jan 2, 2015
c908eb9
Standardizing placeholders to use camelCase.
ycombinator Jan 2, 2015
959a489
Fixing parameter paths.
ycombinator Jan 3, 2015
6d0a4e0
Aliasing requestUrl -> request_url.
ycombinator Jan 3, 2015
7a7ff51
Clarifying parameter descriptions.
ycombinator Jan 3, 2015
5f550f9
Fixing typos.
ycombinator Jan 3, 2015
013d768
Clarifying parameter description.
ycombinator Jan 3, 2015
a0671b8
Adding helper methods to generate JSON Patch representation for resou…
ycombinator Jan 5, 2015
703941c
Refactoring PATCH headers to Base.
ycombinator Jan 5, 2015
4d86881
Overriding update() for Service resource; getting rid of update logic…
ycombinator Jan 5, 2015
650e80d
Removing newline to trigger build.
ycombinator Jan 6, 2015
b610917
Removing docs for administrative operations.
ycombinator Jan 6, 2015
2377b06
Fixing ``` alignment.
ycombinator Jan 6, 2015
49d5ed8
Using $this->updateKeys to determine the current values of updateable…
ycombinator Jan 6, 2015
28a4234
Using property aliases when generating JSON Patch representation.
ycombinator Jan 6, 2015
8257700
Accessing static method... statically.
ycombinator Jan 6, 2015
74a900a
Trying GC disabling to kill the segfault.
ycombinator Jan 6, 2015
859c725
Increasing memory limit further to try and kill the segfault.
ycombinator Jan 6, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,17 @@
"OpenCloud": ["lib/", "tests/"]
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/ycombinator/json-patch-php"
}
],
"require": {
"php" : ">=5.3.3",
"guzzle/http" : "~3.8",
"psr/log": "~1.0"
"psr/log": "~1.0",
"mikemccabe/json-patch-php": "dev-master"
},
"require-dev" : {
"phpunit/phpunit": "4.3.*",
Expand Down
96 changes: 96 additions & 0 deletions docs/userguide/CDN/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# CDN

**CDN** is a service that you can use to manage your CDN-enabled domains and the origins and assets associated with those domains.

## Concepts

To use the CDN service effectively, you should understand the following key concepts:

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

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

* **Edge server**: An edge server is the same as an edge node.

* **Origin**: An origin is an address (IP or domain) from which the CDN provider pulls content. A service can have multiple origins.

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

* **Service**: A service represents your web application that has its content cached to the edge nodes.

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

* **Purge**: Purging removes content from the edge servers - thus invalidating the content - so that it can be refreshed from your origin servers.

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

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

## Getting started

### 1. Instantiate an OpenStack or Rackspace client.

To use the CDN service, you must first instantiate a `OpenStack` or `Rackspace` client object.

* If you are working with an OpenStack cloud, instantiate an `OpenCloud\OpenStack` client as follows:

```php
use OpenCloud\OpenStack;

$client = new OpenStack('<OPENSTACK CLOUD IDENTITY ENDPOINT URL>', array(
'username' => '<YOUR OPENSTACK CLOUD ACCOUNT USERNAME>',
'password' => '<YOUR OPENSTACK CLOUD ACCOUNT PASSWORD>'
));
```

* If you are working with the Rackspace cloud, instantiate a `OpenCloud\Rackspace` client as follows:

```php
use OpenCloud\Rackspace;

$client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, array(
'username' => '<YOUR RACKSPACE CLOUD ACCOUNT USERNAME>',
'apiKey' => '<YOUR RACKSPACE CLOUD ACCOUNT API KEY>'
));
```

### 2. Obtain a CDN service object from the client.
All CDN operations are done via an _CDN service object_. To
instantiate this object, call the `cdnService` method on the `$client`
object. This method takes one argument:

| Position | Description | Data type | Required? | Default value | Example value |
| -------- | ----------- | ----------| --------- | ------------- | ------------- |
| 1 | Name of the service, as it appears in the service catalog | String | No | `null`; automatically determined when possible | `rackCDN` |


```php
$cdnService = $client->cdnService();
```

### 3. Create a service (to represent your web application).
```php
$service = $cdnService->createService(array(
'name' => 'acme_site',
'domains' => array(
array(
'domain' => 'www.acme.com'
),
array(
'domain' => 'acme.com'
)
),
'origins' => array(
array(
'origin' => 'origin.acme.com'
)
),
'flavorId' => 'cdn'
));
```

[ [Get the executable PHP script for this example](/samples/CDN/create-service.php) ]

## Next steps

Once you have created a service, there is more you can do with it. See [complete user guide for CDN](USERGUIDE.md).
Loading