Skip to content

Commit

Permalink
Modifying doc formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiehannaford committed Feb 6, 2014
1 parent c623834 commit a54ffcb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion docs/userguide/LoadBalancer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ on (80) does not need to match the ports of its nodes (8080).
## Next steps

Once you have created a load balancer, there is a lot you can do with it. See
the [complete user guide for load balancers](USERGUIDE.md).
the [complete user guide for load balancers](USERGUIDE.md).
58 changes: 29 additions & 29 deletions docs/userguide/LoadBalancer/USERGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ $serverTwoNode->condition = 'ENABLED';

$loadBalancer->addVirtualIp('PUBLIC');
$loadBalancer->create(array(
'name' => 'My smart load balancer',
'port' => 80,
'name' => 'My smart load balancer',
'port' => 80,
'protocol' => 'HTTP',
'nodes' => array($serverOneNode, $serverTwoNode)
'nodes' => array($serverOneNode, $serverTwoNode)
));
```

Expand All @@ -63,7 +63,8 @@ You can retrieve a single load balancer's details by using its ID.

```php
$loadBalancer = $loadBalancerService->loadBalancer('254889');
var_dump($loadBalancer); // instance of OpenCloud\LoadBalancer\Resource\LoadBalancer

/** @var $loadBalancer OpenCloud\LoadBalancer\Resource\LoadBalancer **/
```

### List Load Balancers
Expand All @@ -74,7 +75,7 @@ is returned.
```php
$loadBalancers = $loadBalancerService->loadBalancerList();
foreach ($loadBalancers as $loadBalancer) {
var_dump($loadBalancer); // instance of OpenCloud\LoadBalancer\Resource\LoadBalancer
/** @var $loadBalancer OpenCloud\LoadBalancer\Resource\LoadBalancer **/
}
```

Expand All @@ -100,7 +101,7 @@ $loadBalancer->update(array(
#### Updating multiple attributes of a load balancer
```php
$loadBalancer->update(array(
'name' => 'New name',
'name' => 'New name',
'algorithm' => 'ROUND_ROBIN'
));
```
Expand All @@ -126,9 +127,9 @@ is returned.

```php
$nodes = $loadBalancer->listNodes();
foreach ($nodes as $node)
{
var_dump($node); // instance of OpenCloud\LoadBalancer\Resource\Node}
foreach ($nodes as $node) {
/** @var $node OpenCloud\LoadBalancer\Resource\Node **/
}
```

### Add Nodes
Expand All @@ -138,10 +139,8 @@ You can attach additional nodes to a load balancer. Assume `$loadBalancer` alrea
**Important:** Remember to call `$loadBalancer->addNodes()` after all the calls to `$loadBalancer->addNode()` as shown below.

```php
$loadBalancer->addNode(
$serverThree->addresses->private[0]->addr,
8080
);
$address = $serverThree->addresses->private[0]->addr;
$loadBalancer->addNode($address, 8080);
$loadBalancer->addNodes();
```

Expand Down Expand Up @@ -178,7 +177,7 @@ $node->update(array(
```php
$node->update(array(
'condition' => 'DISABLED',
'type' => 'SECONDARY'
'type' => 'SECONDARY'
));
```

Expand All @@ -198,32 +197,33 @@ $loadBalancer->removeNode(490639);

The `removeNode` method, as shown above, accepts the following arguments:

| Position | Description | Data type | Required? | Default value |
| ----------- | --------------- | -------------- |-------------- | ----------------- |
|Position| Description | Data type | Required? | Default value |
|----------- | --------------- | -------------- |-------------- | ----------------- |
| 1 | ID of node | Integer | Yes | - |

### View Node Service Events
You can view events associated with the activity between a node and a load balancer. An instance of `OpenCloud\Common\Collection\PaginatedIterator` is returned.

```php
$nodeEvents = $loadBalancer->nodeEventList();
foreach ($nodeEvents as $nodeEvent){
var_dump($nodeEvent); // instance of OpenCloud\LoadBalancer\Resource\NodeEvent
foreach ($nodeEvents as $nodeEvent) {
/** @var $nodeEvent OpenCloud\LoadBalancer\Resource\NodeEvent **/
}
```

## Virtual IPs
A **virtual IP (VIP)** makes a load balancer accessible by clients. The load balancing service supports either a public VIP address (`PUBLIC`), routable on the public Internet, or a ServiceNet VIP address (`SERVICENET`), routable only within the region in which the load balancer resides.

A **virtual IP (VIP)** makes a load balancer accessible by clients. The load balancing service supports either a public VIP address (`PUBLIC`), routable on the public Internet, or a ServiceNet VIP address (`SERVICENET`), routable only within the region in which the load balancer resides.

### List Virtual IPs

You can list the VIPs associated with a load balancer. An instance of `OpenCloud\Common\Collection\PaginatedIterator` is returned.

```php
$vips = $loadBalancer->virtualIpList();
foreach ($vips as $vip)
{
var_dump($vip); // instance of OpenCloud\LoadBalancer\Resource\VirtualIp}
foreach ($vips as $vip) {
/** @var $vip of OpenCloud\LoadBalancer\Resource\VirtualIp **/
}
```

### Add Virtual IPv6
Expand Down Expand Up @@ -262,9 +262,9 @@ You can list all supported load balancing algorithms using a load balancer servi

```php
$algorithms = $loadBalancerService->algorithmList();
foreach ($algorithms as $algorithm)
{
var_dump($algorithm); // instance of OpenCloud\LoadBalancer\Resource\Algorithm}
foreach ($algorithms as $algorithm) {
/** @var $algorithm OpenCloud\LoadBalancer\Resource\Algorithm **/
}
```

## Protocols
Expand All @@ -277,9 +277,9 @@ You can list all supported network protocols using a load balancer service objec

```php
$protocols = $loadBalancerService->protocolList();
foreach ($protocols as $protocol)
{
var_dump($protocol); // instance of OpenCloud\LoadBalancer\Resource\Protocol}
foreach ($protocols as $protocol) {
/** @var $protocol OpenCloud\LoadBalancer\Resource\Protocol **/
}
```

## Sessions
Expand All @@ -304,4 +304,4 @@ foreach ($protocols as $protocol)

## Statistics

## Usage Reports
## Usage Reports

1 comment on commit a54ffcb

@ycombinator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the fixes @jamiehannaford. I've made a note of them for future documentation.

Please sign in to comment.