Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
cfc126b
Adding initial version of code samples for networking.
ycombinator Nov 1, 2014
d77430a
Create ports and subnets from service object.
ycombinator Nov 3, 2014
d77a8bf
First cut at unit tests and implementation.
ycombinator Nov 4, 2014
7e66bcf
Merge branch 'working' into networking
ycombinator Nov 4, 2014
9db5e4e
Trivial whitespace lint fixes.
ycombinator Nov 4, 2014
3b9d2d0
Adding unit tests and implementation for bulk creation operations.
ycombinator Nov 5, 2014
eb30f38
Adding smoke tests.
ycombinator Nov 6, 2014
bc2c93a
Fixing update-able attributes based on empirical evidence.
ycombinator Nov 6, 2014
ee8a9a3
Recursively alias properties.
ycombinator Nov 6, 2014
72e3d10
Adding aliases for sub-properties.
ycombinator Nov 6, 2014
07c0456
Using camelCase sub-properties.
ycombinator Nov 6, 2014
f436fb9
Fleshing out update examples.
ycombinator Nov 6, 2014
6f61eb8
Adding more nuanced create subnet samples.
ycombinator Nov 6, 2014
f3a8f4b
Make the PSR-2 checker happy.
ycombinator Nov 6, 2014
1f7cfaa
Adding previously-MIA header comment.
ycombinator Nov 6, 2014
149d5ce
Referencing class using @see annotation.
ycombinator Nov 6, 2014
96e8b80
Removing unnecessary annotation.
ycombinator Nov 6, 2014
9603d49
Using FQCNs in method docblocks.
ycombinator Nov 6, 2014
d4f4132
Type hinting array method parameters.
ycombinator Nov 6, 2014
52a2b9e
Clearly delimiting variable used to determine object property name.
ycombinator Nov 6, 2014
9c87db0
Fleshing out class header comments for Networking resources.
ycombinator Nov 6, 2014
b30e306
Start of Networking user guide.
ycombinator Nov 6, 2014
344ba57
Adding TOC.
ycombinator Nov 6, 2014
e4b6ec7
Fixing network name to avoid confusion with VPN.
ycombinator Nov 7, 2014
8682a2c
Fleshing out user guide for Networks.
ycombinator Nov 7, 2014
2c6c25a
Using better sample names and IDs.
ycombinator Nov 7, 2014
37b24db
Fleshing out user guide section on Subnets.
ycombinator Nov 7, 2014
b756939
Trivial whitespace lint fixes.
ycombinator Nov 7, 2014
cba317a
Making examples values in subnet parameters table consistent with sam…
ycombinator Nov 7, 2014
b8c4aee
Fleshing out user guide section on Ports.
ycombinator Nov 7, 2014
8d50142
Trivial whitespace fix.
ycombinator Nov 7, 2014
915a579
Adding quickstart README.
ycombinator Nov 7, 2014
63d2e72
Adding links to creation parameters' docs.
ycombinator Nov 7, 2014
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
76 changes: 76 additions & 0 deletions docs/userguide/Networking/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Networking

**Networking** is a service that you can use to create virtual networks and attach cloud devices such as servers to these networks.

## Concepts

## Concepts

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

* **Network**: A network is an isolated virtual layer-2 broadcast domain that is typically reserved for the tenant who created it unless you configure the network to be shared. The network is the main entity in the Networking service. Ports and subnets are always associated with a network.

* **Subnet**: A subnet represents an IP address block that can be used to assign IP addresses to virtual instances (such as servers created using the Compute service). Each subnet must have a CIDR and must be associated with a network.

* **Port**: A port represents a virtual switch port on a logical network switch. Virtual instances (such as servers created using the Compute service) attach their interfaces into ports. The port also defines the MAC address and the IP address(es) to be assigned to the interfaces plugged into them. When IP addresses are associated to a port, this also implies the port is associated with a subet, as the IP address is taken from the allocation pool for a specific subnet.


## Getting started

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

To use the Networking 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 an Networking service object from the client.
All Networking operations are done via an _networking service object_. To
instantiate this object, call the `networkingService` method on the `$client`
object. This method takes two arguments:

| 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 | `cloudNetworks` |
| 2 | Cloud region | String | Yes | - | `DFW` |


```php
$region = '<CLOUD REGION NAME>';
$networkingService = $client->networkingService(null, $region);
```

Any networks, subnets, and ports created with this `$networkingService` instance will
be stored in the cloud region specified by `$region`.

### 3. Create a network.
```php
$network = $networkingService->createNetwork(array(
'name' => 'My private backend network'
));
```

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

## Next steps

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